function postComment( root, ppath, tPath, imgNum, tw, th ) {
	commentWin = window.open( "", "commentDisplayWin", "location=no,scrollbars=no,toolbar=no,width=300,height=400" );
	commentWin.document.write( "<html><head><title>Post Photo Comment :: CGarvey.com</title><link rel=\"stylesheet\" href=\"../../../client/cgarvey.css\" type=\"text/css\"></HEAD>" );
	commentWin.document.write( "<body><form method=\"post\" action=\"../../../comments.cgi\">" );
	commentWin.document.write( "<center><img src=\"" + root + escape( ppath ) + escape( tPath ) + "\" width=\"" + tw + "\" height=\"" + th + "\"></center><br><br>" );
	commentWin.document.write( "<input type=\"hidden\" name=\"path\" value=\"" + ppath + "\">" );
	commentWin.document.write( "<input type=\"hidden\" name=\"imgnum\" value=\"" + imgNum + "\">" );
	commentWin.document.write( "<font face=\"verdana\" size=\"1\">Your Name:</font><br><input type=\"text\" name=\"name\" size=\"20\" value=\"\"><br><br>" );
	commentWin.document.write( "<font face=\"verdana\" size=\"1\">Comments:</font><br><textarea rows=\"5\" cols=\"20\" name=\"comment\"></textarea><br><br>" );
	commentWin.document.write( "<input type=\"submit\" value=\"OK\">&nbsp;&nbsp;<input type=\"button\" value=\"Cancel\" onClick=\"javascript:window.close();\">" );

	commentWin.document.write( "</body></html>" );
	commentWin.document.close();
	if( commentWin ) commentWin.focus();
}

function showPic(path, w, h) {
	photoWin = window.open("","photoDisplayWin","location=no,scrollbars=no,toolbar=no,width=" + w + ",height=" + h);
	photoWin.document.open();
	photoWin.document.write( "<html><head><style type=\"text/css\">body {margin: 0px; padding: 0px;} html{ overflow: hidden; }</style><title>Cathal's Photos</title></head>" );
	photoWin.document.write( "<body><a title=\"Click to close\" href=\"javascript:window.close();\"><img src=\"" + path + "\" alt=\"Click to close!\"" );
	photoWin.document.write( " width=\"" + w + "\" height=\"" + h + "\"" );
	photoWin.document.write( " border='0'></body></html>" );
	photoWin.document.close();
	if( photoWin ) photoWin.focus();
}

function showPhotoComment( iID, sParentPath, sThumbPath, iW, iH ) {
	if( Lightbox ) {
		Lightbox.close();
		if( $( "dvInstruct" ) && $( "dvComment" ) ) {
			$( "dvInstruct" ).className = "dvHidden";
			$( "dvComment" ).className = "dvPhotoComment";
			if( document.forms && document.forms['frmComment'] ) {
				var el = document.forms['frmComment'].elements;
				if( el['path'] ) el['path'].value = sParentPath;
				if( el['imgnum'] ) el['imgnum'].value = iID;
			
				if( $( "imgCommentThumb" ) ) {
					$( "imgCommentThumb" ).src = sParentPath + "/" + sThumbPath;
					$( "imgCommentThumb" ).width = iW;
					$( "imgCommentThumb" ).height = iH;
				}
			}
			else alert( "No form" );
		}
		else alert( "no divs" );
	}
	else alert( "No lightbox" );
}
function hidePhotoComment() {
	if( $( "dvInstruct" ) && $( "dvComment" ) ) {
		$( "dvInstruct" ).className = "txtBody";
		$( "dvComment" ).className = "dvHidden";
	}
	else alert( "no divs" );
}

function highlightAlert( el ) {
	if( el ) {
		var eff1 = el.effect( 'background-color', {duration: 1000} );
		eff1.start( "#009900" ).chain( function() { eff1.start( "#DDDDDD" ); } );
		var eff2 = el.effect( 'color', {duration: 1000} );
		eff2.start( "#FFFFFF" ).chain( function() { eff2.start( "#009900" ); } );
		window.setTimeout( "hideDiv( '" + el.id + "' );", 6000 );
	}
}

function highlightError( el ) {
	if( el ) {
		var eff1 = el.effect( 'background-color', {duration: 1000} );
		eff1.start( "#FF0000" ).chain( function() { eff1.start( "#DDDDDD" ); } );
		var eff2 = el.effect( 'color', {duration: 1000} );
		eff2.start( "#FFFFFF" ).chain( function() { eff2.start( "#FF0000" ); } );
		window.setTimeout( "hideDiv( '" + el.id + "' );", 6000 );
	}
}

function hideDiv( sElName ) {
	if( $( sElName ) ) {
		var eff = new Fx.Slide( sElName );
		eff.slideOut();
	}
}


