String.prototype.format=function(){var C=this,B=arguments.length;for(var A=0;A<B;A++)C=C.replace(new RegExp("\\{"+A+"\\}","g"),arguments[A]);return C};function $(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string")A=document.getElementById(A);if(arguments.length==1)return A;C.push(A)}return C}function IMarquee(){function A(){alert("\u63a5\u53e3{0}\u672a\u5b9e\u73b0\uff1a".format(arguments[0]))}this.Scroll=function(){A("Scroll")};this.Clone=function(){A("Clone")}}function AbstractMarquee(){IMarquee.apply(this);var F=this,C=null,E=null,B=["ContainerID","Delay","Amount","Width","Height"];this.Amount=1;this.Delay=30;this.Width=0;this.Height=0;this.ContainerID="";this.Start=function(){D();C=setInterval(F.Scroll,F.Delay)};this.Stop=function(){D()};this.Pause=function(){D()};this.Init=function(){E=$(this.ContainerID);if(E==null){alert("\u65e0\u6cd5\u627e\u5230id\u4e3a{0}\u7684\u5bf9\u8c61,\u521d\u59cb\u5316\u5931\u8d25\u3002".format(this.ContainerID));return}E.style.overflow="hidden";if(this.Width>0)E.style.width=this.Width+"px";if(this.Height>0)E.style.height=this.Height+"px";this.Clone();this.AttachEvent();this.Start()};this.AttachEvent=function(){E.onmouseover=F.Pause;E.onmouseout=F.Start};function D(){if(C!=null)clearInterval(C)}function A(){var C=Math.min(B.length,arguments.length);for(var A=0;A<C;A++)this[B[A]]=arguments[A]}A.apply(this,arguments)}
function MarqueeUp(){AbstractMarquee.apply(this,arguments);var ref=this,A=$(this.ContainerID);this.Clone=function(){A.innerHTML="<div>{0}</div><div>{0}</div>".format(A.innerHTML)};this.Scroll=function(){with(A){if(scrollTop>=lastChild.offsetTop)scrollTop-=firstChild.offsetHeight;else scrollTop+=ref.Amount}}}
function MarqueeDown(){AbstractMarquee.apply(this,arguments);var ref=this,A=$(this.ContainerID);this.Clone=function(){A.innerHTML="<div>{0}</div><div>{0}</div>".format(A.innerHTML);A.scrollTop=A.scrollHeight};this.Scroll=function(){with(A){if(scrollTop<=firstChild.offsetTop)scrollTop+=lastChild.offsetHeight;else scrollTop-=ref.Amount}}}
function MarqueeLeft(){AbstractMarquee.apply(this,arguments);var ref=this,A=$(this.ContainerID);this.Clone=function(){A.innerHTML="<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td>{0}</td><td>{0}</td></tr></table>".format(A.innerHTML)};this.Scroll=function(){with(A){if(scrollLeft>=firstChild.rows[0].cells[1].offsetLeft)scrollLeft-=firstChild.rows[0].cells[0].offsetWidth;else scrollLeft+=ref.Amount}}}
function MarqueeRight(){AbstractMarquee.apply(this,arguments);var ref=this,A=$(this.ContainerID);this.Clone=function(){A.innerHTML="<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td>{0}</td><td>{0}</td></tr></table>".format(A.innerHTML);A.scrollLeft=A.scrollWidth};this.Scroll=function(){with(A){if(scrollLeft<=firstChild.rows[0].cells[0].offsetLeft)scrollLeft+=firstChild.rows[0].cells[1].offsetWidth;else scrollLeft-=ref.Amount}}}