<!--         BEGIN library.js   2003.08.29  JB

//////////////////////////////////////////////////
//			FUNCTIONS
//
//  commasRemove
//  dollarsToDecimal
//  formFocusShift
//  isValidPattern
//  maxWindow             - maximizes the window size to the client screen
//	optionHighlight
//  pageOpen
//	rowDisplayAll
//	rowHideIfNotMatch
//	sampleDataConstruct
//  sort                    - An Array Sorter
//	tableRowsColorAlternate
//	tableRowsSort
//	textInsert
//  toCurrencyString
//	windowPop
//	windowPopLoChrome
//	windowPopNoChrome
//
//////////////////////////////////////////////////




function commasRemove(strNumber)
	{
	//////////////////////////////////////////////////////////////////
	//
	//	Purpose:
	//    Remove the commas from a numeric string
	//
	//	Inputs:
	//    strNumber - the numeric string to be converted
	//
	//	Output:
	//    returns the number with all commas removed, e.g. 6,000,000
	//    is returned as 6000000.
	//
	//	Usage:
	//		var result = commasRemove("26,000");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	//////////////////////////////////////////////////////////////////
	var index = 0;
	var lastComma;
	var result = "";
	lastComma = strNumber.indexOf(",");
	while ( lastComma != -1 )
		{
		result = result + strNumber.substring( index, lastComma );
		index = lastComma+1;
		lastComma = strNumber.indexOf(",", index);
		}
	//endWhile
	result = result + strNumber.substr( index );
	return result;
	}
//endFunction




function dollarsToDecimal(strCurrency)
	{
	//////////////////////////////////////////////////////////////////
	//
	//	Purpose:
	//    Convert a currency string amount to a
	//    plain decimal value without commas or currency symbol.
	//
	//	Inputs:
	//    strCurrency - the currency string  to be converted
	//
	//	Output:
	//    returns the money amount passed in as a decimal number without
	//    commas or currency symbol ($45,000 becomes 45000).
	//
	//	Usage:
	//		var result = dollarsToDecimal("$25,000.00");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	//////////////////////////////////////////////////////////////////

	var result;
	var start=strCurrency.indexOf("$");

	if(start>-1)
		result = strCurrency.substr(start+1);
	else
		result = strCurrency;
	//endIf-else
	return commasRemove(result);
	}
//endFunction




function formFocusShift(objFormNode, strElemName, evt)
	{
	//////////////////////////////////////////////////////
	//
	//  Purpose:
	//           Shift the focus of the cursor to a new input element.
	//           Used to over-ride normal cursor positioning.
	//
	//  Inputs:
	//           objFormNode    	- a reference to the form object
	//           strElemName			-	the name of the next element to focus upon
	//
	//  Outputs:
	//          returns true if the correct keyboard event was detected
	//          otherwise returns false.
	//
	//
	//  Usage:
	//
	//		<input type="text" name="txtAccount" id="txtAccount" onKeyPress="return formFocusShift(this.form, 'selTranCode', event);" />
	//
	//  Author:   J Burt
	//  Date:     2003.08.01
	//
	//////////////////////////////////////////////////////

	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
	// capture "enter" or "tab"
	if (charCode == 13 || charCode == 3)
		{
		objFormNode.elements[strElemName].focus();
		return false;
		}
	//endIf
	return true;
	}
//endFunction




