/*
	$Log$
*/
var DEBUG=true;
// JavaScript Utility functions
/* The following lines extend the String class.  For example, instead of coding
      trim(str)
	you may code
	   str.trim()
	to keep from calling trim on an unsupported type.
   The actual methods are defined below */
String.prototype.trim=function(allSpace){return trim(this,allSpace);};
String.prototype.trimLeft=function(allSpace){return trimLeft(this,allSpace);};
String.prototype.trimRight=function(allSpace){return trimRight(this,allSpace);};
String.prototype.right=function(len){ return this.substr(this.length-len);};
String.prototype.left=function(len){return this.substr(0,len);};
String.prototype.pad=function(len,ch,side){return pad(this,len,ch,side);};
String.prototype.encode=function() { return encode(this);};
String.prototype.decode=function() { return decode(this);};
String.prototype.toEntity=function() { return toEntity(this);};
String.prototype.fromEntity=function() { return fromEntity(this);};
String.prototype.toDouble=function() { return toDouble(this);};
String.prototype.toInt=function() { return toInt(this);};
String.prototype.commaEdit=function(places){ return commaEdit(this,places);};
Array.prototype.indexOf=function(obj) { return Array_indexOf(this,obj);};
Number.prototype.div=function(divisor,floatDiv){return Math.floor(this.valueOf()/(floatDiv ? divisor : Math.floor(divisor)));};
/* This line allows comma editing of any number variable */
Number.prototype.commaEdit=function(places){ return commaEdit(this,places);};
var validNumber = /^-?[0-9]*(\.[0-9]+[1-9])?$/
function GCA_Util()
{
}
GCA_Util.toDouble=toDouble;
GCA_Util.commaEdit=commaEdit;
GCA_Util.toInt=toInt;
/* Convert actual characters to their entity sequences &amp, &lt, &gt, and &quot */
function toEntity(str)
{	var oldStr=(str==null) ? this.toString() : str.toString();
	var highCharRE=/([^ -\}])/;
	oldStr=oldStr.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\"/g,"&quot;");
	while (highCharRE.test(oldStr))
	{
		oldStr=oldStr.replace(highCharRE, "&#"+(RegExp.$1).charCodeAt()+";");
	}
	return oldStr;
}
/* Convert entity sequences &amp, &lt, &gt, and &quot to their actual characters */
function fromEntity(str)
{	var i=0;
	var oldStr=(str==null) ? this.toString() : str.toString();
	var entRE=/(&\#(\d+);)/;
	oldStr=oldStr.replace(/\&lt\;/g,"<").replace(/\&gt\;/g,">").replace(/\&quot\;/g,"\"").replace(/\&amp\;/g,"&");
	while (entRE.test(oldStr))
	{
		oldStr=oldStr.replace(entRE, String.fromCharCode(RegExp.$2));
	}
	return oldStr;
}
function pad(str,len,ch,side)
{
	if (!len)
	{	return "";
	}
	if (str)
	{	str=str.toString();
	}
	if (!ch)
	{	ch=" ";
	}
	var retString="";
	for (var i=0; i<len; i++)
	{	retString+=ch;
	}
	if (side)
	{	retString+=str;
		retString=retString.substr(retString.length-len);
	} else
	{	retString=str+retString;
		retString=retString.substr(0,len);
	}
	return retString;
}
/* Remove space from both ends of a string.  If allSpace is false or omitted,
   only actual space characters (\u0020) are removed. */
function trim(str,allSpace)
{
	var reLeft=(allSpace) ? /^\s+/ : /^ +/;
	var reRight=(allSpace) ? /\s+$/ : / +$/;
//	var oldStr=(str==null) ? this.toString() : str.toString();
	var oldStr=str.toString();
	return oldStr.replace(reLeft,"").replace(reRight,"");
}
/* Remove space from the beginning a string.  If allSpace is false or omitted,
   only actual space characters (\u0020) are removed. */
function trimLeft(str,allSpace)
{
	var reLeft=(allSpace) ? /^\s+/ : /^ +/;
//	var oldStr=(str==null) ? this.toString() : str.toString();
	var oldStr=str.toString();
	return oldStr.replace(reLeft,"");
}
/* Remove space from the end of a string.  If allSpace is false or omitted,
   only actual space characters (\u0020) are removed. */
function trimRight(str,allSpace)
{
	var reRight=(allSpace) ? /\s+$/ : / +$/;
//	var oldStr=(str==null) ? this.toString() : str.toString();
	var oldStr=str.toString();
	return oldStr.replace(reRight,"");
}
/* Comma edits (0,000,000.00000) a number or a string of a number.
   Before processing, any commas and all but the first decimal point are
	removed.  Fills the decimal portion with zeroes to the length specified in
	places. */
function commaEdit(str,places)
{
//	var oldStr=(str==null) ? this.toString() : str.toString();
	var oldStr=str.toString();
	var badChar=oldStr.search(/[^0-9,.]/);
	if (badChar!=-1)
	{	oldStr=oldStr.substring(0,badChar);
	}
	if (!places)
	{	places=0;
	}
// nothing but digits and periods; remove leading zeros
	var newStr=oldStr.replace(/[^0-9.]/g,"").replace(/^0+/,"");
	var p=newStr.indexOf("."); // get location of first period
	var p1=(p==-1) ? newStr.length : p;
	var strInt=newStr.substring(0,p1); // get integer portion
	if (strInt=="")
	{	strInt="0";
	}
	var strZeros="0000000000000000";
	var strDec=String(newStr.substring(p1).replace(/\./g,"")+strZeros).substring(0,places); // get decimal portion
	for (var i=strInt.length-3; i>0; i-=3)
	{	strInt=strInt.substring(0,i)+","+strInt.substring(i);
	}
	var retVal=strInt+((p==-1 && places==0)?"":".")+strDec;
	return retVal;
}
/* Converts a string to a floating point value. */
function toDouble(str)
{
	var oldStr=str.toString().trim();
	var leadingSign=(oldStr.charAt(0)=='+' || oldStr.charAt(0)=='-') ? oldStr.charAt(0) : "";
	var badChar=oldStr.search(/[^0-9,.+\-]/);
	if (badChar!=-1)
	{	var hasSign=(leadingChar=='+' || leadingChar=='-') ? 1 : 0;
		oldStr=oldStr.substring(hasSign,badChar);
	}
	if (oldStr.charAt(0)=='+'||oldStr.charAt(0)=='-')
	{	leadingSign=oldStr.charAt(0);
		oldStr=oldStr.substring(1);
	}
	var newStr=oldStr.replace(/[^0-9.]/g,""); // nothing but digits and periods
	var p=newStr.indexOf("."); // get location of first period
	var p1=(p==-1) ? newStr.length : p;
	var strInt=newStr.substring(0,p1); // get integer portion
	var strDec=newStr.substring(p1).replace(/\./g,""); // get decimal portion
	var retVal=parseFloat(leadingSign+strInt+"."+strDec);
	return retVal;
}
/* Converts a string to an integer value */
function toInt(str)
{
	var oldStr=str.toString().trim();
	var badChar=oldStr.search(/[^0-9,.]/);
	if (badChar!=-1)
	{	oldStr=oldStr.substring(0,badChar);
	}
	var newStr=oldStr.replace(/[^0-9.]/g,""); // nothing but digits and periods
	var p=newStr.indexOf("."); // get location of first period
	var p1=(p==-1) ? newStr.length : p;
	var strInt=newStr.substring(0,p1); // get integer portion
	return parseInt("0"+strInt,10);
}
function sgn(num)
{
	if (isNaN(num))
	{	return NaN;
	}
	return !num ? 0 : num>0 ? 1 : -1;
}
function round(num,places)
{
	var roundedNum=0;
	if (!places)
	{	places=0;
	}
	roundedNum=Math.round(num*Math.pow(10,places))/Math.pow(10,places);
	return roundedNum;
}
/* Replaces sequences of new lines with a single space */
function flow(txt,hard)
{
	var retString=txt.replace(/\r\n/g," ").replace(/\s/g," ");
	if (hard)
	{	retString=retString.replace(/&nbsp;/g," ");
	}
	return retString;
}
/* Replaces spaces with non-breaking spaces, and hyphens with minuses. */
function dontWrap(txt)
{
	return txt.replace(/ /g,"&nbsp;").replace(/\-/g,"&minus;");
}
/* JavaScript equivilent of Java's URLEncoder.encode(). */
function encode(str)
{	var oldStr=str.toString();//(str==null) ? this.toString() : str.toString();
	return escape(oldStr).replace(/ /g,"+")
}
/* JavaScript equivilent of Java's URLDecoder.decode(). */
function decode(str)
{	var oldStr=str.toString();//(str==null) ? this.toString() : str.toString();
	return unescape(oldStr.replace(/\+/g," ")).replace(/%2B/g,"+");
}
/* Returns the index of an SELECT's OPTION that has the specified value */
function optionIndex(select, value)
{	var options=select.options;
	var foundIndex=-1;
	for (var i=0; i<options.length; i++)
	{	if (options[i].value==value)
		{	foundIndex=i;
			break;
		}
	}
	return foundIndex;
}
/* Returns the text specified by a SELECT's OPTION. */
function optionText(select, value)
{	var index=optionIndex(select, value)
	if (index>=0)
	{	return select.options[index].text;
	}
	return "";
}
/* Returns the selected OPTION of a SELECT.  Then use .value */
function selectedOption(select)
{
	return select.options[select.selectedIndex];
}
/* Ensures the value contained within obj represents a valid date.  If msg is
   specified, a message is displayed */
function valiDate(obj, msg)
{
	var dateString=obj.value.replace(/\-/g,'/');
	if (isNaN(Date.parse(dateString)))
	{	if (msg)
		{	
			alert(obj.value+" is an invalid date.");
		}
		obj.focus();
		return false;
	}
	return true;
}
/* Ensures the value contained within obj represents a valid number.  If msg is
   specified, a message is displayed */
function valiNum(obj, msg)
{
	oldString=obj.value;
	var numString=oldString.trim(true);
	if (isNaN(parseInt(numString)))
	{	
		if (msg)
		{
			alert(obj.value+" is an invalid number.");
		}
		obj.focus();
		return false;
	}
	return true;
}
/* The following lines extend the Date class.  The methods are defined below */
Date.prototype.ymd=function(){ return ymd(this);};
Date.prototype.mdy=function(){ return mdy(this);};
Date.prototype.mdyWrap=function(){ return mdyWrap(this);};
Date.prototype.daysApart=function(date) { return daysApart(this,date); };
Date.prototype.getWeekdayDate=function(weekNum, dayNum) { return getWeekdayDate(this,weekNum,dayNum);};
Date.prototype.getTimeOfDayMs=function() { return getTimeOfDayMs(this);};
Date.prototype.setTimeOfDayMs=function(newTime) { setTimeOfDayMs(this,newTime);};
Date.prototype.getNext=function(nextDay) { return getNext(this,nextDay);};
/* Returns the specified date in yyyy-MM-dd format */
function ymd(date)
{
//	var dateString=(date==null) ? this.toString() : date.toString()
	var dateString=date.toString();
	if (isNaN(Date.parse(dateString)))
	{	return "0001-01-01";
	}
	date=new Date(dateString);
	var year="0000"+date.getFullYear();
	var month="00"+(date.getMonth()+1);
	var day="00"+date.getDate();
	var ymdDate=year.substr(year.length-4,4)+"-"+month.substr(month.length-2,2)+"-"+day.substr(day.length-2,2);
	return ymdDate;
}
/* Returns the specified date in MM/dd/yyyy format */
function mdy(date)
{
//	var dateString=(date==null) ? this.toString() : date.toString()
	var dateString=date.toString();
	if (isNaN(Date.parse(dateString)))
	{	return "01/01/0001";
	}
	date=new Date(dateString);
	var year="0000"+date.getFullYear();
	var month="00"+(date.getMonth()+1);
	var day="00"+date.getDate();
	var ymdDate=month.substr(month.length-2,2)+"/"+day.substr(day.length-2,2)+"/"+year.substr(year.length-4,4);
	return ymdDate;
}
/* Returns the specified date as MM/dd/<BR>yyyy, to force a line break before
   the year. */
function mdyWrap(date)
{
//	var dateString=(date==null) ? this.toString() : date.toString();
	var dateString=date.toString();
	if (isNaN(Date.parse(dateString)))
	{	return "01/01/<BR>0001";
	}
	var year="0000"+date.getFullYear();
	var month="00"+(date.getMonth()+1);
	var day="00"+date.getDate();
	var mdyDate=month.substr(month.length-2,2)+"/"+day.substr(day.length-2,2)+"/<BR>"+year.substr(year.length-4,4);
	return mdyDate;
}
function daysApart(date1,date2)
{
	var sign=0;
	var days=0;
	var millis=0;
	if (!date1)
	{
		date1 = new Date("01/01/0001");
	}
	if (!date2)
	{
		date2 = new Date("01/01/0001");
	}
	date1.setHours(0,0,0,0);
	date2.setHours(0,0,0,0);
	millis=date1.valueOf() - date2.valueOf();
	days=millis / 86400000.0;
	sign=days>0 ? 1 : days<0 ? -1 : 0;
	return sign*Math.floor(Math.abs(days));
}
// Returns the weekNumth dayNum of the month (e.g., the third Wednesday)
function getWeekdayDate(date, weekNum, dayNum)
{
	// we only want week numbers 1-5; 5 also means "last" if there are only 4
	weekNum=(parseInt(weekNum)+4)%5+1;
	// and day numbers 0-6
	dayNum=parseInt(dayNum)%7;
	// get requested month
	var month=date.getMonth();
	// get new date based on requested date.
	var newDate=new Date(date.valueOf());
	// and set its day of the month to 1
	newDate.setDate(1);
	// get day of week of 1st of month
	var firstDayWeekday=newDate.getDay();
	// get day of month for requested day.
	var newWeekdayDate=(weekNum-1)*7+(dayNum-firstDayWeekday+7)%7+1;
	// determine if day is past end of month
	// go one month ahead
	newDate.setMonth(newDate.getMonth()+1);
	// set day of month to 0, this sets date to last day of requested month
	newDate.setDate(0);
	// determine if found date is past end of month, if so, go back a week.
	// (e.g., user requested 5th Thursday in month when there were only 4
	var daysInMonth=newDate.getDate();
	if (newWeekdayDate>daysInMonth)
	{	newWeekdayDate-=7;
	}
	// set date of weekNumth dayNum
	newDate.setDate(newWeekdayDate);
	return newDate;
}
// extracts the number of ms since midnight for the given date object
function getTimeOfDayMs(date)
{
	return (((date.getHours()*60)+date.getMinutes())*60+date.getSeconds())*1000+date.getMilliseconds();
}
// sets the number of ms since midnight for the given date object
function setTimeOfDayMs(date,newTime)
{					
	date.setTime(date.getTime()-date.getTimeOfDayMs()+newTime);
}
// returns date of this or next occurrence of specified day of the week
function getNext(date,nextDay)
{
	if (isNaN(date))
	{
		return "No date provided";
	}
	if (date.getDay()==nextDay)
	{
		return date
	}
	return new Date(date.valueOf()+(nextDay-date.getDay()+7)%7*86400000);
}
/* For debugging purposes.  Enumerates an objects properties and their values */
function showProps(objRef, objName, showIndexes)
{
	if (!DEBUG)
	{	return false;
	}
	var obj=objRef;
	if (typeof(objRef)=='string')
	{	obj=eval(objRef);
		objName=objRef;
	}
	if (showIndexes==null)
	{	showIndexes=false;
	}
   var result = "";
   if (!obj)
   {	return confirm("obj is null");
   }
	if	(typeof(objRef)=='number' || typeof(objRef)=='boolean')
	{	return (objName+"="+objRef);
	}/* else if (typeof(obj)!="object")
   {	return confirm("obj has no properties");
   }	*/

   if (!objName)// objName="obj";
	{//	alert(objName + "/"+typeof(obj.name)+"/"+typeof(obj.id))
		if (obj.name)
		{	objName=obj.name;
		} else if (obj.id && obj.id!="")
		{	objName=obj.id;
		} else
		{	objName=getTypeOf(obj);//.toString();
		}
	}
	var props=new Array();
   for (var i in obj)
	{//	alert(i);
//		continue;
		if (i!="frameElement" && i!="external" && i!="clientInformation" && i!="fileUpdatedDate"
		 && (showIndexes || isNaN(i))) 
		{
			if (obj[i] && typeof(obj[i])!="function")// + "." + i + "=" + obj[i]);
			{
//				alert(props.length+"="+i);
				var val=""+obj[i];
			// alert(objName+"."+i+"="+obj[i]);
//				alert(i+"="+val.length+"\n"+val);
				result=objName + "." + i + "=";
				result+= val.length>256 ? val.substr(0,256) : val;//(obj[i]==null ? "undefined" : obj[i]) + "\t    ";
				props[props.length]=result;
	   	}
		}
	}
	props.sort();
	var resultString=props.join("\t");//.toString().replace(/\\t/g,"\t").replace(/\\n/g,"\n");
   return confirm("Result: "+resultString);
}
function getProps(obj, objName, showIndexes, propertyStyleFunction)
{
	if (showIndexes==null)
	{	showIndexes=false;
	}
   var result = "";
   if (objName==null) objName="obj";/*
	{//	alert(objName + "/"+typeof(obj.name)+"/"+typeof(obj.id))
		if (typeof(obj.name)!="undefined")
		{	objName=obj.name;
		} else if (typeof(obj.id)!="undefined" && obj.id!="")
		{	objName=obj.id;
		} else
		{	objName=obj.toString();
		}
	}	 												  */
	var props=new Array();
   for (var i in obj)
	{//	alert(i);
//		continue;
		if (i!="frameElement" && i!="external" && i!="clientInformation" && i!="fileUpdatedDate"
		 && (showIndexes || isNaN(i)) ) 
		{
			if (obj[i])// + "." + i + "=" + obj[i]);
			{
//				alert(props.length+"="+i);
				var val=""+obj[i];
			// alert(objName+"."+i+"="+obj[i]);
//				alert(i+"="+val.length+"\n"+val);
				result="\t"+propertyStyleFunction(objName + "." + i) + "=";
				result+= val.length>256 ? val.substr(0,256)+"\n" : val;//(obj[i]==null ? "undefined" : obj[i]) + "\t    ";
				props[props.length]=result;
	   	}
		}
	}
	var resultString=props.sort().toString().replace(/\\t/g,"\t").replace(/\\n/g,"\n");
   return "Result: "+resultString;
}
/* Starts/stops element blinking */
function blinkText(aObjStr,value)
{
	// Initialize "static" variables
	if (!this.blinkingElements)
	{	this.blinkingElements=new Object();
	}
	if (this.blinkShown==null)
	{	this.blinkShown=true;
	}
	if (!this.blinkInterval)
	{	this.blinkInterval=null;
		if (!aObjStr) // if called with no parameters just return
		{	return;
		}
	}
	var obj=null, hid="", vis="";
	var numBlinking=0;
	if (aObjStr) // Not called by setInterval
	{	if (!this.blinkingElements[aObjStr])
		{	if (value) // add element to start it blinking
			{	this.blinkingElements[aObjStr]=1;
			}
		} else
		{	if (value) // set existing element to blink
			{	this.blinkingElements[aObjStr]=1;
			} else // existing element to stop blinking and be deleted
			{	this.blinkingElements[aObjStr]=0;
			}
		}
	} else
	{	for (objStr in this.blinkingElements) // toggle all blinking elements
		{	if (document.layers) // NN4
			{	obj=eval("document."+objStr);
				vis='obj';
				if (this.blinkingElements[objStr])
				{	hid=this.blinkShown ? "'hide'" : "'show'";
				} else
				{	hid="'show'";
				}
			} else // IE, NN6
			{	obj=eval(document.all ? "document.all."+objStr : "document.getElementById('"+objStr+"')");
				vis='obj.style';
				if (this.blinkingElements[objStr]) // toggle status if 1
				{	hid=this.blinkShown ? "'hidden'" : "'visible'";
				} else // set to visible if now zero
				{	hid="'visible'";
				}
			}
			var evalStr=vis+".visibility="+hid;
			if (obj && eval(vis)) // ensure object exists
			{
				eval(evalStr); // execute style change
			}
			if (this.blinkingElements[objStr])
			{	numBlinking++; // count number of blinking elements
			} else // remove this element from array
			{	delete this.blinkingElements[objStr];
			}
		}
	}
	if (value) // blinking requested
	{	if (!this.blinkInterval) // not already blinking elements
		{	this.blinkInterval=setInterval("blinkText()",500);
		}
	} else if (!aObjStr && !numBlinking) // no element specified and no more elements to blink
	{	clearInterval(this.blinkInterval);
		this.blinkInterval=null;
		this.blinkingElements=new Object();
		this.blinkShown=true;
	} else // simply toggle value for next iteration
	{	this.blinkShown=!this.blinkShown;
	}
}
/* Determines, using JavaScript hierarchy, if an object is a descendant of
   the specified class (constructor) */
function instanceOf(obj,constructor) {
	if (obj.__proto__)
	{
		while (obj)
		{
			if (obj == constructor.prototype)
			{
				return true; 
			}
			obj = obj.__proto__; 
		}
	} else
	{	return eval("obj instanceof constructor");
	}
	return false; 
};
/* Returns a string indicating the actual type of given variable x.  The native
   typeof operator simply returns "object" for any object, rather than its
	actual class. */
function getTypeOf(x)
{
	var t=typeof(x);
	if (t=="object" && x!=null)
	{
		if (typeof(x.constructor) != "undefined")
		{
			var ctor = new String(x.constructor);
			var chStart = ctor.indexOf("function");
			var chEnd = ctor.indexOf("(");
			if (chStart != -1 && chEnd != -1)
			{
				ctor = ctor.substring(chStart+9,chEnd);
				t=ctor;
				if (t == "Array"
				 || t == "Date"
				 || t == "String"
				 || t == "Number"
				 || t == "Boolean")
				{
					t = t.toLowerCase();
				}
			}
		}
	}
	return t;
}
var wndMsgBox=null;
function msgBox(prompt,title,action,buttons)
{	var numButtons=arguments.length-3;
	if (prompt)
	{	wndMsgBox=new Object();
		wndMsgBox.win=window.open("","",
		 "resizable=1,toolbar=0,status=0,width=510,height=400,menubar=0,"+
		 "left="+((screen.availWidth-510)/2)+",top="+(screen.availHeight-400)/2);
		var docMsg=wndMsgBox.win.document;
alert(docMsg);
		docMsg.open();
		docMsg.writeln('<HEAD><TITLE>'+(title||"Message Box")+'</TITLE>');
		docMsg.writeln('<LINK rel="stylesheet" href="../WebDirect_1.css" type="text/css">');
		docMsg.writeln('<style>div{position:relative;border:0px solid black;margin:0;padding:0}');
		docMsg.writeln('body{border:none}form{margin:0;padding:0}</style></HEAD>');
		docMsg.writeln('<BODY CLASS="pgSetup">'
		 +'<DIV id="divBody"><FORM NAME="frmMsgBox"><TABLE WIDTH="100%" BORDER="0">');
		docMsg.writeln('<TR><TD>'+prompt+'</TD></TR>');
		docMsg.writeln('<TR><TD ALIGN="center">');
		for (var i=1; i<=numButtons; i++)
		{	docMsg.writeln('<INPUT type="Button" name="button'+i+'" value="'+
			 arguments[i+2]+'" onmouseup="opener.wndMsgBox.returnValue='+i+'"> ');
		}
		docMsg.writeln("</TD></TR></TABLE></form></DIV></body>");
		docMsg.close();
		if (docMsg.layers)
		{	wndMsgBox.win.resizeTo(wndMsgBox.win.innerWidth,docMsg.height);
		} else
		if (docMsg.all)
		{	var newWidth=parseInt(docMsg.body.clientWidth)+parseInt(docMsg.body.leftMargin);
			var newHeight=docMsg.all.divBody.offsetHeight+docMsg.all.divBody.offsetTop*2+50;
			wndMsgBox.win.resizeTo(newWidth,newHeight);
		}
		wndMsgBox.returnValue=0;
	}
	if (wndMsgBox && wndMsgBox.win && !wndMsgBox.win.closed)
	{	var returnValue=wndMsgBox.returnValue;
		if (returnValue)
		{	wndMsgBox.win.close();
			wndMsgBox=null;
			eval(action);
		} else
		{	wndMsgBox.win.focus();
			setTimeout("msgBox(null,null,'"+action+"')",50);
		}
	}	 
}
var parameters=null;
function setParameters()
{
	parameters=location.search.substring(1).split("&");
	var parameter;
	for (var i=0; i<parameters.length; i++)
	{	parameter=parameters[i].split("=");
		parameters[parameter[0]]=parameter[1];
	}
}
function getParameter(param)
{				
	if (!parameters)
	{	setParameters();
	}
	return parameters[param] || "";
}
function include(url)
{
	document.writeln('\<SCR','IPT type="text\/javascript" src="',url,'"><\/','SCR','IPT>');
}
var _tenYearsFromNow=new Date(new Date().getTime()+1000*60*60*24*365*10);
function setCookie (cookieName, cookieValue, expires, path, domain, secure)
{	document.cookie = escape(cookieName) + '=' + escape(cookieValue) 
	 + (expires ? '; EXPIRES=' + expires.toGMTString() : '')
	 + (path ? '; PATH=' + path : '')
	 + (domain ? '; DOMAIN=' + domain : '')
	 + (secure ? '; SECURE' : '');
}

function getCookie(cookieName)
{
	var cookieValue = null;
	var posName = document.cookie.indexOf(escape(cookieName) + '=');
	if (posName != -1)
	{
		var posValue = posName + (escape(cookieName) + '=').length;
		var endPos = document.cookie.indexOf(';', posValue);
		if (endPos != -1)
		{	cookieValue = unescape(document.cookie.substring(posValue, endPos));
		} else
		{	cookieValue = unescape(document.cookie.substring(posValue));
		}
	}
	return cookieValue;
}
function Array_indexOf(arr,obj,start)
{
	if (!start)
	{	start=0;
	}
	var i=start;
	if (i>=arr.length)
	{	return -1;
	}
	for (; i<arr.length; i++)
	{	if (arr[i]==obj)
		{	break;
		}
	}
	if (i==arr.length)
	{	return -1;
	}
	return i;
}
function drawPageBorder(doc)
{
	doc.write('<div class="right"><span class="monogram">h&quot;b</span></div><div class="top"></div>');
}

function Value(aValue)
{	this.value=aValue || null;
}
Value.prototype.toString=function(){ return this.value.toString();};
function debug()
{
	var debugString="";
	for (var i=0; i<arguments.length; i++)
	{
		debugString+=arguments[i]+'\r';
	}
	if (DEBUG)
	{
		DEBUG=confirm(debugString);
	}
}
function Map()
{
	this._length=0;
}
Map.prototype.put=function(p,v){Map_put(this,p,v);};
Map.prototype.remove=function(p){return Map_remove(this,p);};
Map.prototype.length=function() { return this._length;};
function Map_put(map,property,value)
{
	if (typeof(map[property])=="undefined")
	{
		map._length++;
	}
	map[property]=value;
}
function Map_remove(map,property)
{
	var retVal=null;
	if (typeof(map[property])!="undefined")
	{
		map._length--;
		retVal=map[property];
		delete map[property];
	}
	return retVal;
}
function HebrewCharacter(aName, aCode)
{
	this.name=aName;
	this.code=aCode;
}
function HebrewMap(aName,aMapping)
{
	this.name=aName;
	var tempMap=aMapping.split(";");
	this.mapping=new Array();
	var translation=null;
	for (var i=0; i<tempMap.length; i++)
	{
		translation=tempMap[i].split("=");
		if (translation.length==2)
		{
			this.mapping[parseInt(translation[0])]=parseInt(translation[1]);
		}
	}
//	showProps(this.mapping,"",true);
}
var hebrewCharacters=new Array();
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Alef",1488);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Beis",1489);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Gimel",1490);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Daled",1491);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Hey",1492);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Vov",1493);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Zayin",1494);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Ches",1495);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Tes",1496);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Yud",1497);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Final Kof",1498);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Kof",1499);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Lamed",1500);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Final Mem",1501);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Mem",1502);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Final Nun",1503);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Nun",1504);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Samech",1505);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Ayin",1506);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Final Pey",1507);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Pey",1508);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Final Tsadi",1509);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Tsadi",1510);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Quf",1511);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Resh",1512);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Shin",1513);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Tov",1514);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Sheva",1456);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Chataf Segol",1457);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Chataf Patach",1458);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Chataf Qomats",1459);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Chiriq",1460);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Tseirey",1461);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Segol",1462);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Patach",1463);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Qomats",1464);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Cholam",1465);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Qubuts",1467);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Dagesh",1468);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Meseg",1469);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Rafe",1471);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Shin Dot",1473);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Sin Dot",1474);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Geresh",1523);
hebrewCharacters[hebrewCharacters.length]=new HebrewCharacter("Gershayim",1524);
var hebrewMaps=new Array();
hebrewMaps[hebrewMaps.length]=new HebrewMap("[None]","");
hebrewMaps[hebrewMaps.length]=new HebrewMap("Blatt",
"33=1457;34=1458;35=1459;36=1460;37=1461;38=1463;39=43;40=1474;41=1473;42=1464;43=1468;"
 +"44=1514;45=1509;47=45;91=124;92=1501;93=122;94=1462;95=1465;96=58;97=1488;98=1489;"
 +"99=1495;100=1491;101=1506;102=1507;103=1490;104=1492;105=1503;106=1497;107=1499;"
 +"108=1500;109=1502;110=1504;111=1505;112=1508;113=1511;114=1512;115=1513;116=1514;"
 +"117=1496;118=1493;119=1498;120=1510;121=1509;122=1494;123=92;124=1467;125=90;126=1456;"
);
hebrewMaps[hebrewMaps.length]=new HebrewMap("Standard Hebrew Keyboard",
"33=1457;34=1458;35=1459;36=1460;37=1461;38=1463;39=43;40=1474;41=1473;42=1464;43=1468;"
+"44=1514;45=1509;47=45;91=124;93=122;94=1462;95=1465;96=58;97=1513;98=1504;99=1489;"
+"100=1490;101=1511;102=1499;103=1506;104=1497;105=1503;106=1495;107=1500;108=1498;"
+"109=1510;110=1502;111=1501;112=1508;113=46;114=1512;115=1491;116=1488;117=1493;"
+"118=1492;119=1474;120=1505;121=1496;122=1494;123=92;124=1467;125=90;126=1456;"
/* "39=44;44=1514;45=1509;47=46;91=125;93=123;96=59;97=1513;98=1504;99=1489;100=1490;"
 +"101=1511;102=1499;103=1506;104=1497;105=1503;106=1495;107=1500;108=1498;109=1510;"
 +"110=1502;111=1501;112=1508;113=47;114=1512;115=1491;116=1488;117=1493;118=1492;"
 +"119=1523;120=1505;121=1496;122=1494;123=93;125=91;"*/
);
