/////////SET COOKIE/////////////
function setCookie() {
	
	document.cookie = "logged=yes"
	window.location = "index.htm"
}

/////////CHECK COOKIE/////////////
function checkCookie() {
 if (document.cookie.length > 0)
{

// Second we check to see if the cookie's name is stored in the
// "document.cookie" object for the page.
//
// Since more than one cookie can be set on a
// single page it is possible that our cookie
// is not present, even though the "document.cookie" object
// is not just an empty text.
// If our cookie name is not present the value -1 is stored
// in the variable called "begin".

begin = document.cookie.indexOf("logged"+"=");
if (begin != -1) // Note: != means "is not equal to"
{
;
// Our cookie was set.
// The value stored in the cookie is returned from the function.

begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
;
window.location = "fail.htm"


// Our cookie was not set.
// The value "null" is returned from the function.

}


//	
//	
//	var x = document.cookie
//	if (x == "logged=yes; path=/")
//		{alert ("has cookie")}
//		else {
//			//window.location = "fail.htm"
//			alert ("no cookie")
//			}

//}
///////////LOGOUT//////////////
function logout() {
	
	var d = new Date();
    document.cookie = "logged=yes;expires=" + d.toGMTString() + ";" + ";";
	
	window.location.href ="../index.htm"; 
	
	
}
///MENU SCRIPT////

function Menu(){ 
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*hvr/,nn='',c,cs='hvr',bv='menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}



///VENDOR VALIDATE////
function validate(){
//frmName is the name of the form
frmLength = document.reserves.length;

var numericExpression = /^[0-9" ".""]+$/;

for (i=0; i<frmLength;i++){	
	if ( (document.reserves[i].value.match(numericExpression)) || ((document.reserves[i].value)== "") )
		;
	else {alert ("Please check your reserves. Only dollar amounts are allowed");
		document.reserves[i].focus();
		
		return false;}
		
//		return false;
	}

window.location = "thankyou.htm";
return true

}

