function regInput(obj, reg, inputStr)
    {
        var docSel  = document.selection.createRange()
        if (docSel.parentElement().tagName != "INPUT")  return false
        oSel = docSel.duplicate()
        oSel.text = ""
        var srcRange    = obj.createTextRange()
        oSel.setEndPoint("StartToStart", srcRange)
        var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
        return reg.test(str)
    }

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function regMatch(obj,reg)
    {
      obj.value=reg.test(obj.value)? obj.value.match(reg,obj.value):'0';
    }

//reg.asp

function check_input_onblur(obj,type,message){
	//alert(obj.parentNode.getElementsByTagName("font")[0].innerHTML);
	//alert(rfgh1d111);
	if(type=='str'){
		if(obj.value==''){
			obj.parentNode.getElementsByTagName("font")[0].innerHTML=message;
			obj.parentNode.getElementsByTagName("font")[0].style.display='block';
		}else{
			obj.parentNode.getElementsByTagName("font")[0].style.display='none';
		}
	}
	
	if(type=='email'){
		if(obj.value==''){
			obj.parentNode.getElementsByTagName("font")[0].innerHTML=message;
			obj.parentNode.getElementsByTagName("font")[0].style.display='block';
		}else if(!is_email(obj.value)){
			obj.parentNode.getElementsByTagName("font")[0].innerHTML='Email format is incorrect';
			obj.parentNode.getElementsByTagName("font")[0].style.display='block';
		}else{
			obj.parentNode.getElementsByTagName("font")[0].style.display='none';
		}
	}
}

function regjs()
{var test = document.reginfo.email.value;
if(test.length!=0){
    if (test.charAt(0)=="." ||        
         test.charAt(0)=="@"||       
         test.indexOf('@', 0) == -1 || 
         test.indexOf('.', 0) == -1 || 
         test.lastIndexOf("@")==test.length-1 || 
         test.lastIndexOf(".")==test.length-1 || 
         test.substr(test.indexOf("@")+1,2).indexOf(".")!=-1
        )
     {
      //alert("请输入合法的EMAIL地址!");
      document.reginfo.email.focus();
      document.getElementById("emailTips").innerHTML ="<font color='red'>*请输入合法的EMAIL地址!</font>"; 
      //obj.parentNode.getElementsByTagName("font")[0].innerHTML='dsafsdrg';
	  //obj.parentNode.getElementsByTagName("font")[0].style.display='block';
      return false;
      }
   }
 else
  {
   //alert("请输入合法的EMAIL地址!");
   document.reginfo.email.focus();
   document.getElementById("emailTips").innerHTML ="<font color='red'>*请输入合法的EMAIL地址!</font>"; 
   return false;
   }
   
   
    if(checkspace(document.reginfo.password.value) || document.reginfo.password.value.length < 6) {
    document.reginfo.password.focus();
    //alert("请输入密码!");
    
    document.getElementById("pwTips").innerHTML ="<font color='red'>*请输入密码!</font>"; 
    return false;
  }
    if(document.reginfo.password.value != document.reginfo.password1.value) {
    document.reginfo.password.focus();
    document.reginfo.password.value = '';
    document.reginfo.password1.value = '';
    //alert("密码和确认密码不一致,请重新输入!");
    document.getElementById("pwTips1").innerHTML ="<font color='red'>*密码和确认密码不一致,请重新输入!</font>"; 
    return false;
  }
  
if(checkspace(document.reginfo.name.value)) {
    document.reginfo.name.focus();
    //alert("请输入姓名!");
    document.getElementById("nameTips").innerHTML ="<font color='red'>*请输入姓名!</font>"; 
    return false;
}
//
//if(checkspace(document.reginfo.tel.value)) {
//    document.reginfo.tel.focus();
//    //alert("请输入电话!");
//    document.getElementById("telTips").innerHTML ="<font color='red'>*请输入电话!</font>"; 
//    return false;
//}
//
if(checkspace(document.reginfo.phone.value)) {
    document.reginfo.phone.focus();
    //alert("请输入手机!");
    document.getElementById("phoneTips").innerHTML ="<font color='red'>*请输入联系电话!</font>"; 
    return false;
}

//if(checkspace(document.reginfo.company.value)) {
//    document.reginfo.company.focus();
//    //alert("请输入公司名称!");
//    document.getElementById("companyTips").innerHTML ="<font color='red'>*请输入公司名称!</font>";
//    return false;
//}
//
//if(checkspace(document.reginfo.province.value)) {
//    document.reginfo.province.focus();
//    //alert("请输入省!");
//    document.getElementById("provinceTips").innerHTML ="<font color='red'>*请输入省!</font>";
//    return false;
//}
//
//
//if(checkspace(document.reginfo.city.value)) {
//    document.reginfo.city.focus();
//    //alert("请输入城/镇!");
//    document.getElementById("cityTips").innerHTML ="<font color='red'>*请输入城/镇!</font>";
//    return false;
//}
//
//if(checkspace(document.reginfo.address.value)) {
//    document.reginfo.address.focus();
//    //alert("请输入地址!");
//    document.getElementById("addressTips").innerHTML ="<font color='red'>*请输入地址!</font>";
//    return false;
//}
//

}

