/*msclass.js*/ 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 d="
msclass_temp_htmlmsclass_temp_html
";var b="
msclass_temp_html
msclass_temp_html
";var e=this;e.temphtml=e.id.innerhtml;if(e.direction<=1){e.id.innerhtml=b.replace(/msclass_temp_html/g,e.id.innerhtml)}else{if(e.scrollstep==0&&e.delaytime==0){e.id.innerhtml+=e.id.innerhtml}else{e.id.innerhtml=d.replace(/msclass_temp_html/g,e.id.innerhtml)}}var f=this.timer;var a=this.delaytime;var c=this.waittime;e.startid=function(){e.scroll()};e.continue=function(){if(e.mouseover==1){settimeout(e.continue,a)}else{clearinterval(e.timerid);e.ctl=e.stop=0;e.timerid=setinterval(e.startid,f)}};e.pause=function(){e.stop=1;clearinterval(e.timerid);settimeout(e.continue,a)};e.begin=function(){e.clientscroll=e.direction>1?e.id.scrollwidth/2:e.id.scrollheight/2;if((e.direction<=1&&e.clientscroll<=e.height+e.step)||(e.direction>1&&e.clientscroll<=e.width+e.step)){e.id.innerhtml=e.temphtml;delete (e.temphtml);return}delete (e.temphtml);e.timerid=setinterval(e.startid,f);if(e.scrollstep<0){return}e.id.onmousemove=function(g){if(e.scrollstep==0&&e.direction>1){var g=g||window.event;if(window.event){if(e.isnotopera){e.eventleft=g.srcelement.id==e.id.id?g.offsetx-e.id.scrollleft:g.srcelement.offsetleft-e.id.scrollleft+g.offsetx}else{e.scrollstep=null;return}}else{e.eventleft=g.layerx-e.id.scrollleft}e.direction=e.eventleft>e.halfwidth?3:2;e.abscenter=math.abs(e.halfwidth-e.eventleft);e.step=math.round(e.abscenter*(e.bakstep*2)/e.halfwidth)}};e.id.onmouseover=function(){if(e.scrollstep==0){return}e.mouseover=1;clearinterval(e.timerid)};e.id.onmouseout=function(){if(e.scrollstep==0){if(e.step==0){e.step=1}return}e.mouseover=0;if(e.stop==0){clearinterval(e.timerid);e.timerid=setinterval(e.startid,f)}}};settimeout(e.begin,c)};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}};