
//--------------------------------------------------------------
//
//											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>");
    //var System = java.lang.System;
    //System.err.println(str);
  }
}


//--------------------------------------------------------------
//
//											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;
}

