function cg(){
   document.form.Fax_1.value=form.Phone_1.value;
}

function cg1(){
   document.form.Fax_2.value=form.Phone_2.value;
}

function selectbooth(form) {
   document.form.booth.disabled=!document.form.sele1.checked;
}

function checkemail(){
var str=document.forms[0].email.value
var filter=/^.+@.+\..{2,3}$/
if (filter.test(str))
	testresults=true
else
	testresults=false	
return (testresults)
}

function doesExist(inputValue){
	var aCharExists=false
		if(inputValue){
		for(var i=0; i<inputValue.length; i++){
			if(inputValue.charAt(i)!=" "){
				aCharExists=true}
		}
	}
	return aCharExists
}

function CheckForm(){
        var gotchar=true
        gotchar=doesExist(document.forms[0].booth.value)
        if(gotchar==false){
                alert("请输入预定展台尺寸")
                document.forms[0].booth.focus()
                return false
                } 
        gotchar=doesExist(document.forms[0].company.value)
        if(gotchar==false){
                alert("请输入公司名")
                document.forms[0].company.focus()
                return false
                } 		
        gotchar=doesExist(document.forms[0].contact.value)
        if(gotchar==false){
                alert("请输入姓名")
                document.forms[0].contact.focus()
                return false
                } 
        gotchar=doesExist(document.forms[0].Phone_1.value)
        if(gotchar==false){
                alert("请输入国家号")
                document.forms[0].Phone_1.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].Phone_2.value)
        if(gotchar==false){
                alert("请输入地区号")
                document.forms[0].Phone_2.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].Phone_3.value)
        if(gotchar==false){
                alert("请输入电话")
                document.forms[0].Phone_3.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].Fax_1.value)
        if(gotchar==false){
                alert("请输入国家号")
                document.forms[0].Fax_1.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].Fax_2.value)
        if(gotchar==false){
                alert("请输入地区号")
                document.forms[0].Fax_2.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].Fax_3.value)
        if(gotchar==false){
                alert("请输入传真")
                document.forms[0].Fax_3.focus()
                return false
                }
        gotchar=doesExist(document.forms[0].email.value)
        if(gotchar==false){
                alert("请输入电子邮件")
                document.forms[0].email.focus()
                return false
                }       
        else{
		gotchar=checkemail()
		if (gotchar==false){
			alert("请完善电子邮件地址")
			document.forms[0].email.focus()
			return false
		}
	}	

 	return true;
}

