function marquee()
{this.id=document.getelementbyid(arguments[0]);if(!this.id)
{alert("您要设置的\""+arguments[0]+"\"初始化错误\r\n请检查标签id设置是否正确!");this.id=-1;return;}
this.direction=this.width=this.height=this.delaytime=this.waittime=this.ctl=this.startid=this.stop=this.mouseover=0;this.step=1;this.timer=30;this.directionarray={"top":0,"up":0,"bottom":1,"down":1,"left":2,"right":3};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.waittime=arguments[7];if(typeof arguments[8]=="number")this.scrollstep=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>=7)this.start();}
marquee.prototype.start=function()
{if(this.id==-1)return;if(this.waittime<800)this.waittime=800;if(this.timer<20)this.timer=20;if(this.width==0)this.width=parseint(this.id.style.width);if(this.height==0)this.height=parseint(this.id.style.height);if(typeof this.direction=="string")this.direction=this.directionarray[this.direction.tostring().tolowercase()];this.halfwidth=math.round(this.width/2);this.halfheight=math.round(this.height/2);this.bakstep=this.step;this.id.style.width=this.width+"px";this.id.style.height=this.height+"px";if(typeof this.scrollstep!="number")this.scrollstep=this.direction>1?this.width:this.height;var templateleft="
msclass_temp_html | msclass_temp_html |
";var templatetop="msclass_temp_html |
msclass_temp_html |
";var msobj=this;msobj.temphtml=msobj.id.innerhtml;if(msobj.direction<=1)
{msobj.id.innerhtml=templatetop.replace(/msclass_temp_html/g,msobj.id.innerhtml);}
else
{if(msobj.scrollstep==0&&msobj.delaytime==0)
{msobj.id.innerhtml+=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>1?msobj.id.scrollwidth/2:msobj.id.scrollheight/2;if((msobj.direction<=1&&msobj.clientscroll<=msobj.height+msobj.step)||(msobj.direction>1&&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>1)
{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?3:2;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 0: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 1: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 2: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 3: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;}}
//图片滚动列表 mengjia 070927
var speed_1 = 10; //速度(毫秒)
var space_1 = 20; //每次移动(px)
var pagewidth_1 = 190*6; //翻页宽度
var interval_1 = 3000; //翻页间隔时间
var fill_1 = 1; //整体移位
var movelock_1 = false;
var movetimeobj_1;
var moveway_1="right";
var comp_1 = 0;
var autoplayobj_1=null;
function getobj(objname){if(document.getelementbyid){return eval('document.getelementbyid("'+objname+'")')}else{return eval('document.all.'+objname)}}
function autoplay_1(){clearinterval(autoplayobj_1);autoplayobj_1=setinterval('isl_godown_1();isl_stopdown_1();',interval_1)}
function isl_goup_1(){if(movelock_1)return;clearinterval(autoplayobj_1);movelock_1=true;moveway_1="left";movetimeobj_1=setinterval('isl_scrup_1();',speed_1);}
function isl_stopup_1(){if(moveway_1 == "right"){return};clearinterval(movetimeobj_1);if((getobj('isl_cont_1').scrollleft-fill_1)%pagewidth_1!=0){comp_1=fill_1-(getobj('isl_cont_1').scrollleft%pagewidth_1);compscr_1()}else{movelock_1=false}
autoplay_1()}
function isl_scrup_1(){if(getobj('isl_cont_1').scrollleft<=0){getobj('isl_cont_1').scrollleft=getobj('isl_cont_1').scrollleft+getobj('list1_1').offsetwidth}
getobj('isl_cont_1').scrollleft-=space_1}
function isl_godown_1(){clearinterval(movetimeobj_1);if(movelock_1)return;clearinterval(autoplayobj_1);movelock_1=true;moveway_1="right";isl_scrdown_1();movetimeobj_1=setinterval('isl_scrdown_1()',speed_1)}
function isl_stopdown_1(){if(moveway_1 == "left"){return};clearinterval(movetimeobj_1);if(getobj('isl_cont_1').scrollleft%pagewidth_1-(fill_1>=0?fill_1:fill_1+1)!=0){comp_1=pagewidth_1-getobj('isl_cont_1').scrollleft%pagewidth_1+fill_1;compscr_1()}else{movelock_1=false}
autoplay_1()}
function isl_scrdown_1(){if(getobj('isl_cont_1').scrollleft>=getobj('list1_1').scrollwidth){getobj('isl_cont_1').scrollleft=getobj('isl_cont_1').scrollleft-getobj('list1_1').scrollwidth}
getobj('isl_cont_1').scrollleft+=space_1}
function compscr_1(){if(comp_1==0){movelock_1=false;return}
var num,tempspeed=speed_1,tempspace=space_1;if(math.abs(comp_1)tempspace){comp_1-=tempspace;num=tempspace}else{num=comp_1;comp_1=0}
getobj('isl_cont_1').scrollleft+=num;settimeout('compscr_1()',tempspeed)}}
function picrun_ini(){
getobj("list2_1").innerhtml=getobj("list1_1").innerhtml;
getobj('isl_cont_1').scrollleft=fill_1>=0?fill_1:getobj('list1_1').scrollwidth-math.abs(fill_1);
getobj("isl_cont_1").onmouseover=function(){clearinterval(autoplayobj_1)}
getobj("isl_cont_1").onmouseout=function(){autoplay_1()}
autoplay_1();
}
/********************图片左右移动end********************/
function marquee()
{this.id=document.getelementbyid(arguments[0]);if(!this.id)
{alert("您要设置的\""+arguments[0]+"\"初始化错误\r\n请检查标签id设置是否正确!");this.id=-1;return;}
this.direction=this.width=this.height=this.delaytime=this.waittime=this.ctl=this.startid=this.stop=this.mouseover=0;this.step=1;this.timer=30;this.directionarray={"top":0,"up":0,"bottom":1,"down":1,"left":2,"right":3};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.waittime=arguments[7];if(typeof arguments[8]=="number")this.scrollstep=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>=7)this.start();}
marquee.prototype.start=function()
{if(this.id==-1)return;if(this.waittime<800)this.waittime=800;if(this.timer<20)this.timer=20;if(this.width==0)this.width=parseint(this.id.style.width);if(this.height==0)this.height=parseint(this.id.style.height);if(typeof this.direction=="string")this.direction=this.directionarray[this.direction.tostring().tolowercase()];this.halfwidth=math.round(this.width/2);this.halfheight=math.round(this.height/2);this.bakstep=this.step;this.id.style.width=this.width+"px";this.id.style.height=this.height+"px";if(typeof this.scrollstep!="number")this.scrollstep=this.direction>1?this.width:this.height;var templateleft="msclass_temp_html | msclass_temp_html |
";var templatetop="msclass_temp_html |
msclass_temp_html |
";var msobj=this;msobj.temphtml=msobj.id.innerhtml;if(msobj.direction<=1)
{msobj.id.innerhtml=templatetop.replace(/msclass_temp_html/g,msobj.id.innerhtml);}
else
{if(msobj.scrollstep==0&&msobj.delaytime==0)
{msobj.id.innerhtml+=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>1?msobj.id.scrollwidth/2:msobj.id.scrollheight/2;if((msobj.direction<=1&&msobj.clientscroll<=msobj.height+msobj.step)||(msobj.direction>1&&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>1)
{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?3:2;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 0: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 1: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 2: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 3: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;}}