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()); }) $(".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; } } } } //