function pass()
{

   
    if(checkspace(document.reginfo.password1.value) || document.reginfo.password1.value.length < 6) {
    document.reginfo.password1.focus();
    alert("旧密码长度至少6位!");
    return false;
  }
  
    if(checkspace(document.reginfo.password2.value) || document.reginfo.password2.value.length < 6) {
    document.reginfo.password2.focus();
    alert("新密码长度至少6位!");
    return false;
  }
    
    if(document.reginfo.password2.value != document.reginfo.password3.value) {
    document.reginfo.password2.focus();
    document.reginfo.password2.value = '';
    document.reginfo.password3.value = '';
    alert("新密码和确认密码不一致,请重新输入!");
    return false;
  }
  

}

function regjs1()
{

if(checkspace(document.reginfo.firstname.value)) {
    document.reginfo.firstname.focus();
    alert("Sorry Please Confirm your First Name is correct!");
    return false;
}

if(checkspace(document.reginfo.lastname.value)) {
    document.reginfo.lastname.focus();
    alert("Sorry Please Confirm your Last Name is correct!");
    return false;
}




    if(document.reginfo.password.value != document.reginfo.password1.value) {
    document.reginfo.password.focus();
    document.reginfo.password.value = '';
    document.reginfo.password1.value = '';
    alert("Sorry Please Confirm your Password is correct!");
    return false;
  }

if(checkspace(document.reginfo.shipping_firstname.value)) {
    document.reginfo.shipping_firstname.focus();
    alert("Sorry Please Confirm your Shopping First Name is correct!");
    return false;
}

if(checkspace(document.reginfo.shipping_lastname.value)) {
    document.reginfo.shipping_lastname.focus();
    alert("Sorry Please Confirm your Shopping Last Name is correct!");
    return false;
}

if(checkspace(document.reginfo.address.value)) {
    document.reginfo.address.focus();
    alert("Sorry Please Confirm your Address Line1 is correct!");
    return false;
}

if(checkspace(document.reginfo.city.value)) {
    document.reginfo.city.focus();
    alert("Sorry Please Confirm your City is correct!");
    return false;
}

if(checkspace(document.reginfo.state.value)) {
    document.reginfo.state.focus();
    alert("Sorry Please Confirm your State/Province/Region is correct!");
    return false;
}

if(checkspace(document.reginfo.postcode.value)) {
    document.reginfo.postcode.focus();
    alert("Sorry Please Confirm your Zip/Postal Code is correct!");
    return false;
}

if(checkspace(document.reginfo.phone.value)) {
    document.reginfo.phone.focus();
    alert("Sorry Please Confirm your Phone Number is correct!");
    return false;
}


}

