var HorizontalOffset, VirtualOffset, Tool_Locationbar_Height = 98, scrollbarWidth = 12;
var statusbarHeight = 23, AdditionalHeight = 22;

HorizontalOffset = scrollbarWidth;

function gotoAnotherPage(page)
{
	window.location.href= page;
}


function cookieVal(cookieName) {
			thisCookie = document.cookie.split("; ")
	  	    for (i=0; i<thisCookie.length; i++) {
	  	        if (cookieName == thisCookie[i].split("=")[0]) {
	  	        	return thisCookie[i].split("=")[1]
	  	        }
	   	    }
			return 0
}




function getCookie(name) {
		var cname= name + "=";
		var dc = document.cookie;
		if (dc.length>0) {
			begin = dc.indexOf(cname);
			if (begin !=1) {
				begin += cname.length;
				end = dc.indexOf (";" , begin);
				if (end == -1) end = dc.length;
					return unescape(dc.substring(begin, end));				
			}
		}
	  	return null;
}




<!--  The open bew pop-up window for displaying the result
function openResultWindow() { //v2.0
  //var width = 640, height = 480;
  var winFeatures = 'scrollbars=yes,resizable=yes,width=640,height=480';
  var winName="Result";
  var URL="result.htm";
  //can't use the following style to decalre the winFeatures, coz it doesn't work in Netscape
  //var winFeatures = '\''+ 'scrollbars=yes, width =' + width + ', height =' + height + '\'';
   var LeftUpperCornerX = screen.availWidth - 640- HorizontalOffset;
   var LeftUpperCornerY = screen.availHeight - 480 - statusbarHeight;
   var win = window.open(URL,winName,winFeatures)
   win.moveTo(LeftUpperCornerX, LeftUpperCornerY);
   // close the pop-up window and then close again, then the pop-up window
   // will always on top
   // always work in Netsacape
   win.close();
   win = window.open(URL,winName,winFeatures);
   win.moveTo(LeftUpperCornerX, LeftUpperCornerY);
 }
//--> 


<!--  The open bew pop-up window for displaying the suggestion
function openSuggestionWindow() { //v2.0
  //var width = 640, height = 480;
  var winFeatures = 'scrollbars=yes,resizable=yes,width=320,height=150';
  var winName="Result";
  var URL="result.htm";
  //can't use the following style to decalre the winFeatures, coz it doesn't work in Netscape
  //var winFeatures = '\''+ 'scrollbars=yes, width =' + width + ', height =' + height + '\'';
   var LeftUpperCornerX = screen.availWidth - 320- HorizontalOffset;
   var LeftUpperCornerY = screen.availHeight - 150 - statusbarHeight;
   var win = window.open(URL,winName,winFeatures)
   win.moveTo(LeftUpperCornerX, LeftUpperCornerY);
   // close the pop-up window and then close again, then the pop-up window
   // will always on top
   // always work in Netsacape
   win.close();
   win = window.open(URL,winName,winFeatures);
   win.moveTo(LeftUpperCornerX, LeftUpperCornerY);
 }
//--> 

function checkrequired (which) {
		var pass=true;
		
			for (i=0; i<which.length; i++) {
				var tempobj = which.elements[i];
				
					if (((tempobj.type == "text" || tempobj.type == "textarea" || tempobj.type == "password") &&
						tempobj.value == '') || (tempobj.type.toString().charAt(0) == "s" &&
						tempobj.selectedIndex==0)) {
						pass = false;
						break;
						}
	
			}
		

	if (!pass) {
		shortFieldName = tempobj.name;
		alert ("Please make sure the " + shortFieldName + " was properly completed.");
		return false;
                }
	else 
		return true;
}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) history.go(0);
}
MM_reloadPage(true);


/* Browser sensing */

/* Set up variables to record the browser type */

var isNetscape4 = 0;     /* variable set for Netscape 4*/
var isIE4 = 0;           /* variable set for Internet Explorer 4 */
var isNew = 0;           /* variable set for higher version */
var documentObj, styleObj;    /* document object & the style object */


/* Determines the browser name and browser version */

var browser = ((navigator.appName) + (parseInt(navigator.appVersion)));



/* reassign variable depending on the browser */

     if (parseInt(navigator.appVersion >= 5)) 
        {isNew = 1}
 
     else if (browser == "Netscape4") 
	{isNetscape4 = 1;}
    
     else if (browser == "Microsoft Internet Explorer4") 
	{isIE4 = 1;}

				
if (isNetscape4||isIE4||isNew) {
	documentObj = (isNetscape4) ? 'document' : 'document.all';
	styleObj = (isNetscape4) ? '' : '.style';
	}
	


