//--------------------------------------------------------------////											DEBUG////--------------------------------------------------------------->var debug = 0;  //1 = debugger on; 0 = debugger offif (debug)	debugWindow = window.open("","debugWin","width=300,height=400,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=yes,directories=no,alwaysRaised=yes,dependent=no");function trace(str) {	if (debug)	{		debugWindow.document.writeln(str + "<BR>");  }}//--------------------------------------------------------------////											PSEUDO-CGI////--------------------------------------------------------------->// SET STRING TO CGI CALLING PARAMETERS (A QUESTION MARK ALWAYS PRECEDES//  THE CGI CALLING PARAMETERS [NAME/VALUE PAIRS] WHICH TAKE ON THE//  FOLLOWING FORMAT:////  ?NAME1=VALUE1&NAME2=VALUE2...&NAMEn=VALUEn//var thisPageURL = window.location.href;var cgiString = "";if( thisPageURL.indexOf('?') >= 0 )	cgiString = thisPageURL.substring(thisPageURL.indexOf('?'),thisPageURL.length);cgiString = unescape(cgiString);thisPageURL = thisPageURL.substring(0,thisPageURL.length-cgiString.length);var DELIMETER = '&';var SEPARATOR = '=';function getParameterValue(name){	paramValue = '';    if (cgiString.indexOf(name + SEPARATOR) != -1)    {		paramValue = cgiString.substring(cgiString.indexOf(name + SEPARATOR) + name.length + 1, cgiString.length);		if (paramValue.indexOf(DELIMETER) != -1)			paramValue = paramValue.substring(0, paramValue.indexOf(DELIMETER));	}	return paramValue;}//--------------------------------------------------------------////											SHOWIMAGE////---------------------------------------------------------------var htmlRootUrl = "../_images/";var imagesRootUrl = "../_images/";var imageWindow;function showImage( imageUrl, width, height, folder ){	windowWidth = width + 32;	if( 1 )	{		imageWindow = window.open( "", "imageWin", "width=200,height=400,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=yes,directories=no,dependent=no" );		imageWindow.location.href= htmlRootUrl+"show_image.html?imageUrl="+imageUrl+"&width="+width+"&folder="+folder;		imageWindow.focus();	}	else	{		// htmlRootUrl+"show_image.html?imageUrl="+imageUrl		imageWindow = window.open( "", "imageWin", "width=300,height=400,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=yes,directories=no,dependent=no" );		imageWindow.document.write("<html>");		imageWindow.document.write("<head><title>Image</title></head>");		imageWindow.document.write("<body>");		imageWindow.document.write( "<img src='"+imagesRootUrl+imageUrl+"' width='100%'>" );		imageWindow.document.write("</body>");		imageWindow.document.write("</html>");		imageWindow.focus();	}}function generateImageWindow(){	trace("generateImageWindow");	imageUrl = getParameterValue( "imageUrl" );	imageFolder = getParameterValue( "folder" );	trace("imageUrl = '"+imageUrl+"'");	document.write( "<p align='center'>" );	document.write( "<img src='" + imagesRootUrl + imageFolder + "/"+ imageUrl + "'>" );	document.write( "</p>" );	//	width = Number(getParameterValue( "width" ));	if( width != 0 )	{		// trace( "width = " + width );		// newWidth = width + 32 - window.innerWidth;		// trace( "clientWidth = " + window.document.body.clientWidth );		//		// window.resizeBy( newWidth, 0 );		//		document.write( "<script type=\"text/javascript\" language=\"javascript\"> " );		document.write( "function LoadEvent() " );		document.write( "{ " );		document.write( "   deltawidth="+String(width)+"+32-window.document.body.clientWidth;" );	// ie//		document.write( "   deltawidth="+String(width)+"+32-window.innerWidth;" );	// ns//		document.write( "	alert(deltawidth);" );		document.write( "	window.resizeBy(deltawidth,0); " );		document.write( "} " );		document.write( " " );		document.write( "window.onload = LoadEvent; " );		document.write( "</script> " );	}}