function isValidPattern( strValue,objValidPattern )
	{
	 //////////////////////////////////////////////////////
	 //
	 //  Purpose:
	 //           Check if the value matches the pattern,
	 //           or the array of valid patterns.
	 //
	 //  Inputs:
	 //           strValue     		- the value to be checked, typically an object property
	 //           objValidPattern - the regular expression pattern, typically an object property,
	 //                          		or it can be an array of patterns
	 //
	 //  Outputs:
	 //          returns true if the string is formatted correctly,
	 //          otherwise false.
	 //
	 //
	 //  Usage:  var result = isValidPattern("$25.01",patterns.currency);
	 //  Usage:  var result = isValidPattern("$25.01",/^\d{0,10}\.\d{2}$/);
	 //
	 //  Author:   J Burt
	 //  Date:     2003.08.01
	 //
	 //////////////////////////////////////////////////////

	 var supported = false;
	 var result    = false;

	 if (window.RegExp)
		 {
			tempStr = "a";
			tempReg = new RegExp(tempStr);
			if (tempReg.test(tempStr))
				supported = true;
			//endIf
		 }
	 //endIf

	 if (!supported)
		 {
			//alert('regular expression testing is not supported by this browser');
			return (true);
		 }
	 //endIf

	 if(objValidPattern[0])
		 {
			//objValidPattern is an array of patterns, test against entire array

			for (var i=0;i<objValidPattern.length;i++)
				{
				 var tempReg = new RegExp(objValidPattern[i]);
				 if(tempReg.test(strValue)==true)
					 result=true;
				}
			//endFor
		 }
	 else
		 {
			//alert('single');
			// objValidPattern is a single pattern, test against it
			var tempReg = new RegExp(objValidPattern);
			if(tempReg.test(strValue)==true)
				 result=true;
		 }
	 //endIf-else

	 return result;
	}
//endFunction




function optionHighlight(objSelectList, strNodename, strHiColor, strLoColor)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Highlight Text in a Node if Select-Box Selection = 0
	//		Used to remind user to make a selection.
	//
	//	Usage:
	//		var result = optionHighlight(this,"msgText","red","black");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////
	var nodeName=document.getElementById(strNodename);
	if(objSelectList.selectedIndex==0)
		nodeName.style.color=strHiColor;
	else
		nodeName.style.color=strLoColor;
	//endIf-Else
	return true;
	}
//endFunction




function rowDisplayAll(objTableNode)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Show all rows of a table
	//
	//	Usage:
	//		rowDisplayAll(document.getElementById("myTable"));
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	// get a reference to the tbody node
	var objTbody = objTableNode.getElementsByTagName('TBODY')[0];

	// get a reference to the table rows of interest
	var objRows	= objTbody.getElementsByTagName('TR');

	// set display for all tr nodes in tbody node
	for(var i=0;i<objRows.length;i++)
		{
		objRows[i].style.display="";
		}
	//endFor
	}
//endFunction





function rowHideIfNotMatch(objTableNode,strMatch,intColNum,strAllMatch)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Hide certain rows of html table
	//		based upon values in a certain column
	//		usually called as "onchange" of a select box
	//
	//	Usage:
	//		<select onChange='rowHideIfNotMatch(myTable,this.value,1,"all");' >
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////
	var objTbody	= null; // tbody node

	// get a reference to the tbody node
	objTbody = objTableNode.getElementsByTagName('TBODY')[0];

	// get a reference to the table rows of interest
	var objRows	= objTbody.getElementsByTagName("TR");

	// set visibility for all tr nodes in tbody node
	for(var i=0;i<objRows.length;i++)
		{
		if(objRows[i].getElementsByTagName('TD')[intColNum].innerText!=strMatch)
			{
			if (strMatch!=strAllMatch)
				{
				objRows[i].style.display="none";
				}
			//endIf
			}
		//endIf
		}
	//endFor
	}
//endFunction




function sampleDataConstruct()
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Constructor method
	//		accepts any number of parameters
	//		and creates an array
	//		ie: sampleData[j].value[i]
	//
	//	Usage:
	//		var myArray = sampleDataConstruct("1","2","dog");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////
	var len = arguments.length;
	this.value = new Array();
	for(var i=0;i<len;i++)
		{
		this.value[i] = arguments[i];
		}
	//endFor
	}
//endFunction




