function JM_sh(ob){
if (ob.style.display=="none"){ob.style.display=""}else{ob.style.display="none"};
}

function fucPWDchk(str) 
{ 
var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
var ch; 
var i; 
var temp; 
for (i=0;i<=(str.length-1);i++) 
{ 

ch = str.charAt(i); 
temp = strSource.indexOf(ch); 
if (temp==-1) 
{ 
return 0; 
} 
} 
if (strSource.indexOf(ch)==-1) 
{ 
return 0; 
} 
else 
{ 
return 1; 
} 
} 
function jtrim(str) 
{ while (str.charAt(0)==" ") 
{str=str.substr(1);} 
while (str.charAt(str.length-1)==" ") 
{str=str.substr(0,str.length-1);} 
return(str); 
} 
//判断表单输入正误
function Checkreg()
{
	if (document.ADDUser.Name.value.length <2 || document.ADDUser.Name.value.length >16) {
		alert("提示：请输入您的姓名。");
		document.ADDUser.Name.focus();
		return false;
	}
	
   var  m= /(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/; 
	  if(m.test(document.getElementById("Telephone").value)){   
  }else{   
  alert("电话号码输入不正确，如：021-51099795");
  		document.ADDUser.Telephone.focus();
		return false;   
  } 
	
var emailStr=document.ADDUser.Email.value;
var emailPat=/^(.+)@(.+)$/;
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
 alert("电子邮件地址必须包括 ( @ 和 . )")
 document.ADDUser.Email.focus();
 return false;
}

if(document.ADDUser.NoRooms!=0){
 if   (!/^\d+$/.test(document.ADDUser.NoRooms.value)) {  
  alert('房间数必须为数字!');
 document.ADDUser.NoRooms.focus();
  return false;
  }
  } 
  

if (document.ADDUser.Hotel1st.value.length <2 ) {
		alert("提示：请确认酒店的第一选择。");
		document.ADDUser.Hotel1st.focus();
		return false;
	}
if (document.ADDUser.Hotel2nd.value.length <2 ) {
		alert("提示：请确认酒店的第二选择。");
		document.ADDUser.Hotel2nd.focus();
		return false;
	}
    
if (document.ADDUser.RoomType.value.length <2 ) {
		alert("提示：请确认酒店的房型。");
		document.ADDUser.RoomType.focus();
		return false;
	}    

if (document.ADDUser.CheckinDay.value.length <2 ) {
		alert("提示：请输入完整的入住日期。");
		document.ADDUser.CheckinDay.focus();
		return false;
	}
if (document.ADDUser.CheckinMonth.value.length <2 ) {
		alert("提示：请输入完整的入住日期。");
		document.ADDUser.CheckinMonth.focus();
		return false;
	}

	
if (document.ADDUser.CheckoutDay.value.length <2 ) {
		alert("提示：请输入完整的离店日期。");
		document.ADDUser.CheckoutDay.focus();
		return false;
	}
if (document.ADDUser.CheckoutMonth.value.length <2 ) {
		alert("提示：请输入完整的离店日期。");
		document.ADDUser.CheckoutMonth.focus();
		return false;
	}
       
}