function GetRadioValue(RadioName){
    var obj;    
    obj=document.getElementsByName(RadioName);
    if(obj!=null){
        var i;
        for(i=0;i<obj.length;i++){
            if(obj[i].checked){
                return obj[i].value;            
            }
        }
    }
    return null;
}

function step3js()
{
    
var RValue;
RValue=GetRadioValue("r1");

if (RValue=="1")
{
    
if(checkspace(document.reginfo.CARDNUM.value)) {
    document.reginfo.CARDNUM.focus();
    alert("Sorry Please Confirm your Credit Card Number is correct!");
    return false;
}

if(checkspace(document.reginfo.NAME.value)) {
    document.reginfo.NAME.focus();
    alert("Sorry Please Confirm your Cardhloder'name is correct!");
    return false;
}

if(checkspace(document.reginfo.CVV.value)) {
    document.reginfo.CVV.focus();
    alert("Sorry Please Confirm your Security Number is correct!");
    return false;
}

if(checkspace(document.reginfo.EXPMM.value)) {
    document.reginfo.EXPMM.focus();
    alert("Sorry Please Confirm your Expiration Date is correct!");
    return false;
}



if(checkspace(document.reginfo.EXPYY.value)) {
    document.reginfo.EXPYY.focus();
    alert("Sorry Please Confirm your Expiration Date is correct!");
    return false;
}


}

}



function infojs1()
{
    
  
    if(checkspace(document.info1.email.value) || checkspace(document.info1.email1.value)) {
    document.info1.email.focus();
    alert("Sorry Please Confirm your E-mail is correct!");
    return false;
  }
    if(document.info1.email.value != document.info1.email1.value) {
    document.info1.email.focus();
    document.info1.email.value = '';
    document.info1.email1.value = '';
    alert("Sorry Please Confirm your E-mail is correct!");
    return false;
  }



}



function infojs2()
{
    


  
    if(checkspace(document.reginfo.password.value) || document.reginfo.password.value.length < 6) {
    document.reginfo.password.focus();
    alert("Sorry Please Confirm your Password is correct!");
    return false;
  }
    if(document.reginfo.password.value != document.reginfo.password1.value) {
    document.reginfo.password.focus();
    document.reginfo.password.value = '';
    document.reginfo.password1.value = '';
    alert("Sorry Please Confirm your Password is correct!");
    return false;
  }


}



function addressjs()
{
    
if(checkspace(document.reginfo.FIRSTNAME.value)) {
    document.reginfo.FIRSTNAME.focus();
    alert("Sorry Please Confirm your firstname is correct!");
    return false;
  }
  
  if(checkspace(document.reginfo.LASTNAME.value)) {
    document.reginfo.LASTNAME.focus();
    alert("Sorry Please Confirm your lastname is correct!");
    return false;
  }

  if(checkspace(document.reginfo.ADDRESS1.value)) {
    document.reginfo.ADDRESS1.focus();
    alert("Sorry Please Confirm your Address is correct!");
    return false;
  }

  if(checkspace(document.reginfo.CITY.value)) {
    document.reginfo.CITY.focus();
    alert("Sorry Please Confirm your City is correct!");
    return false;
  }

  if(checkspace(document.reginfo.SATE.value)) {
    document.reginfo.SATE.focus();
    alert("Sorry Please Confirm your State/Province/Region is correct!");
    return false;
  }
  
  if(checkspace(document.reginfo.ZIPCODE.value)) {
    document.reginfo.ZIPCODE.focus();
    alert("Sorry Please Confirm your Zip Code is correct!");
    return false;
  }
  

  
  if(checkspace(document.reginfo.PHONE.value)) {
    document.reginfo.PHONE.focus();
    alert("Sorry Please Confirm your Phone is correct!");
    return false;
  }




}