function tableRowsColorAlternate(objTableNode, strColor1, strColor2)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		set table rows to a pleasing alternating background color
	//		which is easier to scan visually without errors
	//
	//	Usage:
	//		tableRowsColorAlternate(myTable,"#fff011", "#fff333");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	// get a reference to the tbody node
	var objTbody = objTableNode.getElementsByTagName('TBODY')[0];

	// get a reference to the table rows of interest
	var objRows = objTbody.getElementsByTagName('TR');

	// set visibility for all tr nodes in tbody node
	for(var i=0;i<objRows.length;i++)
		{
		if(i%2==0)
			{
			objRows[i].style.backgroundColor = strColor1;
			}
		else
			{
			objRows[i].style.backgroundColor = strColor2;
			}
		//endIf-elseIf
		}
	//endFor
	}
//endFunction




function tableRowsSort(objTableNode, objNodeSelected, strColorHi, strColorLo)
	{
	//////////////////////////////////////////////////////
	//  Function: tableRowsSort
	//
	//  Purpose:  sort an html table-body on the values of one column
	//
	//	Usage:
	//
	//		<table id="rsTable" >
	//			<thead>
	//				<tr id="sortRow" style="font-size:1.0em; background-color:#CCCCCC; color:#333399;">
	//					<td><span sorter="true" onclick="javascript:tableRowsSort(rsTable,this,'#FFFF00','#333399');tableRowsColorAlternate(rsTable,tableRowColor1, tableRowColor2);">Sort Column 1</span></td>
	//					<td><span sorter="true" onclick="javascript:tableRowsSort(rsTable,this,'#FFFF00','#333399');tableRowsColorAlternate(rsTable,tableRowColor1, tableRowColor2);">Sort Column 2</span></td>
	//				</tr>
	//			</thead>
	//			<tbody>
	//				<tr>
	//					<td>Table Data To Be Sorted Row 1 Col 1</td>
	//					<td>Table Data To Be Sorted Row 1 Col 2</td>
	//				</tr>
	//				<tr>
	//					<td>Table Data To Be Sorted Row 2 Col 1</td>
	//					<td>Table Data To Be Sorted Row 2 Col 2</td>
	//				</tr>
	//			</tbody>
	//		</table>
	//
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	//////////////////////////////////////////////////////

	if(!strColorHi)
		var strColorHi 	= "#6666FF"; // blue
	if(!strColorLo)
		var strColorLo	= "#000000"; // black

	var isSorted = false;

	// Test to see if column already sorted, and user wants to reverse order
	if(objNodeSelected.style.color.toUpperCase()==strColorHi.toUpperCase())
		{
		isSorted=true;
		}
	//endIf


	// get a reference to the table-body node
	var objTbody = objTableNode.getElementsByTagName('TBODY')[0];

	// get a reference to the table-head node
	var objThead = objTableNode.getElementsByTagName('THEAD')[0];

	// get a reference to the table rows of interest
	var objRows				= objTbody.getElementsByTagName('TR');

	var sortKeyArray	= new Array();
	var nodeArray			= new Array();

	var sortRow			= objNodeSelected.parentNode.parentNode;
	var sortOptions	= sortRow.childNodes;

	// get an integer number corresponding to the selected column
	for(var i=0;i<sortOptions.length;i++)
		{
		if(objNodeSelected.parentNode==sortOptions[i])
			{
			intSortCol=i;
			break;
			}
		//endIf
		}
	//endFor


	//////////////////////////////////////////////////////
	//	GENERAL TECHNIQUE:
	//
	//	create two arrays
	//
	//		array 1 = sortKeyArray	= indexCol.innerText
	//		array 2 = nodeArray 		= object:
	//																	prop1= indexCol.innerText
	//																	prop2= objNode reference (TR Node)
	//
	//	sort array 1
	//	create new tbody node
	//	iterate trough array1
	//	select array2[j] with indexCol.innerText == array1[i]
	//	append selected array2.objNode to new tbody node
	//	swap tbody nodes
	//
	//
	//////////////////////////////////////////////////////


	for (i=0; i < objRows.length; i++)
		{
		// Populate sortKeyArray with contents of the selected column
		/////////////////////////////////////////////////////////////
		var keyValue		= objRows[i].getElementsByTagName("TD")[intSortCol].innerText;

		sortKeyArray[i]	= dataConvert(keyValue);

		// Populate nodeArray with objects:
		//		nodeArray.strKey		= indexCol.innerText
		//		nodeArray.objNode		= reference to the TR node
		//		nodeArray.selected	= boolean
		/////////////////////////////////////////////////////////////
		nodeArray[i]					= new Object();
		nodeArray[i].strKey		= dataConvert(keyValue);
		nodeArray[i].selected	= false;
		nodeArray[i].objNode	= objRows[i];
		}
	//endFor


	// Sort the key field (sortKeyArray)
	sortKeyArray.sort();

	// Reset selected boolean
	for(j=0; j < nodeArray.length; j++)
		{
		nodeArray[j].selected=false;
		}
	//endFor


	// Create a new TBODY node
	newTableBody=document.createElement("TBODY");

	// Append TR nodes to TBODY node


	// Sort, or Reverse
	if (isSorted)
		{
		// reverse the existing order of rows
		var reversedArray=nodeArray.reverse();
		for(var i=0;i<reversedArray.length;i++)
			{
			var newKid=reversedArray[i].objNode.cloneNode(true);
			newTableBody.appendChild(newKid);
			}
		//endFor
		}
	else
		{
		// sort the rows

		// Iterate through the sorted key array
		for (i=0; i < sortKeyArray.length; i++)
			{
			// Iterate through the node array
			for(j=0; j < nodeArray.length; j++)
				{
				// If the items match, capture the position number
				// into a third array.
				if (sortKeyArray[i] == nodeArray[j].strKey)
					{
					// inelegant but compact kludge to allow for duplicate key values
					if(nodeArray[j].selected)
						{
						// no operation, element already in new result set;
						}
					else
						{
						var newKid=nodeArray[j].objNode.cloneNode(true);
						newTableBody.appendChild(newKid);
						nodeArray[j].selected=true;
						break;
						}
					//endIf-else
					}
				//endIf
				}
			//endFor
			}
		//endFor
		}
	//endIf-else



	// Swap the new TBODY element into the document
	var swapResult1 = objTbody.swapNode(newTableBody);

	// highlight selected column heading
	resetSortIndicator(objNodeSelected, objThead);

	// DONE!


	function dataConvert(cValue)
		{
		/////////////////////////////////////////////////
		// INNER METHOD
		//
		//	Purpose:
		//
		//		Convert numbers/dates/strings into a
		//		representation that will sort lexigraphically
		//		and yield the predicted results.  This allows
		//		us to use the speedy Array.Sort() method.
		//
		//	Inputs:
		//		cValue - a number|date|string
		//
		//	Outputs:
		//		result - a string representation of cValue
		//		         which will sort correctly
		//	Usage:
		//		var result = dataConvert(1);
		//		var result = dataConvert("123");
		//		var result = dataConvert("01/01/2003");
		//		var result = dataConvert(12345.00);
		//
		//  Author:	James Burt
		//  Date:		2003.08.01
		//
		/////////////////////////////////////////////////

		var result;
		var isNum = false;
		var isString = false;
		var isDate = new Date(cValue);

		var a=parseInt(cValue);
		var isNum  = !isNaN(a);

		if (isDate == "NaN")
			{
			if (!isNum)
				{
				// value is a string, convert to upper case
				// and sort.
				result = cValue.toUpperCase();
				isString = true;
				}
			else
				{
				// Value is a number. Prepend a digit indicating the
				// length of the string representation (ie: 8 becomes "18",
				// 21 becomes "221") for easier sorting.
				result = String.fromCharCode(48 + cValue.length) + cValue;
				}
			//endIf-else
			}
		else
			{
			// Value is a date, convert to a string representation
			// of date in pseudo-ansi format (ie: 2001 12 31)
			// for easier sorting.
			result = new String();
			result += isDate.getFullYear()	+ " ";

			// prepend "0" if necessary
			x=(isDate.getMonth()+" ");
			if(x.length<3)
				result +="0";
			result += isDate.getMonth()			+ " ";

			// prepend "0" if necessary
			x=(isDate.getDate()+" ");
			if(x.length<3)
				result +="0";
			result += isDate.getDate();			+ " ";
			result += isDate.getHours();		+ " ";
			result += isDate.getMinutes();	+ " ";
			result += isDate.getSeconds();
			}
		//endIf-Else

		return result;
		}
	//end(Inner)Function


	function resetSortIndicator(objNodeSelected, objThead)
		{
		/////////////////////////////////////////////////
		//  INNER METHOD
		//
		//	Purpose:
		//  	Highlight text in the heading of the
		//  	column selected for sorting
		//
		//  Author:	James Burt
		//  Date:		2003.08.01
		//
		/////////////////////////////////////////////////

		// get a reference to all span nodes in table-head node
		var objSpans = objThead.getElementsByTagName("span");

		// reset all column headings to default color
		// select spans with attribute "sorter" == "true",
		// a trick to avoid having to use recursive search
		/////////////////////////////////////////////////////
		for (var i=0;i<objSpans.length;i++)
			{
			if( (objSpans[i].getAttribute("sorter")) && (objSpans[i].getAttribute("sorter")=="true") )
				{
				objSpans[i].style.color=strColorLo;
				}
			//endIf
			}
		//endFor

		// set selected column heading to highlight
		objNodeSelected.style.color=strColorHi;
		}
	//end(Inner)Function
	}
