$(function(){
	/*$('.nav li').hover(function(){
		$('dl',this).stop(true,true).slideDown();
	},function(){
		$('dl',this).stop(true,true).slideUp();
	});*/
    $(".nav li").hover(function() {
        $('.subnav',this).fadeIn();
    },function() {
        $('.subnav', this).fadeOut();
    });
    $(window).scroll(function () {
        if ($(window).scrollTop() >= 200) {
            $(".header").css({top: -120});
            $(".new-nav").css({top: 0});
        } else {
            $(".header").css({top: 0});
            $(".new-nav").css({top: 115});
        }
    });

    // if($('.apply_fixed .main').length>0){
	// 	$(window).scroll(function(){
	// 		var top=$('.footer').offset().top-$(window).height();
	// 		var scrolltop=$(window).scrollTop();
	// 		if(scrolltop>=top){
	// 			$('.apply_fixed .main').addClass('pos');
	// 			$('.clj_open').addClass('pos');
	// 			$('.clj_hide').addClass('pos');
	// 		}
	// 		else{
	// 			$('.apply_fixed .main').removeClass('pos');
	// 			$('.clj_open').removeClass('pos');
	// 			$('.clj_hide').removeClass('pos');
	// 		}
	//
	// 	});
	// }
    $('.clj_open').addClass('pos');

    $(".clj_hide").click(function(){
        $(".apply_fixed .main").animate({width:"0px"});
        $(".apply_fixed .main").animate({height:"0px"});
        $(".clj_open").animate({left:"0px"});
    });

    $(".clj_open").click(function(){
        $(".apply_fixed .main").animate({width:"100%"});
        $(".apply_fixed .main").animate({height:"146px"});
        $(".clj_open").animate({left:"-200px"});
    });


    $('.rightfixed li#ewm').hover(function(){
		$('img',this).stop(true,true).fadeIn();
	},function(){
		$('img',this).stop(true,true).fadeOut();
	});
	$('.rightfixed li#goTop').click(function(){
		$('html,body').animate({'scrollTop':0});
	});
});
function applyForm(obj){
	var name=$(obj).parents('form').find('.name').val();
	var phone=$(obj).parents('form').find('.telephone').val();
	//var email=$(obj).parent('form').find('.email').val();
	if(name==''){
		alert('请输入您的名字');
		return false;
	}
	if(phone==''){
		alert('请输入您的手机');
		return false;
	}
	if(!phoneReg(phone)){
		alert('请输入正确的手机格式');
		return false;
	}
	/*if(email!='' && !emailReg(email)){
		alert('请输入正确的邮箱格式');
		return false;
	}*/
}

//手机号正则验证
function phoneReg(phone){
	var reg=/^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
	var result=reg.test(phone)? true:false ;
	return result;
}
//邮箱正则验证
function emailReg(email){
	var reg=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
	var result=reg.test(email)? true:false ;
	return result;
}