var My = { swf : function(swf, width, height, body, wmode, quality) { if(swf == '') { return false; } var width = width || 400; var height = height || 300; var quality = quality || 'high'; var wmode = wmode || 'opaque'; var content = '' + '' + '' + '' + '' + '' + '' + ''; var swfBody = document.getElementById(body); if(swfBody) { swfBody.innerHTML = content; } else { document.write(content); } } }; $(function(){ $("#cod").click(function(){ $(this).attr("src","./data/vdimgck.php?" + Math.random()); }) // $("input,textarea").not(".G_botton").each(function(){ // $(this).focus(function(){ // $(this).css("background","#F6F6F6"); // }).blur(function(){ // $(this).css("background","#FFF"); // }).hover(function(){ // $(this).css("background","#FAFAFA"); // },function(){ // $(this).css("background","#fff"); // }); // }); $(".borderLi").hover(function(){ $(this).css("border-bottom","1px solid #dedede"); $(this).css("color","#F00"); },function(){ $(this).css("border-bottom","1px dashed #dedede"); $(this).css("color","#000"); }); $("#leave_word").submit(function(){ if($.trim($("input[name='name']").val())==''){ alert("对不起,请填写您的姓名!"); $("input[name='name']").focus(); return false; }else if($.trim($("input[name='telephone']").val())==''){ alert("对不起,请填写您的联系电话!"); $("input[name='telephone']").focus(); return false; }else if($.trim($("input[name='address']").val())==''){ alert("对不起,请填写您的联系地址!"); $("input[name='address']").focus(); return false; }else if($.trim($("textarea").val())==''){ alert("对不起,请填写留言内容!"); $("textarea").focus(); return false; }else if($.trim($("input[name='checkCode']").val())==''){ alert("对不起,请填写验证码!"); $("input[name='checkCode']").focus(); return false; } }); $("#forTheJob").submit(function(){ var error = 0; $(".inputText,textarea").each(function(){ var val = $.trim($(this).val()); if(val==''){ alert("请认真填写您的信息,以便我们能更多的了解您!"); error++; $(this).focus(); return false; } }); if(error>0){ return false; $("input[error='0']").focus(); } }); $("#online_order").submit(function(){ if($.trim($("input[name='name']").val())==''){ alert("请填写您的姓名!"); $("input[name='name']").focus(); return false; }else if($.trim($("input[name='telephone']").val())==''){ alert("请填写您的联系电话!"); $("input[name='telephone']").focus(); return false; }else if($.trim($("input[name='address']").val())==''){ alert("请填写您的联系地址!"); $("input[name='address']").focus(); return false; }else if($.trim($("input[name='num']").val())==''){ alert("请填写您的订购数量!"); $("input[name='num']").focus(); return false; }else if($.trim($("input[name='checkCode']").val())==''){ alert("请填写验证码!"); $("input[name='checkCode']").focus(); return false; } if(!confirm("确定提交订单信息吗?")){ return false; } }); jQuery.extend({ FlashFont:function(obj){ //$(obj).css("color",$(obj).css("color")=="#297eae"?"#f00":"#297eae"); //$(obj).css("color",$(obj).css("color")=="rgb(41, 126, 174)"?"rgb(255, 0, 0)":"rgb(41, 126, 174)"); $(obj).css("color",$(obj).css("color")=="red"?"steelblue":"red"); } }); setInterval("$.FlashFont('#topPhone')",750); $("#nav_menu").hover(function(){ $(this).removeClass("nav").addClass("nav_hover"); $("#nav_menu_list").show(); },function(){ $(this).removeClass("nav_hover").addClass("nav"); $("#nav_menu_list").hide(); }); //HEADER SLIDE START $("#slide_bg").fadeTo('fast',0.3); var len = $("#idNum > ul > li").length; var index = 0; $("#idNum li").mouseover(function(){ index = $("#idNum li").index(this); showImg(index); }); //滑入 停止动画,滑出开始动画. $('#flashLeft').hover(function(){ if(MyTime){ clearInterval(MyTime); } },function(){ MyTime = setInterval(function(){ showImg(index) index++; if(index==len){index=0;} } , 2000); }); //自动开始 var MyTime = setInterval(function(){ showImg(index) if(index==0){++index;s=0;} else{ if(index0 && 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 check(fid){ console.log($("#"+fid+" #guest").val()); var name = $("#"+fid+" input[name='guest']").val(); var phone = $.trim($("#"+fid+" input[name='tel']").val()); var content = $("#"+fid+" #content").val(); var isMobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/; var isPhone = /^(?:(?:0\d{2,3})-)?(?:\d{7,8})(-(?:\d{3,}))?$/; if (name == '' || name==null) { alert('请填写您的姓名'); return false; } if(!name.match( /^[\u4E00-\u9FA5]{1,}$/) || name.length > 4){ alert('名字必须为4个字以内的汉字'); return false; } if (phone == '' || phone==null) { alert('请填写您的联系电话'); return false; } if (phone.substring(0, 1) == 1){ //如果为1开头则验证手机号码 if (!isMobile.exec(phone) && phone.length != 11) { alert('请输入正确的手机号码'); return false; } }else if(phone.substring(0, 1) == 0){ //如果为0开头则验证固定电话号码 if (!isPhone.test(phone)) { alert('请输入正确的固话号码'); return false; } }else { //否则全部不通过 alert('请不要胡乱输入'); return false; } if (content == '' || content==null) { alert('请输入您的需求'); return false; } if(content.toLowerCase().indexOf("http://") >= 0 ) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(content.toLowerCase().indexOf("https://") >= 0 ) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(content.toLowerCase().indexOf("www.") >= 0 ) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(content.toLowerCase().indexOf("script") >= 0 ) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(content.toLowerCase().indexOf(".js") >= 0 ) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(!isNaN(content)) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } if(content.length <5 || content.length > 200) { alert('需求内容不能含网址、不能为纯数字、长度要在5-200个汉字之间'); return false; } }