/* pageadmin基础函数/方法 */ function id(id) {return document.getelementbyid(id);} function trim(str) {return str.replace(/(^\s*)|(\s*$)/g,"");} //去除首尾空格 function ltrim(str){return str.replace(/(^\s*)/g, "");} //去除左空格 function rtrim(str) {return str.replace(/(\s*$)/g, "");} // 去除右空格 function length(str) //获取字符长度,汉字占2个字节 { str=str.replace(/[^\x00-\xff]/g,"**") return str.length; } function left(str,len) //左边截取字段数 { if (isnan(len) || len == null) { len = str.length; } else { if (parseint(len) < 0 || parseint(len) > str.length) { len = str.length; } } return str.substr(0, len); } function right(str,len) //右边截取字段数 { if (isnan(len) || len == null) { len = str.length; } else { if (parseint(len) < 0 || parseint(len) > str.length) { len = str.length; } } return str.substring(str.length-len,str.length); } function request(paras,url) //获取url中参数 { if(url==null){url=location.href;} var parastring = url.substring(url.indexof("?")+1,url.length).split("&"); var paraobj={} for (i=0;j=parastring[i]; i++) { paraobj[j.substring(0,j.indexof("=")).tolowercase()] = j.substring(j.indexof("=")+1,j.length); } var returnvalue = paraobj[paras.tolowercase()]; if(typeof(returnvalue)=="undefined") { return ""; } else { return decodeuri(returnvalue); } } function isstr(str) //是否由数字、字母和下划线组成 { if(trim(str)==""){return false;} return (str.replace(/\w/g,"").length==0); } function islstr(str) //是否由数字、字母和下划线组成 字母开头 { if(trim(str)==""){return false;} var reg = /^[a-za-z][a-za-z0-9_]*$/; if(reg.test(str)) return true; else return false; } function isnum(str) //是否是数值,包括正负数,小数 { if(trim(str)==""){return false;} if(isnan(str)){return false;} else{return true;} } function isusername(str) //由数字、字母和下划线汉字组成 { if(trim(str)==""){return false;} str=str.replace(/[^\x00-\xff]/g,""); if(str==""){return true;} else{return isstr(str);} } function isnumeric(str,flag) //验证数值类型 { if(trim(str)==""){return false;} if(isnan(str)){return false;} switch (flag) { case "+": //正数 return /(^\+?|^\d?)\d*\.?\d+$/.test(str); case "-": //负数 return /^-\d*\.?\d+$/.test(str); case "i": //整数 return /(^-?|^\+?|\d)\d+$/.test(str); case "+i": //正整数 return /(^\d+$)|(^\+?\d+$)/.test(str); case "-i": //负整数 return /^[-]\d+$/.test(str); case "f": //浮点数 return /(^-?|^\+?|^\d?)\d*\.\d+$/.test(str); case "+f": //正浮点数 return /(^\+?|^\d?)\d*\.\d+$/.test(str); case "-f": //负浮点数 return /^[-]\d*\.\d$/.test(str); default: //缺省 return true; } } function digit(str) //只保留数字 { return str.replace(/\d/g, ""); } function isdigit(str) //检测是否是数字 { if(trim(str)==""){return false;} return (str.replace(/\d/g, "").length==0); } function isstrdigit(str) //是否由数字、字母组成 { if(trim(str)==""){return false;} var reg = /^[a-za-z0-9]+$/g; return reg.test(str); } function strdigit(str) //只保留数字、字母部分 { return str.replace(/[\w]/g, ''); } function chinese(str) //只保留汉字 { return (str.replace(/[^\u4e00-\u9fa5]/g, '')); } function includechinese(str) //是否包含汉字 { return (str.length != str.replace(/[^\x00-\xff]/g, "**").length); } function ischinese(str) //是否为汉字 { //[\u4e00-\u9fa5]为汉字,[\ufe30-\uffa0]为全角符号 if(trim(str)==""){return false;} return /^[^\x00-\xff]*$/.test(str); } function isdate(str) { if(trim(str)==""){return false;} var reg1=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/; var reg2=/^(\d{1,2})\/(\d{1,2})\/(\d{4}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/; var reg3=/^(\d{1,2})\/(\d{1,2})\/(\d{4}) (\d{1,2}):(\d{1,2}):(\d{1,2}) ([a-za-z]{0,2})$/; var reg4=/^(\d{4})-(\d{1,2})-(\d{1,2})$/; var reg5=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/; if(!reg1.test(str) && !reg2.test(str) && !reg3.test(str) && !reg4.test(str) && !reg5.test(str)) { return false; } return true; } function ismobile(mobile) { if(mobile.length!=11){return false;} var myreg = /^((1[3458])+\d{9})$/; if(!myreg.test(mobile)){return false;} return true; } function isemail(str) { var pattern =/^([a-za-z0-9]+[_|\_|\.]?)*[a-za-z0-9]+@([a-za-z0-9]+[_|\_|\.]?)*[a-za-z0-9]+\.[a-za-z]{2,3}$/ var flag=pattern.test(trim(str)); if (!flag) { return false; } else { return true; } } function isip() { var respacecheck = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/; if (respacecheck.test(str)) { str.match(respacecheck); if (regexp.$1 <= 255 && regexp.$1 >= 0 && regexp.$2 <= 255 && regexp.$2 >= 0 && regexp.$3 <= 255 && regexp.$3 >= 0 && regexp.$4 <= 255 && regexp.$4 >= 0) { return true; } else { return false; } } else { return false; } } function iscontains(str,arrstr) { if(trim(str)==""){return false;} for(var i=0;i 2) ? argv[2] : null;//第三个参数为过期时间 if(expires!=null) { var largeexpdate = new date (); //largeexpdate.settime(largeexpdate.gettime() + (expires*1000*60*60*24));//expires为过期天数 largeexpdate.settime(largeexpdate.gettime() + (expires*1000)); //expires为过期秒数值 } document.cookie = name + "=" + escape (value)+((expires == null) ? "" : (";expires=" +largeexpdate.togmtstring()+";path=/")); } function getcookie(name)//cookies读取 { var search = name + "=" if(document.cookie.length > 0) { offset = document.cookie.indexof(search) if(offset != -1) { offset += search.length end = document.cookie.indexof(";", offset) if(end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } else return "" } } function delcookie(name)//删除cookie { var exp = new date(); exp.settime(exp.gettime() - 1); var cval = getcookie(name); if (cval != null) document.cookie = name + "=" + escape (value)+((expires == null) ? "" : (";expires=" +exp.togmtstring()+";path=/")); } function urlencode(str) { return encodeuricomponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g,'%29').replace(/\*/g,'%2a').replace(/%20/g,'+'); } function showitem(id,url) { var obj=document.getelementbyid(id); if(url!="#" || obj==null) { return; } if(obj.style.display=="none") { obj.style.display=""; } else { obj.style.display="none"; } } function removehtml(str) //删除html标签 { var temp = document.createelement("div"); temp.innerhtml =str; var output = temp.innertext || temp.textcontent; temp = null; return output; } function getbrowser() //获取浏览器类型 { if (navigator.useragent.indexof('msie') > -1) return 'msie'; if (navigator.useragent.indexof('firefox') > -1) return 'firefox'; if (navigator.useragent.indexof("safari") > 0) return 'safari'; if (navigator.useragent.indexof("camino") > 0) return 'camino'; if (navigator.useragent.indexof("gecko/") > 0) return 'gecko'; if (navigator.useragent.indexof('opera') > -1) return 'opera'; return 'other'; } function delobj(objname) //删除标签 { var obj = document.getelementbyid(objname); if (obj != undefined) { obj.parentnode.removechild(obj); } obj = null; } function hasclass(obj,cls){return obj.classname.match(new regexp('(\\s|^)' + cls + '(\\s|$)'));} function addclass(obj,cls) {if(!this.hasclass(obj, cls)) obj.classname += " " + cls;} function removeclass(obj,cls){if(hasclass(obj, cls)){var reg = new regexp('(\\s|^)' + cls + '(\\s|$)');obj.classname = obj.classname.replace(reg, ' ');}} function replaceall(str,str1,str2) { while(str.indexof(str1)>= 0) { str=str.replace(str1,str2); } return str; } function ischecked(obj) //检测radid或checkbox是否有选择 { var k=0; for(k=0;k 0) { flag = false; break; } } return flag; } //ajax插件 paajax = function(){ var http_request = false; var result = ""; var method = "get"; var anc = true; this.setarg = function(m, a){//a=false表示顺序同步加载 method = (m == "get") ? "get" : "post"; anc = (a) ? true : false; } this.init = function(){ http_request = false; if (window.xmlhttprequest) { // mozilla, safari,... http_request = new xmlhttprequest(); } else if (window.activexobject) { // ie try { http_request = new activexobject("msxml2.xmlhttp"); } catch (e) { try { http_request = new activexobject("microsoft.xmlhttp"); } catch (e) { alert("can't creat ajax object!"); return false; } } } } this.send = function(url,sendcontent,callback){ this.init(); var ajaxstatechange= function(){ if (http_request.readystate == 4) { if (http_request.status == 200) { result = http_request.responsetext; try{ callback(result); } catch (e) { alert("the callback method wrong!" + e); return false; } } else { if(http_request.status!=0) { alert("ajax出现http"+http_request.status+"错误") } return false; } } }; http_request.onreadystatechange=ajaxstatechange; if (method == "get") { http_request.open('get', url+"?"+sendcontent, anc); http_request.send(null); } else { http_request.open('post', url, anc); http_request.setrequestheader("content-type", "application/x-www-form-urlencoded"); http_request.send(sendcontent); } } } /*滚动插件 使用方法:var marquee=new marquee("对象id","direction",step,width,height,timer,delaytime,scrollstep,waittime); 参数说明: id "marquee" 容器id (必选) direction (left) 滚动方向 (可选,默认为left向左滚动,可设置的值包括:"top","bottom","left","right") step (1) 滚动的步长 (可选,默认值为1,数值越大,滚动越快) width (760) 容器可视宽度 (可选,默认值为容器初始设置的宽度) height (52) 容器可视高度 (可选,默认值为容器初始设置的高度) timer (50) 定时器 (可选,默认值为30,数值越小,滚动的速度越快,1000=1秒,建议不小于20) delaytime (5000) 间歇停顿延迟时间(可选,默认为0不停顿,1000=1秒) scrollstep (52) 间歇滚动间距 (可选,默认为翻屏宽/高度,该数值与延迟均为0则为鼠标左右滑动悬停控制(效果不是很好),-1禁止鼠标控制) waittime (3000) 开始时的等待时间(可选,默认或0为不等待,1000=1秒) */ function marquee() { this.id=document.getelementbyid(arguments[0]);if(!this.id){alert("\""+arguments[0]+"\"初始化错误\r\n请检查标签id设置是否正确!");this.id=-1;return;}this.width=this.height=this.delaytime=this.waittime=this.ctl=this.startid=this.stop=this.mouseover=0;this.direction="left";this.step=1;this.timer=30;if(typeof arguments[1]=="number"||typeof arguments[1]=="string"){this.direction=arguments[1];}if(typeof arguments[2]=="number"){this.step=arguments[2];}if(typeof arguments[3]=="number"){this.width=arguments[3];}if(typeof arguments[4]=="number"){this.height=arguments[4];}if(typeof arguments[5]=="number"){this.timer=arguments[5];}if(typeof arguments[6]=="number"){this.delaytime=arguments[6];}if(typeof arguments[7]=="number"){this.scrollstep=arguments[7];}if(typeof arguments[8]=="number"){this.waittime=arguments[8];}this.id.style.overflow=this.id.style.overflowx=this.id.style.overflowy="hidden";this.id.nowrap=true;this.isnotopera=(navigator.useragent.tolowercase().indexof("opera")==-1);if(arguments.length>=1){this.start();} } marquee.prototype.start = function() { if(this.id==-1)return;if(this.waittime<800)this.waittime=800;if(this.timer<1)this.timer=1; if(this.width==0) { if(this.id.style.width.indexof("px")>0){this.width = parseint(this.id.style.width);}else{this.width = parseint(this.id.offsetwidth);} } if(this.height==0) { if(this.id.style.height.indexof("px")>0){this.height = parseint(this.id.style.height);}else{this.height =parseint(this.id.offsetheight);} } this.halfwidth=math.round(this.width/2);this.halfheight=math.round(this.height/2);this.bakstep=this.step;if(this.width>0){this.id.style.width=this.width+"px";}if(this.height>0){this.id.style.height=this.height+"px";}if(typeof this.scrollstep!="number")this.scrollstep=(this.direction=="left" || this.direction=="right")?this.width:this.height;var templateleft="
msclass_temp_htmlmsclass_temp_html
";var templatetop="
msclass_temp_html
msclass_temp_html
";var msobj=this;msobj.temphtml=msobj.id.innerhtml;if(msobj.direction=="top" || msobj.direction=="bottom"){msobj.id.innerhtml=templatetop.replace(/msclass_temp_html/g,msobj.id.innerhtml);}else{msobj.id.innerhtml=templateleft.replace(/msclass_temp_html/g,msobj.id.innerhtml);} var timer = this.timer;var delaytime = this.delaytime;var waittime = this.waittime;msobj.startid = function(){msobj.scroll()} msobj.continue = function(){if(msobj.mouseover==1){settimeout(msobj.continue,delaytime);}else{clearinterval(msobj.timerid);msobj.ctl=msobj.stop=0;msobj.timerid=setinterval(msobj.startid,timer);}} msobj.pause = function(){msobj.stop = 1;clearinterval(msobj.timerid);settimeout(msobj.continue,delaytime);} msobj.begin = function() { msobj.clientscroll = (msobj.direction=="left" || msobj.direction=="right")? msobj.id.scrollwidth / 2 : msobj.id.scrollheight / 2; if(((msobj.direction=="top" || msobj.direction=="bottom") && msobj.clientscroll <= msobj.height + msobj.step) || ((msobj.direction=="left" || msobj.direction=="right") && msobj.clientscroll <= msobj.width + msobj.step)) {msobj.id.innerhtml = msobj.temphtml;delete(msobj.temphtml);return;} delete(msobj.temphtml); msobj.timerid = setinterval(msobj.startid,timer); if(msobj.scrollstep < 0)return; msobj.id.onmousemove = function(event){if(msobj.scrollstep==0&&(msobj.direction=="left" || msobj.direction=="right")){var event=event||window.event;if(window.event){if(msobj.isnotopera){msobj.eventleft=event.srcelement.id==msobj.id.id?event.offsetx-msobj.id.scrollleft:event.srcelement.offsetleft-msobj.id.scrollleft+event.offsetx;}else{msobj.scrollstep=null;return;}}else{msobj.eventleft=event.layerx-msobj.id.scrollleft;}msobj.direction=msobj.eventleft>msobj.halfwidth?"right":"left";msobj.abscenter=math.abs(msobj.halfwidth-msobj.eventleft);msobj.step=math.round(msobj.abscenter*(msobj.bakstep*2)/msobj.halfwidth);}} msobj.id.onmouseover = function(){if(msobj.scrollstep == 0)return;msobj.mouseover = 1;clearinterval(msobj.timerid);} msobj.id.onmouseout = function(){if(msobj.scrollstep==0){if(msobj.step==0)msobj.step=1;return;}msobj.mouseover=0;if(msobj.stop==0){clearinterval(msobj.timerid);msobj.timerid=setinterval(msobj.startid,timer);}} } settimeout(msobj.begin,waittime);} marquee.prototype.scroll=function(){ switch(this.direction){case "top":this.ctl+=this.step;if(this.ctl>=this.scrollstep&&this.delaytime>0){this.id.scrolltop+=this.scrollstep+this.step-this.ctl;this.pause();return}else{if(this.id.scrolltop>=this.clientscroll){this.id.scrolltop-=this.clientscroll}this.id.scrolltop+=this.step}break;case "bottom":this.ctl+=this.step;if(this.ctl>=this.scrollstep&&this.delaytime>0){this.id.scrolltop-=this.scrollstep+this.step-this.ctl;this.pause();return}else{if(this.id.scrolltop<=0){this.id.scrolltop+=this.clientscroll}this.id.scrolltop-=this.step}break;case "left":this.ctl+=this.step;if(this.ctl>=this.scrollstep&&this.delaytime>0){this.id.scrollleft+=this.scrollstep+this.step-this.ctl;this.pause();return}else{if(this.id.scrollleft>=this.clientscroll){this.id.scrollleft-=this.clientscroll}this.id.scrollleft+=this.step}break;case "right":this.ctl+=this.step;if(this.ctl>=this.scrollstep&&this.delaytime>0){this.id.scrollleft-=this.scrollstep+this.step-this.ctl;this.pause();return}else{if(this.id.scrollleft<=0){this.id.scrollleft+=this.clientscroll}this.id.scrollleft-=this.step}break} } //tab封装 function tabs(tid,cid,tag1,tag2,addclass,theevent) { if(arguments.length==3){theevent=arguments[2];tag1="dd";tag2=tag1;addclass="current";} var defaultindex=0,checknav="",checkwrap=""; var o1=document.getelementbyid(tid),o2=document.getelementbyid(cid),elementnav=new array();elementwrap=new array(); chk=function(e,n){var v=eval("/"+n+"/gi");if(v==undefined){return true}else if(v.test(e.classname)){return true};} function ser(e,arr,g,n,t) { var tags=e.getelementsbytagname(g),v=0; for(i=0;i=alldistance*2 || scrolledlength<=0) { $inner.scrollleft(alldistance); } } else { scrolledlength=$inner.scrolltop(); if(scrolledlength>=alldistance*2 || scrolledlength<=0) { $inner.scrolltop(alldistance); } } } var it=setinterval(function(){scroll(direction);},itimes); $boxid.mouseenter(function(){ clearinterval(it); }); $boxid.mouseleave(function(){ it=setinterval(function(){scroll(direction);},itimes); }); } //js幻灯片 function slide_focus(id,slidestyle,itimes,width,height,isbanner) { var $obj_slide=$("#"+id); if($obj_slide.size()=="0"){return;} var $obj_slide_inner=$obj_slide.children(".inner"); if($obj_slide_inner.size()=="0"){return;} var autowidth=0; var o_width=width; //原始宽度 var o_height=height; //原始高度 //var slidestyle=slidestyle; //0:显隐变换,1:左右轮换,2:上下轮换 itimes=itimes*1000; //轮换时间 var $prev=$obj_slide.children("a.prev"); var $next=$obj_slide.children("a.next"); var $zxt_p=$obj_slide.children(".slide_focus_zdycontent").children("p"); var $li=$obj_slide_inner.children("li"); var nums=$li.size(); if(nums>1) { $obj_slide_inner.prepend("
  • "+$li.eq(nums-1).html()+"
  • "); $obj_slide_inner.append("
  • "+$li.eq(0).html()+"
  • "); nums+=2; $li=$obj_slide_inner.children("li"); } var $img=$li.children("a").children("img"); if(nums==0){return;} var parentwidth=$obj_slide.parent().width(); function autosize() //没有设置尺寸时候自动适应 { width=$obj_slide.parent().width(); o_width=width; var imgwidth=$img.eq(0).width(); var imgheight=$img.eq(0).height(); height=math.round(imgheight*(width/imgwidth)); o_height=height; } if(width==0) { autosize(); autowidth=1; } var startleft=0; var panelhtml=""; for(i=0;i"; } panelhtml="
    "+panelhtml+"
    "; $obj_slide_inner.before(panelhtml); var $panel=$obj_slide.children(".panel"); var $baritem=$panel.children("span"); if(nums<2) { $panel.hide(); } else { $baritem.eq(0).hide(); $baritem.eq(nums-1).hide(); } function setsize() //设置标签,图片等尺寸 { $obj_slide.css({"height":height+"px"}); if(!isbanner || autowidth==1) { $obj_slide.css({"width":width+"px"}); } $obj_slide_inner.css({"height":height+"px"}); $li.css({"height":height+"px"}); $img.css({"height":height+"px","width":width+"px"}); if(isbanner) { if(slidestyle!=1) { $li.css({"width":width+"px"}); $obj_slide_inner.css({"width":width*(nums)+"px"}); } $panel.css({"margin-left":-1*($panel.css('width').replace("px","")/2)+5+"px"}) } if(slidestyle==1) { $li.css({"width":width+"px"}); $obj_slide_inner.css({"width":width*(nums)+"px"}); $li.addclass("zy_move"); } else if(slidestyle==2) { $obj_slide_inner.css({"position":"absolute","height":"auto"}); $li.addclass("sx_move"); } } setsize(); var currentnum=0; var $titbar=$obj_slide.children(".titbar"); function resize() //屏幕大小改变修正位置 { parentwidth=$obj_slide.parent().width(); if(width0){startleft=0;} $obj_slide_inner.css({"margin-left":startleft+"px"}); } } resize(); function goto(num) //直接移动 { $baritem.eq(currentnum).removeclass("current"); $baritem.eq(num).addclass("current"); if($li.eq(num).children("a").children("em").html()!="") { $titbar.show(); $titbar.children("em").html($li.eq(num).children("a").children("em").html()); } if(slidestyle==0) { $li.eq(num).addclass("current").show().siblings().removeclass("current").hide(); } else if(slidestyle==1) { $obj_slide_inner.css('marginleft',(-1*num*width)+startleft+'px'); } else { $obj_slide_inner.css("top",(-1*num*height)+'px'); } currentnum=num; } if(nums>1) { currentnum=1; goto(1); } else { currentnum=0; goto(0); } var psize=$zxt_p.size(); if(psize>0) { $zxt_p.eq(0).show(); $zxt_p.eq(0).find(".delay").show(); } var currtxtobj; function showtxt(num) { if(nums==1 || psize==1) { $zxt_p.eq(0).show(); return; } if(psize==0){return;} var showp_num=num-1; if(showp_num<0) { showp_num=psize-1; } if(num==(nums-1)) { showp_num=0; } if(showp_num>=(psize-1)) { showp_num=psize-1; } currtxtobj=$zxt_p.eq(showp_num); var delayobj=currtxtobj.find(".delay"); var prev_txtobj=currtxtobj.siblings(":visible"); var effect=math.round(math.random()*3); var effectlength="50px"; if(effect==0) { currtxtobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); delayobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); prev_txtobj.animate({marginleft:"-="+effectlength,opacity:"0"},"normal",function(){ $(this).find(".delay").hide(); $(this).hide().animate({marginleft:"+="+effectlength,opacity:"1"}); currtxtobj.show().animate({marginleft:"+="+effectlength,opacity:"1"},"normal",function(){ delayobj.show().animate({marginleft:"+="+effectlength,opacity:"1"}) }); }); } else if(effect==1) { currtxtobj.animate({margintop:"-="+effectlength,opacity:"0"},0); delayobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); prev_txtobj.animate({margintop:"-="+effectlength,opacity:"0"},"normal",function(){ $(this).find(".delay").hide(); $(this).hide().animate({margintop:"+="+effectlength,opacity:"1"}); currtxtobj.show().animate({margintop:"+="+effectlength,opacity:"1"},"normal",function(){ delayobj.show().animate({marginleft:"+="+effectlength,opacity:"1"}) }); }); } else if(effect==2) { currtxtobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); delayobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); prev_txtobj.animate({marginleft:"+="+effectlength,opacity:"0"},"normal",function(){ $(this).find(".delay").hide(); $(this).hide().animate({marginleft:"-="+effectlength,opacity:"1"}); currtxtobj.show().animate({marginleft:"+="+effectlength,opacity:"1"},"normal",function(){ delayobj.show().animate({marginleft:"+="+effectlength,opacity:"1"}) }); }); } else { currtxtobj.animate({margintop:"-="+effectlength,opacity:"0"},0); delayobj.animate({marginleft:"-="+effectlength,opacity:"0"},0); prev_txtobj.animate({margintop:"+="+effectlength,opacity:"0"},"normal",function(){ $(this).find(".delay").hide(); $(this).hide().animate({margintop:"-="+effectlength,opacity:"1"}); currtxtobj.show().animate({margintop:"+="+effectlength,opacity:"1"},"normal",function(){ delayobj.show().animate({marginleft:"+="+effectlength,opacity:"1"}) }); }); } } function shownum(num) { if(typeof(currtxtobj)!="undefined") { currtxtobj.stop(true,true); } if(num<0){num=nums-1;} if(num>(nums-1)){num=0;} $baritem.eq(currentnum).removeclass("current"); $titbar.children("em").html($li.eq(num).children("a").children("em").html()); showtxt(num); if(slidestyle==0) { $li.eq(currentnum).removeclass("current"); $li.eq(num).addclass("current").fadein("normal",function(){$(this).siblings().hide();if(nums>1){if(num==(nums-1)){goto(1);}else if(num==0){goto(nums-2);}}}); } else if(slidestyle==1) { $obj_slide_inner.animate({marginleft:(-1*num*width)+startleft+'px'},"normal",function(){if(nums>1){if(num==(nums-1)){goto(1);}else if(num==0){goto(nums-2);}}}); } else { $obj_slide_inner.animate({top:(-1*num*height)+'px'},"normal",function(){if(nums>1){if(num==(nums-1)){goto(1);}else if(num==0){goto(nums-2);}}}); } currentnum=num; $baritem.eq(currentnum).addclass("current"); if(nums>1) { if(num==(nums-1)){$baritem.eq(1).addclass("current");} else if(num==0){$baritem.eq(nums-2).addclass("current");} } } $prev.bind("click",function(){ shownum(currentnum-1); }); $next.bind("click",function(){ shownum(currentnum+1); }); $baritem.each(function(i){ $(this).unbind("mouseenter").mouseenter(function(){ $li.stop(true); $obj_slide_inner.stop(true); $li.eq(currentnum).stop(true,true); shownum(i); }); }); var it=setinterval(function(){shownum(currentnum+1)},itimes); $obj_slide.mouseenter(function(){ clearinterval(it); if(nums>1 && isbanner) { $prev.show(); $next.show(); } }); $obj_slide.mouseleave(function(){ it=setinterval(function(){shownum(currentnum+1)},itimes); if(nums>1 && isbanner) { $prev.hide(); $next.hide(); } }); $(window).resize(function(){ if(autowidth==1) { autosize(); setsize(); } else if(isbanner) { resize(); } goto(currentnum); }); if(!ispc()) { function shownum_formobile(num) { if(num<0){return;} if(num>(nums-1)){return;} clearinterval(it); shownum(num); } $obj_slide.touch({ left: function() {shownum_formobile(currentnum+1);}, right: function() {shownum_formobile(currentnum-1)}, up: function() {}, down: function() {}, min_x: 40, min_y: 40 }); } } if(!ispc()){document.write("");}