//endFunction




function textInsert(strText, strNodename)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Place text in a node
	//
	//	Usage:
	//		var result = textInsert("new text",document.getElementById("myNode"));
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////
	var nodeName=document.getElementById(strNodename);
	nodeName.innerHTML=strText;
	return true;
	}
//endFunction




function toCurrencyString(input)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//
	//		accept either a number, or a string representation
	//		return a string representation of a two-position decimal number
	//
	//	Inputs:
	//		input - integer|floating-point|string
	//
	//	Outputs:
	//		result - a string representation of input in format "9999.99"
	//							corrected to remove punctuation, and correct trailing zeros
	//
	//	Usage:
	//		var dollarString = toCurrencyString(123);
	//		var dollarString = toCurrencyString("$123.00);
	//		var dollarString = toCurrencyString("$123");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	var output=input;
	if(isNaN(output))
		output=eval(output);
	if(isNaN(output))
		{
		//alert('failure');
		return input;
		}
	//endIf

	output=""+output;

	var index=output.indexOf('.');
	if (index==-1)
		{
		output=output+".";
		index=output.length;
		}
	//endIf

	var trailingZerosNeeded = 2-(output.length-index);

	// append trailing zeros if needed
	for(var i=0;i<trailingZerosNeeded;i++)
		output=output+"0";
	//endFor

	// truncate if needed
	output.length=index+3;
	return output;
	}
