$(function(){ //$(".bigbackframe").bigbackfrm(); //regpop = $(".regframe").popfrm({background:".bigbackframe"}); //regpop.showpop(); var mebu_time; $(".menu-ul li").hover(function(){ if(mebu_time){ cleartimeout(mebu_time); } var menu=$(this).attr("menu"); var child_menu=$(".link-img-top[menu='"+menu+"']").show(); $(".link-img-top").not(child_menu).hide(); $(this).addclass("on-chk"); },function(){ mebu_time=settimeout(function(){ $(".link-img-top").hide(); },50); $(this).removeclass("on-chk"); }); $(".link-img-top").hover(function(){ if(mebu_time){ cleartimeout(mebu_time); } },function(){ mebu_time=settimeout(function(){ $(".link-img-top").hide(); },50); }); $(".wx-icon").hover(function(){ if(mebu_time){ cleartimeout(mebu_time); } $("img.wx-icontop").show(); },function(){ mebu_time=settimeout(function(){ $("img.wx-icontop").hide(); },50); }); $("img.wx-icontop").hover(function(){ if(mebu_time){ cleartimeout(mebu_time); } },function(){ mebu_time=settimeout(function(){ $("img.wx-icontop").hide(); },50); }); $(".link-img li").hover(function(){ $(this).addclass("on-chk"); },function(){ $(this).removeclass("on-chk"); }); $(".mod-about-link").hover(function(){ $(this).css('background','none repeat scroll 0 0 #e24445'); },function(){ $(this).css('background','none repeat scroll 0 0 #a2a5ae'); }); //职位申请 if($(".ipop1").length>0) { $('.reply-edit-cover-uploadll').each(function(){ kindeditoruploadbtn_new($(this)); }); var ibackground = $(".ibackground").bigbackfrm(); var ipop1 = $(".ipop1").popfrm({background:".ibackground"}); var ipop2 = $(".ipop2").popfrm({background:".ibackground",fixed:false,height:($(window).height()<=$(".ipop2").outerheight()?$(window).height():$(".ipop2").outerheight())}); $(".ipop1 .close01,.ipop2 .close01").click(function(){ ipop1.hidepop(); ipop2.hidepop(); }); $(".work_detail_hr").click(function(){ ipop1.hidepop(); ipop2.showpop(); }); $(".work_vote_ll").click(function(){ var work_name=$(this).attr('work_name'); $("input[name='job_name']").val(work_name); ipop1.showpop(); }); $("form[name=vote]").submit(function(){ if($.trim($("form[name=vote] input[name=name]").val()).length==0){ $("form[name=vote] input[name=name]").focus(); alert("请填写姓名"); return false; } if($.trim($("form[name=vote] input[name=tel]").val()).length==0){ $("form[name=vote] input[name=tel]").focus(); alert("请填写联系手机"); return false; }else if(!/1[0-9]{10}/.test($("form[name=vote] input[name=tel]").val())){ $("form[name=vote] input[name=tel]").focus(); alert("请正确填写联系手机"); return false; } if($.trim($("form[name=vote] input[name=job_name]").val()).length==0){ $("form[name=vote] input[name=job_name]").focus(); alert("请填写申请的职位"); return false; } if($.trim($("form[name=vote] input[name=resume]").val()).length==0){ alert("请上传简历"); return false; } $.getjson('/hr/index.php?act=send_vote', $("form[name=vote]").serialize(),function(rs){ if(rs.error) { alert("简历提交失败"); } else{ alert("简历提交成功"); ipop1.hidepop(); ipop2.hidepop(); document.forms['vote'].reset(); } }) return false; }); $("form[name=vote_detail]").submit(function(){ if($.trim($("form[name=vote_detail] input[name=name]").val()).length==0){ $("form[name=vote_detail] input[name=name]").focus(); alert("请填写姓名"); return false; } if($.trim($("form[name=vote_detail] input[name=age]").val()).length==0){ $("form[name=vote_detail] input[name=age]").focus(); alert("请填写年龄"); return false; }else if(!/\d+/.test($("form[name=vote_detail] input[name=age]").val())){ $("form[name=vote_detail] input[name=age]").focus(); alert("请正确填写年龄"); return false; } if($.trim($("form[name=vote_detail] input[name=home_town]").val()).length==0){ $("form[name=vote_detail] input[name=home_town]").focus(); alert("请填写籍贯"); return false; } if($.trim($("form[name=vote_detail] input[name=specialty]").val()).length==0){ $("form[name=vote_detail] input[name=specialty]").focus(); alert("请填写专业"); return false; } if($.trim($("form[name=vote_detail] input[name=college]").val()).length==0){ $("form[name=vote_detail] input[name=college]").focus(); alert("请填写毕业院校"); return false; } if($.trim($("form[name=vote_detail] input[name=email]").val()).length==0){ $("form[name=vote_detail] input[name=email]").focus(); alert("请填写e-mail"); return false; }else if(!/([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-za-z]{2,4}|[0-9]{1,3})(\]?)/.test($("form[name=vote_detail] input[name=email]").val())){ $("form[name=vote_detail] input[name=email]").focus(); alert("请正确填写e-mail"); return false; } if($.trim($("form[name=vote_detail] input[name=tel]").val()).length==0){ $("form[name=vote_detail] input[name=tel]").focus(); alert("请填写联系手机"); return false; }else if(!/1[0-9]{10}/.test($("form[name=vote_detail] input[name=tel]").val())){ $("form[name=vote_detail] input[name=tel]").focus(); alert("请正确填写联系手机"); return false; } if($.trim($("form[name=vote_detail] input[name=job_name]").val()).length==0){ $("form[name=vote_detail] input[name=job_name]").focus(); alert("请填写申请的职位"); return false; } $.getjson('/hr/index.php?act=send_vote', $("form[name=vote_detail]").serialize(),function(rs){ if(rs.error) { alert("简历提交失败"); } else{ alert("简历提交成功"); ipop1.hidepop(); ipop2.hidepop(); document.forms['vote_detail'].reset(); } }) return false; }); } //在线留言 $("form[name=guestbook] select[name='type']").change(function(){ if($(this).val()=='1'){ $(".baoxiu_l").show(); }else{ $(".baoxiu_l").hide(); } }); $("form[name=guestbook]").submit(function(){ if($.trim($("form[name=guestbook] input[name=unit_name]").val()).length==0){ //$("form[name=guestbook] input[name=unit_name]").focus(); //alert("请填写单位名称"); //return false; } if($.trim($("form[name=guestbook] input[name=name]").val()).length==0){ //$("form[name=guestbook] input[name=name]").focus(); //alert("请填写客户姓名"); //return false; } if($.trim($("form[name=guestbook] input[name=tel]").val()).length==0 && $.trim($("form[name=guestbook] input[name=unit_tel]").val()).length==0) { $("form[name=guestbook] input[name=tel]").focus(); alert("请填写移动电话或单位电话"); return false; } /*if($.trim($("form[name=guestbook] input[name=tel]").val()).length==0){ $("form[name=guestbook] input[name=tel]").focus(); alert("请填写移动电话"); return false; }else*/ if($.trim($("form[name=guestbook] input[name=tel]").val()).length>0 && !/^[\s]*1[0-9]{10}[\s]*$/.test($("form[name=guestbook] input[name=tel]").val())){ $("form[name=guestbook] input[name=tel]").focus(); alert("请正确填写移动电话"); return false; } /* if($.trim($("form[name=guestbook] input[name=unit_tel]").val()).length==0){ $("form[name=guestbook] input[name=unit_tel]").focus(); alert("请填写单位电话"); return false; }else*/ if($.trim($("form[name=guestbook] input[name=unit_tel]").val()).length>0 && !/^[\s]*[0-9]{3,4}[\-\s]*[0-9]{7,8}[\s]*$/.test($("form[name=guestbook] input[name=unit_tel]").val())){ $("form[name=guestbook] input[name=unit_tel]").focus(); alert("请正确填写单位电话"); return false; } if($.trim($("form[name=guestbook] input[name=email]").val()).length==0){ $("form[name=guestbook] input[name=email]").focus(); alert("请填写e-mail"); return false; }else if(!/([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-za-z]{2,4}|[0-9]{1,3})(\]?)/.test($("form[name=guestbook] input[name=email]").val())){ $("form[name=guestbook] input[name=email]").focus(); alert("请正确填写e-mail"); return false; } if($("form[name=guestbook] select[name='type']").val()=='1') { if($.trim($("form[name=guestbook] input[name=goods_sn]").val()).length==0){ $(".baoxiu_l").show(); $("form[name=guestbook] input[name=goods_sn]").focus(); alert("请填写产品型号"); return false; } if($.trim($("form[name=guestbook] input[name=buy_addr]").val()).length==0){ $(".baoxiu_l").show(); $("form[name=guestbook] input[name=buy_addr]").focus(); alert("请填写购买地点"); return false; } } if($.trim($("form[name=guestbook] textarea[name=content]").val()).length==0){ $("form[name=guestbook] textarea[name=content]").focus(); alert("请填写具体内容"); return false; } $.getjson('/service/guestbook.php?act=save', $("form[name=guestbook]").serialize(),function(rs){ if(rs.error) { alert("在线留言失败,请重新提交"); } else{ alert("谢谢您的留言,我们会尽快回复您!"); document.forms['guestbook'].reset(); } }) return false; }); })