
//--------------------------------------------------------------------------------------------
//POPUP
//--------------------------------------------------------------------------------------------

<!-- Begin
function popUp(URL,target,parent) {
day = new Date();
id = day.getTime();
//parent.location = "BbSportSelection.asp?id=MLB%20Baseball";
//window.
//document.parent.location = "login.asp";
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=397,height=170,left = 465,top = 337');");
}
// End -->

//--------------------------------------------------------------------------------------------
//JOIN
//--------------------------------------------------------------------------------------------

function validate(){

if (document.SignupForm.nameFirstEntry.value == ""){
		alert("You must Provide the Firstname!");
		document.SignupForm.nameFirstEntry.focus();
		return false;
}
if (document.SignupForm.nameLastEntry.value == ""){
		alert("You must Provide the Lastname!");
		document.SignupForm.nameLastEntry.focus();
		return false;
}
if (document.SignupForm.emailEntry.value == ""){
		alert("You must Provide the Email!");
		document.SignupForm.emailEntry.focus();
		return false;
}
if (document.SignupForm.homePhoneEntry.value == ""){
		alert("You must Provide the Phone Number!");
		document.SignupForm.homePhoneEntry.focus();
		return false;
}

if (document.SignupForm.address1Entry.value == ""){
		alert("You must Provide the Address!");
		document.SignupForm.address1Entry.focus();
		return false;
}
//if (document.SignupForm.address2Entry.value == ""){
//		alert("You must Provide the Address!");
//		document.SignupForm.address2Entry.focus();
//		return false;
//}
if (document.SignupForm.cityEntry.value == ""){
		alert("You must Provide the City!");
		document.SignupForm.cityEntry.focus();
		return false;
}
if (document.SignupForm.stateEntry.value == ""){
		alert("You must Select the State!");
		document.SignupForm.stateEntry.focus();
		return false;
}
if (document.SignupForm.zipEntry.value == ""){
		alert("You must Provide the Zip!");
		document.SignupForm.zipEntry.focus();
		return false;
}
if(document.SignupForm.passwordEntry.value  == "") {
		alert("You must Provide the Password!");
		document.SignupForm.passwordEntry.focus();
		return false;
}

if(document.SignupForm.passwordEntry.length < 4) {
		alert("Invalid password entered!");
		document.SignupForm.passwordEntry.focus();
		return false;
}

if(document.SignupForm.confirmPasswordEntry.value != document.SignupForm.passwordEntry.value) {
		alert("The confirmation did not match the password entered!");
		document.SignupForm.confirmPasswordEntry.focus();
		return false;
}


if(document.SignupForm.SecurityEntry.value  == "") {
		alert("You must Provide the Security ?");
		document.SignupForm.SecurityEntry.focus();
		return false;
}

if(document.SignupForm.AnswerEntry.value  == "") {
		alert("You must Provide the Security Answer");
		document.SignupForm.AnswerEntry.focus();
		return false;
}

if (document.SignupForm.age.checked == false){
		alert("You must check the Age!");
		document.SignupForm.age.focus();
		return false;
}

if (document.SignupForm.terms.checked == false){
		alert("You must accept the terms and conditions!");
		document.SignupForm.age.focus();
		return false;
}

if (document.SignupForm.hear.value == "Other"){
		if(document.SignupForm.hear2.value  == "") {
			alert("Please specify Where do you hear about us");
			document.SignupForm.hear2.focus();
			return false;
		}
}

document.SignupForm.submit();

return true;

}


function getCookie(cookieName)
{
   var cookieFoundAt;
   var cookieValue;

   // find start position in cookie string
   cookieFoundAt = document.cookie.indexOf(cookieName + "=");

   if (cookieFoundAt < 0)
      {
         cookieValue = "";
      }
   else
      {
         // move to actual start of cookies data
         cookieFoundAt = document.cookie.indexOf("=",cookieFoundAt);
         cookieFoundAt++;

         // find end position of cookies data
         cookieEnd = document.cookie.indexOf(";", cookieFoundAt);
         if (cookieEnd == -1)
            {
             cookieEnd = document.cookie.length;
            }
         cookieValue =document.cookie.substring(cookieFoundAt,cookieEnd);
      }
   return cookieValue;
}

            
function prefill()
	{
		document.SignupForm.referredByEntry.value = getCookie('PromoID');
	}

function ajaxLoader(url,id)
	{
	  var valuest = "";      
	  if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	  }


	  if (x) {
		x.onreadystatechange = function() {
		  if (x.readyState == 4 && x.status == 200) {
			el = document.getElementById(id);
			//alert(id);
			//alert(valuest + " " +id + " " + url + " \n " + x.responseText);
			var retval = x.responseText; 
			//alert(retval);
			if (retval != ""){
			    document.SignupForm.emailEntry.select();
			}
			
			el.innerHTML = retval;
		  }
		}
		
		    var email = document.getElementById("emailEntry");
		    //alert(email);
		    email = email.value;
		    var finurl = url+"?email="+email;
		    //alert(finurl);
		    
		    
		//var txtDate = document.getElementById("txtDate");
		//var txtDate2 = document.getElementById("txtDate2");
		//txtDate = txtDate.value;
		//txtDate2 = txtDate2.value;
		x.open("GET", finurl, true);
		x.send(null);
	  }
	   
	}