function feedbackjs()
{
   if(checkspace(document.finfo.firstname.value)) {
    document.finfo.firstname.focus();
    alert("Sorry Please Confirm your First Name is correct!");
    return false;
  }

   if(checkspace(document.finfo.lastname.value)) {
    document.finfo.lastname.focus();
    alert("Sorry Please Confirm your Last Name is correct!");
    return false;
  }
  
if(document.finfo.email.value.length!=0)
  {
    if (document.finfo.email.value.charAt(0)=="." ||        
         document.finfo.email.value.charAt(0)=="@"||       
         document.finfo.email.value.indexOf('@', 0) == -1 || 
         document.finfo.email.value.indexOf('.', 0) == -1 || 
         document.finfo.email.value.lastIndexOf("@")==document.finfo.email.value.length-1 || 
         document.finfo.email.value.lastIndexOf(".")==document.finfo.email.value.length-1)
     {
      alert("Sorry Please Confirm your Email is correct!");
      document.finfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Sorry Please Confirm your Email is correct!");
   document.finfo.email.focus();
   return false;
   }

if(checkspace(document.finfo.phone.value)) {
    document.finfo.phone.focus();
    alert("Sorry Please Confirm your phone is correct!");
    return false;
  }
  
if(checkspace(document.finfo.content.value)) {
    document.finfo.content.focus();
    alert("Sorry Please Confirm your comments is correct!");
    return false;
  }  

}

function stepjs()
{
if(checkspace(document.stepinfo.firstname.value)) {
    document.stepinfo.firstname.focus();
    alert("Sorry Please Confirm your firstname is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.lastname.value)) {
    document.stepinfo.lastname.focus();
    alert("Sorry Please Confirm your lastname is correct!");
    return false;
  }

if(document.stepinfo.email.value.length!=0)
  {
    if (document.stepinfo.email.value.charAt(0)=="." ||        
         document.stepinfo.email.value.charAt(0)=="@"||       
         document.stepinfo.email.value.indexOf('@', 0) == -1 || 
         document.stepinfo.email.value.indexOf('.', 0) == -1 || 
         document.stepinfo.email.value.lastIndexOf("@")==document.stepinfo.email.value.length-1 || 
         document.stepinfo.email.value.lastIndexOf(".")==document.stepinfo.email.value.length-1)
     {
      alert("Sorry Please Confirm your Email is correct!");
      document.stepinfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Sorry Please Confirm your Email is correct!");
   document.stepinfo.email.focus();
   return false;
   }

if(checkspace(document.stepinfo.call.value)) {
    document.stepinfo.call.focus();
    alert("Sorry Please Confirm your call is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.contact.value)) {
    document.stepinfo.contact.focus();
    alert("Sorry Please Confirm your contact is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.country.value)) {
    document.stepinfo.country.focus();
    alert("Sorry Please Confirm your country is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.province.value)) {
    document.stepinfo.province.focus();
    alert("Sorry Please Confirm your province is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.city.value)) {
    document.stepinfo.city.focus();
    alert("Sorry Please Confirm your city is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.address.value)) {
    document.stepinfo.address.focus();
    alert("Sorry Please Confirm your address is correct!");
    return false;
  }
  if(checkspace(document.stepinfo.postcode.value)) {
    document.stepinfo.postcode.focus();
    alert("Sorry Please Confirm your postcode is correct!");
    return false;
  }
    if(document.stepinfo.remarks.value.length > 200 ) {
    document.stepinfo.remarks.focus();
    alert("Not more than 200 characters!");
    return false;
  }

}

function formpassjs()
{
    if(document.formpass.password.value != document.formpass.password1.value) {
    document.formpass.password.focus();
    document.formpass.password.value = '';
    document.formpass.password1.value = '';
    alert("Sorry Please Confirm your Password is correct!");
    return false;
  }
}

function forminfojs()
{
if(checkspace(document.forminfo.firstname.value)) {
    document.forminfo.firstname.focus();
    alert("Sorry Please Confirm your firstname is correct!");
    return false;
  }
  if(checkspace(document.forminfo.lastname.value)) {
    document.forminfo.lastname.focus();
    alert("Sorry Please Confirm your lastname is correct!");
    return false;
  }

if(document.forminfo.email.value.length!=0)
  {
    if (document.forminfo.email.value.charAt(0)=="." ||        
         document.forminfo.email.value.charAt(0)=="@"||       
         document.forminfo.email.value.indexOf('@', 0) == -1 || 
         document.forminfo.email.value.indexOf('.', 0) == -1 || 
         document.forminfo.email.value.lastIndexOf("@")==document.forminfo.email.value.length-1 || 
         document.forminfo.email.value.lastIndexOf(".")==document.forminfo.email.value.length-1)
     {
      alert("Sorry Please Confirm your Email is correct!");
      document.forminfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Sorry Please Confirm your Email is correct!");
   document.forminfo.email.focus();
   return false;
   }
  
}

function messageaddjs()
{
   if(checkspace(document.messageadd.title.value)) {
    document.messageadd.title.focus();
    alert("Sorry Please Confirm your title is correct!");
    return false;
  }

   if(document.messageadd.content.value.length > 400 ) {
    document.messageadd.content.focus();
    alert("Not more than 400 characters!");
    return false;
  }
}

function getpassjs1()
{
    if(checkspace(document.formgetpass1.userid.value)) {
    document.formgetpass1.userid.focus();
    alert("Sorry Please Confirm your userid is correct!");
    return false;
  }

}
function getpassjs2()
{
    if(checkspace(document.formgetpass2.Answer.value)) {
    document.formgetpass2.Answer.focus();
    alert("Sorry Please Confirm your Answer is correct!");
    return false;
  }

}
function getpassjs3()
{
    if(checkspace(document.formgetpass3.password.value)) {
    document.formgetpass3.password.focus();
    alert("Sorry Please Confirm your password is correct!");
    return false;
  }
    if(document.formgetpass3.password.value != document.formgetpass3.password1.value) {
    document.formgetpass3.password.focus();
    document.formgetpass3.password.value = '';
    document.formgetpass3.password1.value = '';
    alert("Sorry Please Confirm your Password is correct!");
    return false;
  }

}

function addmailjs()
{
if(document.addmailinfo.email.value.length!=0)
  {
    if (document.addmailinfo.email.value.charAt(0)=="." ||        
         document.addmailinfo.email.value.charAt(0)=="@"||       
         document.addmailinfo.email.value.indexOf('@', 0) == -1 || 
         document.addmailinfo.email.value.indexOf('.', 0) == -1 || 
         document.addmailinfo.email.value.lastIndexOf("@")==document.addmailinfo.email.value.length-1 || 
         document.addmailinfo.email.value.lastIndexOf(".")==document.addmailinfo.email.value.length-1)
     {
      alert("Sorry Please Confirm your Email is correct!");
      document.addmailinfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Sorry Please Confirm your Email is correct!");
   document.addmailinfo.email.focus();
   return false;
   }
}

function DrawImage(ImgD,FitWidth,FitHeight){
    var image=new Image();     
    image.src=ImgD.src;     
    if(image.width>0 && image.height>0){
        if(image.width/image.height>= FitWidth/FitHeight){             
            if(image.width>FitWidth){                 
                ImgD.width=FitWidth;                 
                ImgD.height=(image.height*FitWidth)/image.width;             
            }
            else
            {                 
                ImgD.width=image.width;                 
                ImgD.height=image.height;             
            }         
        } 
        else
        {             
            if(image.height>FitHeight)
            {                 
                ImgD.height=FitHeight;                 
                ImgD.width=(image.width*FitHeight)/image.height;             
            }
            else
            {                 
                ImgD.width=image.width;                 
                ImgD.height=image.height;             
            }         
        }     
    } 
}

function onewh(ow)
{
a=eval("wh"+ow)
if(a.style.display=="none")
{
eval ( "wh" + ow +".style.display=\"\";")
}
else
{
eval("wh" + ow +".style.display=\"none\" ;")
}

}

function trshow(obj){
if (obj.style.display=='none')
 {obj.style.display='';}
else
 {obj.style.display='none';}
}

function time()
{
var mydate=new Date()
var year=mydate.getYear()
var month=mydate.getMonth()+1
var date=mydate.getDate()
var day=mydate.getDay()
var hours=mydate.getHours()
var minute=mydate.getMinutes()
var second=mydate.getSeconds()
var str=month+" "+date+" "+year+" "+((hours<10)? "0":"")+hours+((minute<10)? ":0":":")+minute+((second<10)? ":0":":")+second
dd.innerHTML=str
setTimeout("time()",1000)
}


function getck(sname,acookie)
{
    for(var i=0;i<acookie.length;i++){
        var arr=acookie[i].split("=");
        if(sname==arr[0]){
            if(arr.length>1)
            return unescape(arr[1]);
        else
            return "no login";
        }
    }
    return "no login";
}
function searchreg(){
	if(document.getElementById('industry').value=='请输入行业或公司名或电话传真')
		document.getElementById('industry').value = '';
	if(document.getElementById('areainput').value=='请输入地名')
		document.getElementById('areainput').value = '';
	return true;
	//document.getElementById('search_form').submit();
	
	//window.location.href='/search?area=' + ($('#area').val()=='请输入地名'?'':$('#area').val()) + '&industry=' + ($('#industry').val()=='请输入行业或公司名或电话传真'?'':$('#industry').val());
}
function search_submit(){
	if(document.getElementById('industry').value=='请输入行业或公司名或电话传真')
		document.getElementById('industry').value = '';
	if(document.getElementById('area').value=='请输入地名')
		document.getElementById('area').value = '';
	//return true;
	document.getElementById('search_form').submit();
	
	//window.location.href='/search?area=' + ($('#area').val()=='请输入地名'?'':$('#area').val()) + '&industry=' + ($('#industry').val()=='请输入行业或公司名或电话传真'?'':$('#industry').val());
	
}





// homepage
var data_sign = 0;
function init_search(){
	if(data_sign)
		return false;
	data_sign = 1;
       $("#industry").autocomplete("/get_industry.php",{my_url:"/get_industry.php?keyword="});
       $("#area").autocomplete("/get_industry.php",{my_url:"/get_industry.php?area="});
       /*
	alert(1);
    $.getJSON("/get_industry.php", function(data){
        $("#industry").autocomplete(data);
        $("#area").autocomplete(data);
    });
    */
    
}


function show_div(id){
    var obj1 = document.getElementById("search") ;
    var obj2 = document.getElementById("search_area") ;
    var obj3 = document.getElementById("search_calling") ;
    var labe1 = document.getElementById("labe_1") ;
    var labe2 = document.getElementById("labe_2") ;
    var labe3 = document.getElementById("labe_3") ;
    if(id == 1){
        obj1.style.visibility = "";
        labe1.className = "link2";
        labe2.className = "link1";
        labe3.className = "link1";
        obj2.style.visibility = "hidden";
        obj3.style.visibility = "hidden";
        obj2.style.display = "none";
        obj3.style.display = "none";
    }
    if(id == 2){
        obj1.style.visibility = "hidden";
        labe1.className = "link1";
        labe2.className = "link2";
        labe3.className = "link1";
        obj2.style.visibility = "";
        obj3.style.visibility = "hidden";
        obj2.style.display = "";
        obj3.style.display = "none";
    }
    if(id == 3){
        labe1.className = "link1";
        labe2.className = "link1";
        labe3.className = "link2";
        obj1.style.visibility = "hidden";
        obj2.style.visibility = "hidden";
        obj3.style.visibility = "";
        obj2.style.display = "none";
        obj3.style.display = "";
    }
}


/**
 *  以为内容为新加入的注册验证内容，废除以前的验证方法
 *  author： Ryan
 *  2010-12-01
 *  */
function reg_email(){
	var ema = document.reginfo.email.value;
	var reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+/;
	if(ema){
		if(!reg.test(ema)){
			 document.getElementById("emailTips").innerHTML ="<font color='red'>*请输入合法的EMAIL地址!</font>";
			 return false;
		}else{
			$.ajax({ //一个Ajax过程
				type: "post", //以post方式与后台沟通
				url : "/check_companyname.php", //与此php页面沟通
				dataType:'text',// 从php返回的值以 JSON方式 解释
				data: 'username='+ema, //发给php的数据：公司名称
				success: function(result){//如果调用php成功
					var rs = result.split(",");
					if(rs[0] == '1'){
						document.getElementById("emailTips").innerHTML ="<font color='green'>*可以使用的用户名!</font>";
						document.getElementById("nextstep").disabled = false;
					}else{
						document.getElementById("emailTips").innerHTML ="<font color='red'>*"+rs[1]+"</font>";
						document.getElementById("nextstep").disabled = true;
					}
				}
			});
			
			return true;
		}
	}else{
		document.getElementById("emailTips").innerHTML ="<font color='red'>*用户名不能为空！</font>";
		return false;
	}
}

function reg_pwd1(){
	var psw1 = document.reginfo.password.value;
	if(psw1){
		if(psw1.length <6){
			document.getElementById("pwTips").innerHTML ="<font color='red'>*输入密码必须大于6位字符!</font>"; 
			return false;
		}else{
			document.getElementById("pwTips").innerHTML =""; 
			return true;
		}
	}else{
		document.getElementById("pwTips").innerHTML ="<font color='red'>*请输入密码!</font>"; 
		return false;
	}
}

function reg_pwd2(){
	var psw1 = document.reginfo.password.value;
	var psw2 = document.reginfo.password1.value;
	if(psw2){
		if(psw1 != psw2){
			 document.getElementById("pwTips1").innerHTML ="<font color='red'>*密码和确认密码不一致,请重新输入!</font>"; 
			return false;
		}else{
			document.getElementById("pwTips1").innerHTML =""; 
			return true;
		}
	}else{
		 document.getElementById("pwTips1").innerHTML ="<font color='red'>*密码和确认密码不一致,请重新输入!</font>"; 
		return false;
	}
}

function reg_name(){
	var nam = document.reginfo.name.value;
	if(!nam){
		document.getElementById("nameTips").innerHTML ="<font color='red'>*请输入姓名!</font>"; 
    	return false;
	}else{
		return true;
	}
}

function reg_phone(){
	var ph = document.reginfo.phone.value;
	if(!ph){
		document.getElementById("phoneTips").innerHTML ="<font color='red'>*请输入联系电话!</font>"; 
    	return false;
	}else{
		var reg = /(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}/;
		if(!reg.test(ph)){
			document.getElementById("phoneTips").innerHTML ="<font color='red'>*请输入正确的电话号码!</font>"; 
    		return false;
		}else{
			document.getElementById("phoneTips").innerHTML =""; 
    		return true;
		}
	}
}

function reg_form(){
	if(reg_email() && reg_pwd1() && reg_pwd2() && reg_name() && reg_phone()){
		return true;
	}else{
		alert('表单有错误，请改正！');
		return false;
	}
}


// 操作员复选框全部选取
function checkAll(form, checkbox) {
	for (i = 0; i < form.elements.length; i++) {
		if (form.elements[i].type == "checkbox") {
			form.elements[i].checked = checkbox.checked;
		}
	}
}
