
		var newWin;

		                function openWin(PicName) {
		                        if (document.newWin ) {
		                        if ( navigator.appName != "Netscape" ) {
		                        document.newWin.close();
		                        }
		                        document.newWin=open(PicName,'remote','width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		                        document.newWin.focus();
		                        }else{
		                        document.newWin=open(PicName,'remote','width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		                        }
                }

   var IndWindow;
   var EraseURL;

   function openSepWindow(FileName, Text, Stay, width, height){
	if (IndWindow && (navigator.appName != "Netscape") && (Stay == 0)) 
		IndWindow.close();
        if (!width) width = 800;
        if (!height) height = 600;
	if (FileName)
		IndWindow=open(FileName,"","toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height);
	else 
		IndWindow=open("","","toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height);
	if (Text)
		IndWindow.document.write(Text);
	IndWindow.focus();
   }

   function DisplayDoc(FileName, Text, url){
	if (Text)
		parent.mainFrame.document.write(Text);
	else 	
	   if (FileName)
		parent.mainFrame.window.location.href(FileName);
	if (url) 
		CallEraseReports(url);
   }

   function CallEraseReports(url){
        EraseURL = url;
	setTimeout("EraseReports()", 2000);
   }
   function EraseReports(){
	if (EraseURL) {
		parent.hiddenFrame.window.location.href(EraseURL);
//		parent.mainFrame.window.location.href(EraseURL);
		EraseURL = null;
	}
   }

   function isNotEmpty(elem) {
	var str = elem.value;
        var re = /.+/;
	if(!str.match(re)) {
           alert("Please fill in the required field.");
//           setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
           return false;
	} else {
           return true;
	}
   }
   function isNumber(elem) {
	var str = elem.value;
//	var re = /^[-]?\d*\.?\d*$/;
	var re = /^[-]?\d*\,?\d*\,?\d*\,?\d*\.?\d*$/;
	str = str.toString();
	if (!str.match(re)) {
           alert("Enter only numbers into the field.");
//           setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
           return false;
	}
	return true;
   }
   function formatCommas(numString) {
	var re = /(-?\d+)(\d{3})/;
	while (re.test(numString)) {
	   numString = numString.replace(re, "$1,$2");
	}
	return numString;
   }
   function formatNumber(number, decplaces) {
	var str;
	var decpoint;
	str = number.toFixed(decplaces);	
	decpoint = str.length - decplaces;
	return formatCommas(str.substring(0, decpoint)) + 
			    str.substring(decpoint, str.length);
   }

