// JavaScript Document
//input全选
function cball(form)
{
    for (var i=0;i<form.elements.length;i++)
    {
      var e = form.elements[i];
      if (e.Name != "allcheckbox"&&e.disabled==false)
      e.checked = form.allcheckbox.checked;
    } 
}
 //去除空格
function trim(str)   
{   
    return str.replace(/(^\s*)|(\s*$)/g, "");   

function checkRate(input)
{
     var   re =  /^[0-9]*[1-9][0-9]*$/;
     if(!re.test(input))
    {
        return false;
     }
 else
 {
return true;
 }
}//文本框内容验证
function formcheck()
{
var checkstr = '仅限输入20位';
  for(var i=1;i<6;i++){
     if(trim(document.getElementById("text_name" + i).value)=="" || document.getElementById("text_name" + i).value == checkstr )
 {
         alert("请输入指定的信息");
         document.getElementById("text_name" + i).focus();
         return false;
        } 
    }
if(!checkRate(document.form1.hot.value)){
alert("请您注意:酒店ID必须为整数");
return false;
}
if(!checkRate(document.form1.s_tp.value)){
alert("请您注意:s_tp必须为整数");
return false;
}
if(document.form1.ctn.value.length>150)
       {
        alert("请您注意:内容介绍不能超过150个字符!");
        document.form1.ctn.focus();
        return false;
       } startDate=document.form1.start.value;
    endDate=document.form1.end.value;
    var tmp_start=startDate.replace(/-/g,"");
    var tmp_end=endDate.replace(/-/g,"");
   // var start_date=new Date(tmp_start[0],tmp_start[1],tmp_start[2]);
   // var end_date=new Date(tmp_end[0],tmp_end[1],tmp_end[2]);
//alert(tmp_start);
//alert(tmp_end);
    if(parseInt(tmp_start) > parseInt(tmp_end))
    {
      alert("对不起,开始日期不能大于结束日期!");
      return false;
    }
return true;}
function zifu ()
{
 for(var i=1;i<4;i++){
     if(trim(document.getElementById("text_name" + i).value)=="" )
 {
         alert("请输入指定的信息");
         document.getElementById("text_name" + i).focus();
         return false;
        } 
 }
if(document.form1.pwd_qx.value.length < 4)
{
  alert('输入的密码长度不能小于4');
  return false;
}
if(document.form1.qr_qx.value.length < 4)
{
  alert('输入的密码长度不能小于4');
  return false;
}
return true;
}