function chk_during(dbegin,mbegin,ybegin,dlast,mlast,ylast)
	{
			var f  = document.all;
			str_dbegin 	= eval("f."+dbegin+".value");
			str_mbegin	= eval("f."+mbegin+".value");
			str_ybegin	= eval("f."+ybegin+".value");
			str_dlast		= eval("f."+dlast+".value");
			str_mlast		= eval("f."+mlast+".value");
			str_ylast		= eval("f."+ylast+".value");
			if (str_ylast < str_ybegin)
			{
				alert(" Please Check During Time check- In and check -out again ")
				eval("f."+ylast+".focus()");
				return false;
			}
			else if(str_ylast <= str_ybegin && str_mlast < str_mbegin)
			{
				alert(" Please Check During Time check- In and check -out again ")
				eval("f."+mlast+".focus()");
				return false;
			}
			else if(str_ylast <= str_ybegin && str_mlast <= str_mbegin &&  parseInt(str_dlast) < parseInt(str_dbegin) )
			{
				alert(" Please Check During Time check- In and check -out again")
				eval("f."+dlast+".focus()");
				return false;
			}
			else
			{
				return true;
			}
	}


	function chk_date(d,named,m,namem,y,namey)
	{
			var f  = document.all;
			var str_day		=	eval("f."+d+".value");
			var str_month	=	eval("f."+m+".value");
			var str_year		=	eval("f."+y+".value");
			if((str_month == '4') || (str_month == '04')|| (str_month == '6')||(str_month == '06')||(str_month == '9')||(str_month == '09')||(str_month == '11'))
			{
				if(str_day > 30)
				{
				alert ('กรุณาตรวจสอบวันที่ อีกครั้ง เพราะเดือนนี้มี 30 วัน');
				eval("f."+d+".focus()");
				return false;
				}
				else
				{
				return true;
				}
			}
	else if((str_month =='2') || (str_month =='02'))
		{
		var nyear = eval((str_year - 543)%4);
		if( nyear > 0 && str_day > 28)
			{
				alert ('กรุณาตรวจสอบวันที่ อีกครั้ง เพราะเดือนนี้มี 28 วัน');
				eval("f."+d+".focus()");
								return false;

			}
		else if( nyear == 0 && str_day > 29)
			{
				alert ('กรุณาตรวจสอบวันอีกครั้ง เพราะเดือนนี้มี 29 วัน');
				eval("f."+d+".focus()");
								return false;
			}
			else
			{
				return true;
			}
		}
		else
		{
			return true;
		}	
	}


function Tele(e) 
	{
			ok = "1234567890-,";
			found = 0;
			for(i=0; i < e.length ;i++){
					if(ok.indexOf(e.charAt(i)) > 0){ 
					found = eval("found") + 1;
					}	
			} 
			if (found == e.length){
					return true;
					}
			else{return false;}
	}
	
	function check_email(e) {
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			for(i=0; i < e.length ;i++){
						if(ok.indexOf(e.charAt(i))<0){ 
						return (false);}	
			} 
			if (document.images) {
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!e.match(re) && e.match(re_two)) {
			return (-1);		} 
					}
			}

  
  function ShwRow()
  {
  		var f = document.forms(0);
		var numtotal = f.numtotal.value;
		var numroom = f.Room.value;
				for ( j=1;j<=eval(numtotal);j++)
					{
					eval("document.all.Row"+j+".style.display ='none' ") 
					 }
					for ( i=1;i<=eval(numroom);i++)
					{
					eval("document.all.Row"+i+".style.display ='' ") 
					 }
	}
