function paint_cirl(obj_default_class,obj_change_class,start_color,end_color,main_class){var ite=0;var te=setInterval(function(){ite++;if(ite>=112||ite>=111/$(main_class+" .sp1").text()*$(main_class+" .sp0").text()){clearInterval(te);} draw23(obj_change_class,ite,end_color)},10) draw23(obj_default_class,111,start_color);function draw23(id,ss,color){var canvas=document.getElementById(id);if(canvas==null){return false;} var ctx=canvas.getContext("2d");ctx.lineWidth=20;ctx.strokeStyle=color ctx.beginPath();ctx.arc($("#"+id).width()/2,$("#"+id).width()/2,($("#"+id).width()-40)/4,0,ss/20);ctx.stroke();}} function typing(textp){var num=0;$(textp).each(function(index,element){var text=$(this).text();$(this).attr("data",text).text("");otime=$(textp).eq(index).attr("data").length*58;num=num+otime;setTimeout(function(){abc($(textp).eq(index));},num-otime+1050);});function abc(obj){var strText=$(obj).attr("data");var i=0;var text="";var time=setInterval(function(){text=text+strText.substr(i,1) i++ $(obj).html(text) if(i>=strText.length){clearInterval(time);}},58)}} function hover_down_menu(oli_obj,showDiv){$(oli_obj).hover(function(){var ind=null;var j=10;var olen=$(this).find(showDiv).show().find("a").length;var ind=$(this).index();for(var i=0;i'+oHtml+'');$(oLi).eq(num).remove();te=-1;$(oLi).parent().css({"left":te+"px"});} te++;$(oLi).parent().css({"left":-te+"px"});}} function input_bd(obj_input,classN){$(obj_input).focus(function(){$(this).addClass(classN);}) $(obj_input).blur(function(){$(this).removeClass(classN);})} function zoom(){$(window).resize(function(){abtee();}) abtee() function abtee(){var wid=$(window).width();if(wid<1366){$("html").css("zoom","x.x");}else{$("html").removeAttr("style");}}} function radio_pic(obj){$(obj).click(function(){$(this).parent().find("i").removeClass("acti");$(this).find("i").addClass("acti");})} function auto_subMenu(obj,find_obj){$(obj).each(function(index,element){var sum=0;var otvel=0;var wit=parseInt($(this).find("a").css("paddingLeft"))*2;$(this).find("a").each(function(index,element){var suw=$(this).width() sum=sum+suw otvel=index+1});$(this).width(sum+otvel*wit);});} function dropmove(down,move,direction,obj_hei){$(move).mouseup(function(e){if(direction==1){var X=e.pageX-$(this).offset().left;$(this).find(".box").width(X);}else{var Y=e.pageY-$(this).offset().top;$(this).find(".box").height(obj_hei-Y);}}) $(down).mousedown(function(){$(move).mousemove(function(e){var t=$(this).offset().top;var lf=$(this).offset().left;if(direction==1){if(e.pageX-lf<=$(move).width()&&e.pageX-lf>0){$(this).find(".box").css("width",e.pageX-lf+"px");}}else{if(e.pageY-t<=$(move).height()&&e.pageY-t>0){$(this).find(".box").css("height",obj_hei-(e.pageY-t)+"px");} $(move).unbind("hover");}})}) $(move).mouseup(function(){$(move).unbind("mousemove");}) $(down).mouseup(function(){$(move).unbind("mousemove");}) $(move).hover(function(){},function(){$(move).unbind("mousemove");})} function enlarge(click_obj,cg_obj){$(click_obj).click(function(){var src=$(this).find("img").attr("src");$(cg_obj).attr("src",src);});} function CountDown(element,divtype){ShowCountDown();var tid=0;tid=setInterval(ShowCountDown,1000);function ShowCountDown() {var cc=$(element);var elem=$(element).find(".state");var arr=cc.attr("end-timer").split(":");var now=new Date();var endDate=new Date(arr[0],arr[1]-1,arr[2],arr[3],arr[4],arr[5]);var leftTime=endDate.getTime()-now.getTime();if(leftTime>0){var leftsecond=parseInt(leftTime/1000);var day1=Math.floor(leftsecond/(60*60*24));var hour=Math.floor((leftsecond-day1*24*60*60)/3600).toString();var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60).toString();var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60).toString();var hour=Math.floor((leftsecond-day1*24*60*60)/3600+24*day1).toString();if(day1<10)day1="0"+day1;if(hour<10)hour="0"+hour;if(minute<10)minute="0"+minute;if(second<10)second="0"+second;$(divtype+".t span.sp1").text(day1.substring(0,1));$(divtype+".t span.sp2").text(day1.substring(2,1));$(divtype+".s span.sp1").text(hour.substring(0,1));$(divtype+".s span.sp2").text(hour.substring(2,1));$(divtype+".f span.sp1").text(minute.substring(0,1));$(divtype+".f span.sp2").text(minute.substring(2,1));$(divtype+".m span.sp1").text(second.substring(0,1));$(divtype+".m span.sp2").text(second.substring(2,1));} else{clearInterval(tid);$(divtype+" span").text('0');}}} function slide_nav(obj,class_name,iname){$(obj).click(function(){if($(this).attr('opent')==="1"){$(this).parents('li').find(class_name).slideUp();$(this).find('i').removeClass(iname);$(this).attr('opent',"0");}else{$(obj).find("i").removeClass(iname);$(obj).parent().find(class_name).slideUp();$(this).parents('li').find(class_name).slideDown();$(this).find('i').addClass(iname);$(obj).attr('opent',"0");$(this).attr('opent',"1");}});} function shoutext(Oclick,Ofind){$(Oclick).click(function(){if($(this).attr("opent")=="1"){$(this).parent().find(Ofind).slideUp();$(Oclick).removeAttr("opent");}else{$(Oclick).removeAttr("opent");$(Oclick).parent().find(Ofind).slideUp();$(this).attr("opent","1").parent().find(Ofind).slideDown();}});} function numadd(obj,click_left,click_right){var i=1;$(click_left).click(function(){if(i>1){i--;$(this).parent().find("input").val(i);} if(i==1){$(this).addClass("noadd");}}) $(click_right).click(function(){i++;$(obj).removeClass("noadd");$(this).parent().find("input").val(i);});} function upimg(obj,append){$(obj).change(function(){$(append).append('
  • ');})} function alertbox(click_show,click_hide,obj){$(click_hide).click(function(){$(obj).fadeOut();}) $(click_show).click(function(){$(obj).fadeIn();})} function copy(click_obj){$(click_obj).click(function(){$(this).parents("li").find("textarea").select();document.execCommand("Copy");})} function newRoll(obj){var olent=$(obj).length;var j=0;var timter;for(var i=0;iolent-1)j=0;$(obj).each(function(index,element){var tp=parseInt($(this).css("top"));$(this).animate({"top":tp-$(obj).height()+"px"},500,function(){$(obj).eq(j-1).css("top",(olent-1)*$(obj).height()+"px")});});}} function myScroll(){var x=document.body.scrollTop||document.documentElement.scrollTop;var timer=setInterval(function(){x=x-15;if(x<100) {x=0;window.scrollTo(x,x);clearInterval(timer);} window.scrollTo(x,x);},"1");} function seamless(obj,next,prev,title,delay){var olent=$(obj).length;$(obj).each(function(index,element){$(this).animate({"left":index*$(this).width()+"px"})});var poi=0;$(next).click(function(){nextte();}) $(title).hover(function(){clearInterval(timer);},function(){timer=setInterval(nextte,delay);}) $(title).click(function(){poi=$(this).index();if(poi>=olent)poi=0;$(title).eq(poi).addClass("acti").siblings().removeClass("acti");$(obj).each(function(index,element){var left=parseInt($(this).css("left"))-$(this).width();$(this).stop().animate({"left":left+"px"},500,function(){$(obj).eq(poi-1).css("left",(olent-1)*$(this).width()+"px")});});}) timer=setInterval(nextte,delay);function nextte(){poi++;if(poi>=olent)poi=0;$(title).eq(poi).addClass("acti").siblings().removeClass("acti");$(obj).each(function(index,element){var left=parseInt($(this).css("left"))-$(this).width();$(this).stop().animate({"left":left+"px"},500,function(){$(obj).eq(poi-1).css("left",(olent-1)*$(this).width()+"px")});});} $(prev).click(function(){poi--;if(poi<0)poi=olent-1;$(obj).eq(poi).css("left",-$(obj).width()+"px");$(title).eq(poi).addClass("acti").siblings().removeClass("acti");$(obj).each(function(index,element){var left=parseInt($(this).css("left"))+$(this).width();$(this).stop().animate({"left":left+"px"},500,function(){});});})} function getFileUrl(sourceId){var url;if(navigator.userAgent.indexOf("MSIE")>=1){url=document.getElementById(sourceId).value;}else if(navigator.userAgent.indexOf("Firefox")>0){url=window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));}else if(navigator.userAgent.indexOf("Chrome")>0){url=window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));} return url;} function addInput(obj){$(obj).click(function(){if($(this).find("input[type='checkbox']").is(':checked')==true){$(this).find("input").addClass("check");}else{$(this).find("input").removeClass("check");}});};function checkbox(obj,findbel){$(obj).click(function(){if($(this).find("input[type='checkbox']").is(':checked')==true){$(this).find(findbel).show();}else{$(this).find(findbel).hide();}});} function cli_cgpic(obj){$(obj).click(function(){if($(this).attr("ter")=="1"){var path_img=$(this).find('img').attr('src');var new_path=path_img.replace("-1.",".");$(this).find('img').attr('src',new_path);$(this).attr("ter","0");}else{var path_img=$(this).find('img').attr('src');var new_path=path_img.replace(".","-1.");$(this).find('img').attr('src',new_path);$(this).attr("ter","1");}})} function checkPhone(){var phone=document.getElementById('phone').value;if(!(/^1[3|4|5|7|8]\d{9}$/.test(phone))){alert("手机号码有误,请重填");return false;}} function Countdown(obj,classname,num){$(obj).attr("value","1");var jte=num;var tee=null;$(obj).click(function(){if($(this).attr("value")=="1"){$(this).attr("value","0");$(this).addClass(classname);tee=setInterval(function(){jte--;if(jte<=0){$(obj).removeClass(classname).text('获取验证码');jte=num;clearInterval(tee);$(obj).attr("value","1");} $(obj+'.'+classname).text('重新发送('+jte+')');},1000);}})} function autotop(obj,ops,valt){var eft=0;setInterval(ett,3000);$(obj).css({"position":"absolute"}) var oelnt=$(obj).find('li').length;function ett(){eft++ if(eft>oelnt-1)eft=0;$(obj).animate({"top":-eft*ops+"px"},600);}} function cli_cgimg(obj){$(obj).click(function(){$(obj).each(function(index,element){var path_img=$(this).find('img').attr('src');var new_path=path_img.replace("-1.",".");$(this).find('img').attr('src',new_path);});var path_img=$(this).find('img').attr('src');var new_path=path_img.replace(".","-1.");$(this).find('img').attr('src',new_path);})} function click_cgimg(obj,index,imgname){$(obj).eq(index).click(function(){if($(this).attr('adimg')=="1"){$(this).attr('adimg','0');$(this).find('img').attr("src","img/"+imgname+".png");}else{$(this).find('img').attr("src","img/"+imgname+"-1.png");$(this).attr('adimg','1');}})} function click_addname(obj,className,allt){if(allt>0){$(obj).click(function(){$(obj).removeClass(className);$(this).addClass(className);})}else{$(obj).click(function(){$(this).addClass(className).siblings().removeClass(className);})}} function slideshow(click_show,obj_open,class_name){$(click_show).click(function(){if($(this).attr('true')=="1"){$(this).parent().find(obj_open).slideUp();$(this).removeClass(class_name);$(this).attr('true',"0");}else{$(this).parent().find(obj_open).slideDown();$(this).addClass(class_name);$(this).attr('true',"1");}})} function suspension(click_obj,move_obj,distance,className){$(click_obj).click(function(){if($(this).attr('open')=='1'){$(move_obj).animate({'right':-$(move_obj).width()-2+"px"},600,'swing');$(this).attr('open','0');$(this).removeClass(className);}else{$(this).addClass(className);$(move_obj).animate({'right':distance+"px"},600,'swing');$(this).attr('open','1');}})} function full_screen(number,click_left,click_right,click_cirl){var olen1=$(number).length;var timer=0;var bowidth1=$('body').width();$(number).parent().width(bowidth1*olen1+"px");var thinde1=0;$(number).css("width",bowidth1+"px");for(var j=0;j0){thinde1--;$(number).parent().animate({"left":-thinde1*bowidth1+"px"},600,"swing");}}) $(click_cirl).click(function(){thinde1=$(this).index();$(this).addClass('acti').siblings().removeClass('acti');$(number).parent().animate({"left":-thinde1*bowidth1+"px"},600,"swing");}) timer=setInterval(autocroll,3000);function autocroll(){thinde1++;if(thinde1>olen1-1)thinde1=0;$(click_cirl).eq(thinde1).addClass('acti').siblings().removeClass('acti');$(number).parent().animate({"left":-thinde1*bowidth1+"px"},600,"swing");} $(click_cirl).hover(function(){clearInterval(timer);},function(){timer=setInterval(autocroll,3000);})} function autobox(obj,oble,value,pase){lrauto();$(window).resize(function(){lrauto();}) function lrauto(){var bwidt=$("body").width();if(oble==0){$(obj).css({left:(bwidt-value)/2+pase+"px"});}else{if(oble==1){$(obj).css({right:(bwidt-value)/2+pase+"px"})} else{alert('第二个传值出错!0是左 1是右');}}}} function Cutimg(obj){autoimg() $(window).resize(function(){autoimg()}) function autoimg(){var widt=$(obj).parent().width();var heit=$(obj).parent().height();var img_wid=$(obj).width();var img_hei=$(obj).height();$(obj).css({"left":(widt-img_wid)/2+"px","top":(heit-img_hei)/2+"px","position":"absolute"});$(obj).parent().css({"position":"relative","overflow":"hidden"});}} function eject(hover_obj,hide_obj){$(hide_obj).hide();$(hover_obj).hover(function(){$(hide_obj).hide();$(hide_obj).eq($(this).index()).show();}) $(hide_obj).parent().hover(function(){},function(){$(hide_obj).fadeOut();})} function replaimg(obj){$(obj).hover(function(){var path_img=$(this).find('img').attr('src');var new_path=path_img.replace(".","-1.");$(this).find('img').attr('src',new_path);},function(){var path_img=$(this).find('img').attr('src');var new_path=path_img.replace("-1.",".");$(this).find('img').attr('src',new_path);})} function scrollTop(obj_fixed,ClassName,value){value=$(obj_fixed).offset().top;$(window).scroll(function(){var valt=$(window).scrollTop();var top=$(obj_fixed).offset().top;if(value==1){value=top;} if(valt>value){$(obj_fixed).addClass(ClassName);}else{$(obj_fixed).removeClass(ClassName);}})} function tabs_cg(Oobj,Otabch,event,ClassName,Find,level){if(level==1){$(Oobj)[event](function(){var t=$(this).index();$(this).addClass(ClassName).siblings().removeClass(ClassName);$(this).parents(Otabch).find(Find).eq(t).show().siblings().hide();});}else{$(Otabch).hide();$(Otabch).first().show();$(Oobj)[event](function(){$(this).addClass(ClassName).siblings().removeClass(ClassName);$(Otabch).hide() $(Otabch).eq($(this).index()).show();})}} function two_scroll(number,cli_left,cli_right,click_cirl,textp,ovalue,ots,ohei){var olit=$(number).length;ots=parseInt($(number).parent().parent().width()/$(number).width());ovalue=$(number).width()+parseInt($(number).css("margin-left"))+parseInt($(number).css("border-left-width"))+parseInt($(number).css("border-right-width"));if(ohei){$(number).parent().css({"width":ovalue*olit+"px","position":"absolute"}).parent().css({"position":"relative","overflow":"hidden","height":ohei});}else{$(number).parent().css({"width":ovalue*olit+"px","position":"absolute"}).parent().css({"position":"relative","overflow":"hidden","height":$(number).height()});} var objscr=$(number).parent() var j=0;var setotimer=null;setotimer=setInterval(orcroauto,3000);$(cli_left).hover(function(){clearInterval(setotimer);},function(){setotimer=setInterval(orcroauto,3000);}) $(cli_right).hover(function(){clearInterval(setotimer);},function(){setotimer=setInterval(orcroauto,3000);}) $(click_cirl).hover(function(){clearInterval(setotimer);},function(){setotimer=setInterval(orcroauto,3000);}) $(cli_left).click(function(){j--;if(j<0){j=olit-ots} $(objscr).stop().animate({"left":-j*ovalue+"px"},600,"swing");$(click_cirl).eq(j).addClass('acti').siblings().removeClass('acti');$(textp).animate({"top":-j*$(textp).parent().height()+"px"});}) $(cli_right).click(function(){orcroauto();}) $(click_cirl).click(function(){j=$(this).index();$(objscr).stop().animate({"left":-j*ovalue+"px"},600,"swing");$(this).addClass('acti').siblings().removeClass('acti');$(textp).animate({"top":-j*$(textp).parent().height()+"px"});}) function orcroauto(){j++;if(j>olit-ots){j=0} $(objscr).stop().animate({"left":-j*ovalue+"px"},600,"swing");$(click_cirl).eq(j).addClass('acti').siblings().removeClass('acti');$(textp).animate({"top":-j*$(textp).parent().height()+"px"});}} function down_drop(a,b,c){$(a).click(function(){var text=$(this).text();$(this).parent().parent().find('input').val(text);$(this).parent().hide();}) $(b).click(function(){$(this).parent().find(c).show();}) $(a).parent().parent().hover(function(){},function(){$(this).find(c).hide();})} function fade(banner,cirl,timer,click_left,click_right){var i=0;var Otimer=null;var olen=$(banner).length;$(banner).css("opacity","0");$(banner).eq(i).css("zIndex","1").animate({"opacity":"1"},600,'swing');$(cirl).click(function(){$(this).addClass('acti').siblings().removeClass('acti');i=$(this).index();$(banner).eq(i).css("zIndex","1").animate({"opacity":"1"},600,'swing').siblings().css("zIndex","0").animate({"opacity":"0"},600,'swing');}) Otimer=setInterval(bann_auto,timer);function bann_auto(){i++;if(i>olen-1)i=0;$(cirl).eq(i).addClass('acti').siblings().removeClass('acti');$(banner).eq(i).css("zIndex","1").animate({"opacity":"1"},600,'swing').siblings().css("zIndex","0").animate({"opacity":"0"},600,'swing');} $(cirl).hover(function(){clearInterval(Otimer);},function(){Otimer=setInterval(bann_auto,timer);}) $(click_left).hover(function(){clearInterval(Otimer);},function(){Otimer=setInterval(bann_auto,timer);}) $(click_right).hover(function(){clearInterval(Otimer);},function(){Otimer=setInterval(bann_auto,timer);}) $(click_left).click(function(){i--;if(i<0)i=olen-1;$(cirl).eq(i).addClass('acti').siblings().removeClass('acti');$(banner).eq(i).css("zIndex","1").animate({"opacity":"1"},600,'swing').siblings().css("zIndex","0").animate({"opacity":"0"},600,'swing');}) $(click_right).click(function(){bann_auto();})}