//endIf




function windowPop(strURL, strHeight, strWidth, strChrome)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//		Open a window with various options
	//
	//	Inputs:
	//		"strHeight" and "strWidth" are optional
	//		parameters indicating the height and width of the window.
	//		If they are not provided, the window is opened at 20 pixels
	//		less than maximum screen size.
	//
	//
	//	Usage:
	//		var result = windowPop("http://www.google.com","100","200","resizable=yes");
	//		var result = windowPop("http://www.google.com");
	//		var result = windowPop("http://www.google.com","100",,"resizable=yes");
	//		var result = windowPop("http://www.google.com",,"resizable=yes");
	//		var result = windowPop("http://www.google.com","100","200","no");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	//alert("requested URL="+strURL);

	var windowParms0=",top=10,left=10,resizable=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes"; // full
	var windowParms1=",top=10,left=10,resizable=no,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no"; // no
	var windowParms2=",top=10,left=10,resizable=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no"; // lo
	var windowParms;
	var fullScreen=false;

	// Determine Window Size
	if( (!strHeight) || (strHeight==null) || (strHeight==undefined) || (strHeight=="") )
	  fullScreen=true;
	else if( (!strWidth) || (strWidth==null) || (strWidth==undefined) || (strWidth=="") )
	  fullScreen=true;
	else if( isNaN(eval(strHeight)))
	  fullScreen=true;
	else if( isNaN(eval(strWidth)))
	  fullScreen=true;
	//endIf-elseIf

	if(fullScreen)
		{
		var strHeight= (window.screen.height) +"";
		var strWidth= (window.screen.width) +"";
		windowParms="width="+strWidth+",height="+strHeight
		}
	else
		{
		windowParms="width="+strWidth+",height="+strHeight
		}
	//endIfElse

	// Determine Window Chrome
	if( (!strChrome) || (strChrome==null) || (strChrome==undefined) || (strChrome=="")||(strChrome=="full") )
		windowParms=windowParms+windowParms0;
	else if(strChrome=="no")
		windowParms=windowParms+windowParms1;
	else if(strChrome=="lo")
		windowParms=windowParms+windowParms2;
	//endIf-elseIf

	newWindow = window.open(strURL,'',windowParms);
	return false;
	}
