// --->  preload imgsrc
    default_img  = new Image(200,30);   
    default_img2 = new Image(100,30);
 
   default_img.src = "/banner/kt/bkk1.gif"; 
   default_img2.src = "/banner/kt/bkk2.gif";
// -----> start check expire date function  
 function expire(expdate,expmon,expyear){
       var today = new Date();    
       var thisday = today.getDate();
       var thismon = today.getMonth()+1;         
       var thisyear = today.getYear();
      if(expyear < thisyear){
               return 1;       
     }       
     else {    	 if(expyear == thisyear){ 
                          	 if(expmon < thismon){
                              		 return 1;  
                          	 }     
       	    	 else {    
                                     		 if(expmon == thismon){    
              		 		 if(expdate < thisday){    return 1;
		  		}
       		 		 else {       return 0;  	
			 	 }      
    	                		 }      
 	                		 else {          return 0;      
 	                  		} 	
          	     	 }          
                   } 
                   else{       return 0;         
                     }        
   }  
  } // end function
 
// start lotto function

function CheckForm(form){
	if (isAllDigits(form.cNum.value) == false){
		alert("ขออภัย ! ป้อนได้เฉพาะตัวเลขนะครับ !!");
		form.cNum.value = "";
		form.cNum.focus();
		return false;
	}
	if (form.cNum.value.length == 0){
		alert("กรุณาป้อนหมายเลขที่ต้องการตรวจ");
		form.cNum.focus();
		return false;
	}
}

function isDigit(c)
    {
    var test = "" + c;
    if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4" || test == "5" || test == "6" || test == "7" || test == "8" || test == "9")
        {
        return true;
        }
    return false;
    }

function isAllDigits(s)
    {
    var test = "" + s;
    for (var k = 0; k < test.length; k++)
        {
        var c = test.substring(k, k+1);
        if (isDigit(c) == false)
            {
            return false;
            }
        }
    return true;
    }