//--------------------------------------------------------------------------------------------
//LOGIN
//--------------------------------------------------------------------------------------------

function Races(){
	if (document.Loginform.customerID.value == ""){
		alert("Please enter your LoginID");
		document.Loginform.customerID.focus();
		return false;
	}
	
	if (document.Loginform.password.value == ""){
		alert("Please enter your password");
		document.Loginform.password.focus();
		return false;
	}	
	document.Loginform.races.value = 1;
	document.Loginform.submit();
	return true;
	
	}// End Races
	
//--------------------------------------------------------------------------------------------	
function Races2(){
	if (document.Loginform2.customerID.value == ""){
		alert("Please enter your LoginID");
		document.Loginform2.customerID.focus();
		return false;
	}
	
	if (document.Loginform2.password.value == ""){
		alert("Please enter your password");
		document.Loginform2.password.focus();
		return false;
	}	
	document.Loginform2.races.value = 1;
	document.Loginform2.submit();
	return true;
	
	}// End Races
	
	
	

	
//--------------------------------------------------------------------------------------------	
	
function GOtoSportsBook(){
	if (document.Loginform.customerID.value == ""){
		alert("Please enter your LoginID");
		document.Loginform.customerID.focus();
		return false;
	}
	
	if (document.Loginform.password.value == ""){
		alert("Please enter your password");
		document.Loginform.password.focus();
		return false;
	}	
	document.Loginform.submit();
	return true;
	
	}// End Races	
	
//--------------------------------------------------------------------------------------------	
	
function GOtoSportsBook2(){
	if (document.Loginform2.customerID.value == ""){
		alert("Please enter your LoginID");
		document.Loginform2.customerID.focus();
		return false;
	}
	
	if (document.Loginform2.password.value == ""){
		alert("Please enter your password");
		document.Loginform2.password.focus();
		return false;
	}	
	document.Loginform2.submit();
	return true;
	
	}// End Races		
	
//--------------------------------------------------------------------------------------------	
function GOtoCasino(){
	
 
   if (document.Loginform2.customerID.value == ""){
  
	 alert("Please enter your LoginID");
	 document.Loginform2.customerID.focus();
	 return false;
	 
	}   
	
  
  if (document.Loginform2.password.value == ""){
  
	 alert("Please enter your password");
	 document.Loginform2.password.focus();
	 return false;
	   
	}
 
 userID = document.Loginform2.customerID.value
 password = document.Loginform2.password.value
 window.open('http://casino.wagerweb.com/casino/java/login?officeID=316&userID='+ userID + "&password=" + password,'Casino','status=0,height=600,width=800');
 
 
 }// End function	
 
 //--------------------------------------------------------------------------------------------
 function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}

 function Casino(){
	 

if (document.casino.customerID.value == ""){
		alert("Please enter your LoginID");
		document.casino.customerID.focus();
		return false;
	}
	if (document.casino.password.value == ""){
		alert("Please enter your password");
		document.casino.password.focus();
		return false;
	}
 
 userID = trim(document.casino.customerID.value);
 password = trim(document.casino.password.value);
 document.casino.customerID.value = "";
 document.casino.password.value = "";
 window.open('http://casino.wagerweb.com/casino/java/login?officeID=316&userID='+ userID + "&password=" + password,'Casino','status=0,height=600,width=800,resizable=yes');
 return false;
 }// End Casino
 
 
  function Hearts(){
	 
	if (document.heartsform.customerID.value == ""){
		alert("Please enter your LoginID");
		document.heartsform.customerID.focus();
		return false;
	}
	if (document.heartsform.password.value == ""){
		alert("Please enter your password");
		document.heartsform.password.focus();
		return false;
	}
 
 userID = trim(document.heartsform.customerID.value);
 password = trim(document.heartsform.password.value);
 document.heartsform.customerID.value = "";
 document.heartsform.password.value = "";
 window.open('http://casino.wagerweb.com/hearts/login/?officeID=316&userID='+ userID + "&password=" + password,'Casino','status=0,height=600,width=800,resizable=yes');
 return false;
  }
  
  
    function HeartsLogin(){
	 
	 //alert("test");
	if (document.Loginform2.customerID.value == ""){
		alert("Please enter your LoginID");
		document.Loginform2.customerID.focus();
		return false;
	}
	if (document.Loginform2.password.value == ""){
		alert("Please enter your password");
		document.Loginform2.password.focus();
		return false;
	}
 
 userID = trim(document.Loginform2.customerID.value);
 password = trim(document.Loginform2.password.value);
 document.Loginform2.customerID.value = "";
 document.Loginform2.password.value = "";
 window.open('http://casino.wagerweb.com/hearts/login/?officeID=316&userID='+ userID + "&password=" + password,'Casino','status=0,height=600,width=800,resizable=yes');
 return false;
  }
 
 
 
 //--------------------------------------------------------------------------------------------
 function Checklimit(){
	 
	 if (document.formlimit.limit.value == ""){
		alert("Please enter the higher limit information");
		document.formlimit.limit.focus();
		return false;
	}
	 }
 //--------------------------------------------------------------------------------------------
 //CASINO MENU


 
 
 
 //--------------------------------------------------------------------------------------------