$(function(){

            







            $(document).ready(  
                function(){  
                    goCenter();  
                    //滚动条滚动  
                    $(window).scroll(  
                        function(){  
                            goCenter();  
                        }  
                    );  
                    //拖动浏览器窗口  
                    $(window).resize(  
                        function(){  
                            goCenter();  
                        }  
                    );  
                }  
            );  
              
            function goCenter()  
            {  
                var top = $(window).scrollTop();  
               $(".erweima").css("top",top + 220 +"px");  
               $(".img_car_big11").css("top",top+10+"px");
                
            } 


	$(".menu").click(function(){
	    var flag = $(this).attr("flag"); 
	    if (flag == 1) {
	    	$(".float").show();
			$(".menu").addClass("menu1");
			$(this).attr("flag",2);	
	    }else{
	    	$(".float").hide();
			$(".menu").removeClass("menu1");
			$(this).attr("flag",1);
	    };
		
	});

	$(".zhanhui").hover(function(){
		$(".news_wd2").addClass("juhuang");
		$(".news_wd3").removeClass("juhuang");
		$(".new_con2").fadeOut(500,function(){
			$(".new_con").fadeIn(500);	
		});
			
	});
	$(".meiti").hover(function(){
		$(".news_wd3").addClass("juhuang");
		$(".news_wd2").removeClass("juhuang");
		$(".new_con").fadeOut(500,function(){
			$(".new_con2").fadeIn(500);	
		});
		
	});

	/*$(".ora").hover(function(){
		$(".ora").addClass("beijing");
		$(".ora").removeClass("ora2");
		$(".kuang").removeClass("ora1");
		$(".kuang").removeClass("beijing");	
		$(".car2").fadeOut(500,function(){
			$(".car").fadeIn(500);
		});	
	});
	$(".kuang").hover(function(){
		$(".ora").removeClass("beijing");
		$(".ora").addClass("ora2");
		$(".kuang").addClass("beijing");
		$(".kuang").addClass("ora1");
		$(".car").fadeOut(500,function(){
		$(".car2").fadeIn(500);	
		});
	});
*/


});



function check() {
	var atpos=document.form_form.email.value.indexOf("@",1);
	var pepos=document.form_form.email.value.indexOf(".",atpos);
	//筛选出@在这个邮件的位置
	if (document.form_form.company.value == "") {		
		alert ("请输入您的公司名称!");
		document.form_form.company.focus();		
		return false;
	}
	if (document.form_form.company.value.length < 4) {
		alert("公司名称不能少于4位!");
		document.form_form.company.focus();
		return false;
	}
	if (document.form_form.name.value == "") {		
		alert ("请输入联系人名字!");
		document.form_form.name.focus();		
		return false;
	}
	if (document.form_form.name.value.length < 2) {
		alert("联系人不能少于2位!");
		document.form_form.name.focus();
		return false;
	}
	if (document.form_form.address.value == ""){
		alert ("请输入您的地址！");	
		document.form_form.address.focus();
		return false;
	}
	if (isNaN(document.form_form.post.value)) {
		alert("邮编必须是数字！例如：510660");
		document.form_form.post.focus();
		return false;	
	}
	if (document.form_form.area.value == ""){
		alert ("请输入您的区号！");	
		document.form_form.area.focus();
		return false;
	}
	if (document.form_form.phone.value == ""){
		alert ("请输入您的手机号码！");	
		document.form_form.phone.focus();
		return false;
	}
	if (isNaN(document.form_form.area.value)) {
		alert("区号必须是数字！例如：020");
		document.form_form.area.focus();
		return false;	
	}
	if (document.form_form.area.value.length<3 || document.form_form.area.value.length>5) {
		alert("区号必须是3-5位！");
		document.form_form.area.focus();
		return false;	
	}
	if (document.form_form.tel.value == ""){
		alert ("请输入您的电话！");	
		document.form_form.tel.focus();
		return false;
	}
	if (isNaN(document.form_form.tel.value)) {
		alert("电话必须是数字！");
		document.form_form.tel.focus();
		return false;	
	}
	if (document.form_form.tel.value.length < 7) {
		alert("电话号码不能少于7位!");
		document.form_form.tel.focus();
		return false;
	}
	if (document.form_form.email.value == "") {		
		alert ("邮件不得为空！");
		document.form_form.email.focus();		
		return false;
	}
	if (atpos==-1) { //如果有@返回@的位置,如果没有则返回-1
		alert ("请输入的邮件缺少@");
		document.form_form.email.focus();
		return false;	
	}
	if (document.form_form.email.value.indexOf("@",atpos+1) != -1) {
		alert ("邮件中不能同时输入两个@");//不能同时出现两个
		document.form_form.email.focus();
		return false;
	}
	if (pepos==-1) {//检查是否有.
		alert("邮件中缺少.");
		document.form_form.email.focus();
		return false;	
	}
	if (pepos+3>document.form_form.email.value.length) {//.后面有2个字符
		alert ("邮件中.后没有至少2个字符!");
		document.form_form.email.focus();
		return false;
	}
	if (document.form_form.pro.value=="") {
		alert ("参展产品不得为空！");
		document.form_form.pro.focus();
		return false;
	}
	if (document.form_form.pro.value.length < 2) {
		alert("参展产品不能少于2位!");
		document.form_form.pro.focus();
		return false;
	}
	if (document.form_form.content.value=="") {
		alert ("留言不得为空！");
		document.form_form.content.focus();
		return false;
	}
	if (document.form_form.content.value.length<10 || document.form_form.content.value.length>50) {
		alert("留言必须是10-50位！");
		document.form_form.content.focus();
		return false;	
	}
	return true;
}
