/*
change image on mousehover
*/





function switchit(obj,img){
	if (document.images){
	obj.src=img
	}
}
function openWin(aURL){
var k = window.open(aURL,'PLAYWIN','toolbar=no,width=600,height=350,scrollbars=yes,left=150,top=120');
	k.focus();
}
/*
Register Form page1 validation Script starts
*/
	function resetf(){
		alert(document.forms[0].name)
		document.forms[0].reset();
	}
	function checkForm( ) {
		if ( !isNotEmpty( document.frmRegister.name,"Please enter your name." ) )
			return false;
		if ( !isNotEmpty( document.frmRegister.LastName,"Please enter your last name." ) )
			return false;
		if ( !isValidEmail( document.frmRegister.email , "Please enter your valid Email ID." ) )
			return false;
		if (document.frmRegister.email.value != document.frmRegister.conemail.value){
			alert("Please confirm your Email ID.");
			return false;
		}
		if (!isNotEmpty(document.frmRegister.Reg_proof_Id, "Please enter verification proof.")) {
			return false;
		}		
		if ( !isNotEmpty( document.frmRegister.address , "Please enter your address." ) )
			return false;
		if (document.frmRegister.state.value == "0") {
			alert("Please select state.")
			document.frmRegister.state.focus()
			return false;
		}
		if ( !isNotEmpty( document.frmRegister.postzip,"Please choose your postal / zip code." ) ){
			return false;
		}
		CheckString = /[a-z]|[A-Z]/
		var matchArray = document.frmRegister.postzip.value.match(CheckString); 
		var matchArray1 = document.frmRegister.stdcode.value.match(CheckString); 
		var matchArray2 = document.frmRegister.telephone.value.match(CheckString);
		if (matchArray != null ) {
			alert("Only numbers are allow in POSTAL/ZIP CODE field.")
			document.frmRegister.postzip.focus();
		return false;
		}
		if (matchArray1 != null ) {
			alert("Only numbers are allow in STD CODE field.")
			document.frmRegister.stdcode.focus();
		return false;
		}
		if (matchArray2 != null ) {
			alert("Only numbers are allow in Telephone field.")
			document.frmRegister.telephone.focus();
		return false;
		}
		return true;
	}
//Register Form page1 validation Script ends
//Register Form page2 validation Script starts
function rreset(){
	document.forms[0].reset();
	}
	function checkForm( ) {
		if ( !isNotEmpty( document.frmRegister.myplaywinID,"Please choose your playwinID." ) )
			return false;
		if ( !isNotEmpty( document.frmRegister.password,"Please choose your password." ) )
			return false;
		if (document.frmRegister.password.value != document.frmRegister.repassword.value){
			alert("Your password does not match");
			return false;
		}
		if (document.frmRegister.dd.value == "0") {
			alert("Please select date.")
		return false;
		}
		if (document.frmRegister.mm.value == "0") {
			alert("Please select Month.")
		return false;
		}
		if (document.frmRegister.yy.value == "0") {
			alert("Please select Year.")
		return false;
		}
		if (!document.frmRegister.terms.checked){
			alert("You must accept Terms and Conditoins.")	
			return false;
		}
	CheckString = /[a-z]|[A-Z]/
		var matchArray = frmRegister.mobile.value.match(CheckString);
		if (matchArray != null ) {
			alert("Only numbers are allowed in mobile field.")
			frmRegister.mobile.focus();
		return false;
		}		
		return true;
	}
//Register Form page2 validation Script ends
//apply retailership form validation Script starts
function checkRForm( ) {
	if ( !isNotEmpty( document.f1.name1,"Please enter your Name." ) )
		return false;
	if ( !isValidEmail( document.f1.email , "Please enter your valid email address." ) )
		return false;
	if ( !isNotEmpty( document.f1.comments,"Please enter your comments." ) )
		return false;
	if (document.f1.states.selectedIndex == 0){
		alert("Please Select States.")
		return false;
	}
return true;
}
//apply retailership form validation Script ends




/* Written By Sachin Korgaonkar */
//Print Function
function CallPrint(strid)
{
 var prtContent = document.getElementById(strid);  var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
 WinPrint.document.write(prtContent.innerHTML);
 WinPrint.document.close();
 WinPrint.focus();
 WinPrint.print();
 WinPrint.close();
 prtContent.innerHTML=strOldOne;
}

//Save Function
function SaveThis(){
     document.execCommand("saveAs",true,"result.htm");
}

//Print Function
function CallPrint(strid)
{
 var prtContent = document.getElementById(strid);  
 var WinPrint = window.open('','','left=0,top=0,width=700,height=700,toolbar=0,scrollbars=1,status=0');
 WinPrint.document.write(prtContent.innerHTML);
 WinPrint.document.close();
 WinPrint.focus();
 WinPrint.print();  
}


function winOpen(Section,pageid,frdate,todate)
{    
    var game="";
    var fdate=frdate;
    var tdate=todate;    
    if (Section == 1)
        game = 'Joker';
        
    else if (Section == 2)
        game = 'THURSDAY LOTTO';
        
    else if (Section == 3)
        game = 'Thunder ball';
    
    else if (Section == 4)
        game = 'SATURDAY LOTTO';
        
   else if (Section == 5)
        game = 'KENOPLUS';
   
   else if (Section == 6)
        game = 'Lucky 3';
        
   else if (Section == 7)
        game = 'FAST LOTTO';
        
   else if (Section == 8)
        game = 'Joker 5';
   
   else if (Section == 9)
        game = 'TRIPLE TICKET';
   else if (Section == 10)
        game = 'Easy Lotto';
        
   else if (Section == 11)
        game = '201';
        
   else if (Section == 12)
        game = '202';
        
   else if (Section == 14)
        game = '211';
    else if (Section == 13)
        game = 'BADA JOKER'
             
   var WinPrint =  window.open('printableversion.aspx?GameName=' + game +'&Page='+pageid+'&fdate='+fdate+'&tdate='+tdate,'Printable','left=0,top=0,width=850,height=700,toolbar=0,scrollbars=1,status=0');
	
    WinPrint.print();   
}