//endFunction




function windowPopLoChrome(strURL, strHeight, strWidth)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//  	Open a featureless window WITH scrollbars
	//
	//	Inputs:
	//		"strHeight" and "strWidth" are optional
	//		parameters indicating the height and width of the window.
	//		If they are not provided, the window is opened at 20 pixels
	//		less than maximum screen size.
	//
	//	Usage:
	//		var result = windowPopLoChrome("http://www.google.com","100","200");
	//		var result = windowPopLoChrome("http://www.google.com");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	return windowPop(strURL, strHeight, strWidth, "lo");
	}
//endFunction




function windowPopNoChrome(strURL, strHeight, strWidth)
	{
	/////////////////////////////////////////////////
	//
	//	Purpose:
	//  	Open a featureless window WITHOUT scrollbars
	//
	//	Inputs:
	//		"strHeight" and "strWidth" are optional
	//		parameters indicating the height and width of the window.
	//		If they are not provided, the window is opened at 20 pixels
	//		less than maximum screen size.
	//
	//	Usage:
	//		var result = windowPopLoChrome("http://www.google.com","100","200");
	//		var result = windowPopLoChrome("http://www.google.com");
	//
	//  Author:	James Burt
	//  Date:		2003.08.01
	//
	/////////////////////////////////////////////////

	return windowPop(strURL, strHeight, strWidth, "no");
	}
//endFunction




function sort(array)
	{
	/////////////////////////////////////////////////
	//
	//  Compare 2 numbers,
	//  returns a (-)# if num2 should come before num1
	//  returns a (0)# if num2 == num1
	//  returns a (+)# if num2 >num1
	//
	//  This function should only be used in the context
	//  of a call to the JavaScript Array.sort(comparator) function
	//  and serves as its comparator parameter.
	//
	//
	/////////////////////////////////////////////////
	array.sort(function (a,b) { return (a-b); } );
	}
//endFunction



    function maxWindow()
    {
        window.moveTo(0,0);
        if (document.all)
        {
          top.window.resizeTo(screen.availWidth,screen.availHeight);
        }//END IF

        else if (document.layers||document.getElementById)
        {
          if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
          {
            top.window.outerHeight = screen.availHeight;
            top.window.outerWidth = screen.availWidth;
          }//END INNER IF
        }//END OUTER IF - ELSE
   }//END FUNCTION


   function compareDate(date1, date2){
        if (date1 < date2) {
            return true;
        } else {
            return false;
        }
   }


    function pageOpen(url)
        {
            //alert(url);
            var newPage=window.open(url,'_self','scrollbars=yes');
            newPage.focus;
        }//endFunction



    function newPageOpen(url)
        {
            //alert("in newPageOpen()");
            var newPage=window.open(url,'_blank','scrollbars=no');
            newPage.focus();
        }//endFunction



// --------------   END library.js                 -->




