// JavaScript Document

function RadioChecked (val)
{	
	document.LOGIN_EHORSE.loginto.value = val;	
}

function isJavaEnabled()
{
	var rc = false;
	var agent = navigator.appName;
	ver= parseInt(navigator.appVersion);
	if ((agent == "Microsoft Internet Explorer") ||  (agent == "Netscape")) {
		if ((ver >= 4) && navigator.javaEnabled())
			rc = true;
	}

	return rc;
}


function popUp(url) 
{
window.open(url,"win",'scrollbars=0,resizable=1,width=400,height=370');
}

function popBre()
{
	popUp("/XpopBre.html");
}

function popXDown()
{
	window.open("eHorseX.html","win",'scrollbars=0,resizable=1,width=600,height=635');
}


function verify()
{
	if (!isJavaEnabled())
	{
		alert("Your browser isn't Java enabled...");
		return false;
	}
	
	document.LOGIN_EHORSE.action="";
	if ( document.LOGIN_EHORSE.USER_ID.value == "")
	{
		alert("Please enter your Account# before proceeding !");
		document.LOGIN_EHORSE.USER_ID.focus();
		return false;
	}

	if ( document.LOGIN_EHORSE.PASSWORD.value == "")
	{
		alert("Please enter your password before proceeding !");
		document.LOGIN_EHORSE.PASSWORD.focus();
		return false;
	}
	
	document.LOGIN_EHORSE.action="eHorseLoginX.asp";	

	if ( document.LOGIN_EHORSE.loginto.value == "x" )		
	{
		document.LOGIN_EHORSE.action="";
		popXDown();
		return false;
	}
		//pop();
	
	
/*	if ((document.LOGIN_EHORSE.loginto.value == "e") &&
		(document.LOGIN_EHORSE.USER_ID.value.substring(0,2).toUpperCase()=='BC'))
	{
			popBre();
	}*/

	if ( document.LOGIN_EHORSE.loginto.value == "p" )
	{
		document.LOGIN_EHORSE.action="http://www.parlaycardz.com/EcardLogin.asp";
	}
	if ( document.LOGIN_EHORSE.loginto.value == "s" )
	{
		document.LOGIN_EHORSE.account.value = document.LOGIN_EHORSE.USER_ID.value;
		document.LOGIN_EHORSE.radiobutton.value = "sportsbook";
		document.LOGIN_EHORSE.action="http://www.betlaspalmas.com/common/authenticate.asp";
	}
	
	if ( document.LOGIN_EHORSE.loginto.value == "c" )
	{
		document.LOGIN_EHORSE.account.value = document.LOGIN_EHORSE.USER_ID.value;
		document.LOGIN_EHORSE.radiobutton.value = "casino";
		document.LOGIN_EHORSE.action="http://www.betlaspalmas.com/common/authenticate.asp";
	}
	return true
}



function verifySendPassword()
{
	if ( document.Join.UserID.value == "" )
	{
		alert ( "Please enter your Account#." );
		document.Join.UserID.focus();
		return;
	}

	if ( document.Join.EmailID.value == "" )
	{
		alert ( "Please enter your E-Mail ID." );
		document.Join.EmailID.focus();
		return;
	}

	dot = 0, at = 0;
	email = document.Join.EmailID.value;
	for(i=0; i < email.length ; i++)
	{
		var ch = email.charAt(i);
		if(ch == '.')
			dot = 1;
		else if(ch == '@')
			at = 1;
	}
	if ( dot == 0 || at == 0 )
	{
		alert ( "Please enter valid email address." );
		document.Join.EmailID.focus();
		return;
	}
	document.Join.submit();
}



function popUpTMW()
{
window.open("popTomorrowsTracks.html","win",'scrollbars=0,resizable=0,width=593,height=149');	
}