Object.prototype.clone=function(){
var _1=new Object();
_1.toString=this.toString;
for(var _2 in this){
_1[_2]=this[_2];
}
return _1;
};

navigator.isIE50=function(){
return navigator.userAgent.indexOf("MSIE 5.0")!=-1;
};

Number.prototype.hex=function(_1){
var _2=this.toString(16);
if(typeof (_1)=="number"){
_2=_2.padLeft(_1,"0");
}
return _2;
};

String.prototype.camelize=function(){
var _1=this.split("-");
if(_1.length==1){
return _1[0];
}
if(this.indexOf("-")==0){
var _2=_1[0].charAt(0).toUpperCase()+_1[0].substring(1);
}else{
var _2=_1[0];
}
for(var i=1,len=_1.length;i<len;i++){
var _4=_1[i];
_2+=_4.charAt(0).toUpperCase()+_4.substring(1);
}
return _2;
};
String.prototype.repeat=function(n){
var _6=this;
for(var i=1;i<n;i++){
_6+=this;
}
return _6;
};
String.prototype.padLeft=function(_8,_9){
if(typeof (_9)!="string"){
_9=" ";
}
if(this.length>=_8){
return this;
}else{
return _9.charAt(0).repeat(_8-this.length)+this;
}
};
String.prototype.padRight=function(_a,_b){
if(typeof (_b)!="string"){
_b=" ";
}
if(this.length>=_a){
return this;
}else{
return this+_b.charAt(0).repeat(_a-this.length);
}
};

Array.prototype.min=function(){
var _1=null;
for(var i=0;i<this.length;i++){
if(_1==null||this[i]<_1){
_1=this[i];
}
}
return _1;
};
Array.prototype.max=function(){
var _3=null;
for(var i=0;i<this.length;i++){
if(_3==null||this[i]>_3){
_3=this[i];
}
}
return _3;
};
if(!Array.prototype.push){
Array.prototype.push=function(_5){
this[this.length]=_5;
};
}

if(navigator.isIE50()){
Math.max=function(_1){
var _2=Math.max.arguments;
if(_2.length==0){
return -Infinity;
}else{
var _3=_2[0];
if(isNaN(_3)){
return NaN;
}else{
for(var i=1;i<_2.length;i++){
if(isNaN(_2[i])){
return NaN;
}else{
if(_2[i]>_3){
_3=_2[i];
}
}
}
return _3;
}
}
};
}
if(navigator.isIE50()){
Math.min=function(_5){
var _6=Math.min.arguments;
if(_6.length==0){
return -Infinity;
}else{
var _7=_6[0];
if(isNaN(_7)){
return NaN;
}else{
for(var i=1;i<_6.length;i++){
if(isNaN(_6[i])){
return NaN;
}else{
if(_6[i]<_7){
_7=_6[i];
}
}
}
return _7;
}
}
};
}

function Size(_1,_2){
this.width=_1;
this.height=_2;
}
Size.prototype.toString=function(){
return "["+this.width+","+this.height+"]";
};

function Point(x,y){
this.x=x;
this.y=y;
}
Point.prototype.toString=function(){
return "["+this.x+","+this.y+"]";
};
Point.getPlainList=function(_3){
var _4=Array();
for(var i=0;i<_3.length;i++){
_4.push(_3[i].x+","+_3[i].y);
}
return _4.join(",");
};
Point.getMinPoint=function(_6){
if(_6.length){
var _7=new Point(_6[0].x,_6[0].y);
for(var i=1;i<_6.length;i++){
if(_6[i].x<_7.x){
_7.x=_6[i].x;
}
if(_6[i].y<_7.y){
_7.y=_6[i].y;
}
}
return _7;
}else{
return null;
}
};
Point.getMaxPoint=function(_9){
if(_9.length){
var _a=_9[0];
for(var i=1;i<_9.length;i++){
if(_9[i].x>_a.x||_9[i].y>_a.y){
_a=_9[i];
}
}
return _a;
}else{
return null;
}
};

function Element(_1){
if(typeof (_1)=="string"){
this.elem=document.getElementById(_1);
this.id=_1;
if(!this.elem){
alert("Undefined element \""+_1+"\"");
}
}else{
this.elem=_1;
this.id=_1.id;
}
}
Element.isMac=navigator.userAgent.indexOf("Mac")!=-1;
Element.isIE5x=navigator.userAgent.indexOf("MSIE 5")!=-1&&!Element.isMac;
Element.isIE5Mac=navigator.userAgent.indexOf("MSIE 5")!=-1&&Element.isMac;
Element.isSafari=navigator.userAgent.indexOf("Safari")!=-1;
Element.isOpera=navigator.userAgent.indexOf("Opera")!=-1;
Element.prototype.toString=function(){
return "["+this.id+","+this.getPos()+","+this.getSize()+"]";
};
Element.prototype.getLeft=function(){
return this.getPos().top;
};
Element.prototype.getTop=function(){
return this.getPos().left;
};
Element.prototype.getPos=function(){
var _2=0;
var _3=0;
var _4=this.elem;
while(_4){
_2+=_4.offsetLeft;
_3+=_4.offsetTop;
_4=_4.offsetParent;
}
return new Point(_2,_3);
};
Element.prototype.setLeft=function(_5){
this.elem.style.pixelLeft=_5;
this.elem.style.left=_5+"px";
};
Element.prototype.setTop=function(_6){
this.elem.style.pixelTop=_6;
this.elem.style.top=_6+"px";
};
Element.prototype.setPos=function(_7){
this.setLeft(_7.x);
this.setTop(_7.y);
};
Element.prototype.getWidth=function(){
return this.elem.offsetWidth;
};
Element.prototype.getInnerWidth=function(){
return this.elem.offsetWidth-this.getExtraWidth();
};
Element.prototype.getHeight=function(){
return this.elem.offsetHeight;
};
Element.prototype.getInnerHeight=function(){
return this.elem.offsetHeight-this.getExtraHeight();
};
Element.prototype.getSize=function(){
return new Size(this.getWidth(),this.getHeight());
};
Element.prototype.getInnerSize=function(){
return new Size(this.getInnerWidth(),this.getInnerHeight());
};
Element.prototype.setWidth=function(_8,_9){
if(!Element.isIE5x){
_8-=_9?_9:this.getExtraWidth();
}
this.elem.style.pixelWidth=_8;
this.elem.style.width=_8+"px";
};
Element.prototype.setInnerWidth=function(_a,_b){
if(Element.isIE5x){
_a+=_b?_b:this.getExtraWidth();
}
this.elem.style.pixelWidth=_a;
this.elem.style.width=_a+"px";
};
Element.prototype.setHeight=function(_c,_d){
if(!Element.isIE5x){
_c-=_d?_d:this.getExtraHeight();
}
this.elem.style.pixelHeight=_c;
this.elem.style.height=_c+"px";
};
Element.prototype.setInnerHeight=function(_e,_f){
if(Element.isIE5x){
_e+=_f?_f:this.getExtraHeight();
}
this.elem.style.pixelHeight=_e;
this.elem.style.height=_e+"px";
};
Element.prototype.setSize=function(_10){
this.setWidth(_10.width);
this.setHeight(_10.height);
};
Element.prototype.setInnerSize=function(_11){
this.setInnerWidth(_11.width);
this.setInnerHeight(_11.height);
};
Element.prototype.getExtraWidth=function(){
var _12=parseInt(this.getStyle("padding-left"))+parseInt(this.getStyle("padding-right"));
var _13=parseInt(this.getStyle("border-left-width"))+parseInt(this.getStyle("border-right-width"));
var _14=parseInt(this.getStyle("margin-left-width"))+parseInt(this.getStyle("margin-right-width"));
return (isNaN(_12)?0:_12)+(isNaN(_13)?0:_13)+(isNaN(_14)?0:_14);
};
Element.prototype.getExtraHeight=function(){
var _15=parseInt(this.getStyle("padding-top"))+parseInt(this.getStyle("padding-bottom"));
var _16=parseInt(this.getStyle("border-top-width"))+parseInt(this.getStyle("border-bottom-width"));
var _17=parseInt(this.getStyle("margin-top-width"))+parseInt(this.getStyle("margin-top-width"));
return (isNaN(_15)?0:_15)+(isNaN(_16)?0:_16)+(isNaN(_17)?0:_17);
};
Element.prototype.getExtraSize=function(){
return new Size(this.getExtraWidth(),this.getExtraHeight());
};
Element.prototype.setStyle=function(_18,_19){
this.elem.style[_18.camelize()]=_19;
};
Element.prototype.getStyle=function(_1a){
if(this.elem==document){
return null;
}
var _1b=_1a.camelize();
var _1c=null;
if(this.elem.style){
_1c=this.elem.style[_1b];
}
if(!_1c){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(this.elem,null);
if(css!=null){
_1c=css.getPropertyValue(_1a);
}else{
_1c=null;
}
}else{
if(this.elem.currentStyle){
_1c=this.elem.currentStyle[_1b];
}
}
}
return _1c;
};
Element.prototype.getParent=function(){
if(this.elem.parentNode){
return new Element(this.elem.parentNode);
}else{
return null;
}
};
Element.prototype.isVisible=function(){
return this.getStyle("display")!="none";
};

function RGB(_1,_2,_3){
this.red=_1;
this.green=_2;
this.blue=_3;
}
RGB.fromHSB=function(_4){
if(_4.saturation==0){
return new RGB(_4.brightness,_4.brightness,_4.brightness);
}else{
var _5=Math.floor(_4.hue/60);
var _6=(_4.hue/60)-_5;
var p=Math.round(_4.brightness*(1-_4.saturation)*255);
var q=Math.round(_4.brightness*(1-_4.saturation*_6)*255);
var t=Math.round(_4.brightness*(1-_4.saturation*(1-_6))*255);
var b=Math.round(_4.brightness*255);
switch(_5){
case 0:
return new RGB(b,t,p);
case 1:
return new RGB(q,b,p);
case 2:
return new RGB(p,b,t);
case 3:
return new RGB(p,q,b);
case 4:
return new RGB(t,p,b);
case 5:
return new RGB(b,p,q);
}
}
};
RGB.fromString=function(_b){
var _c=_b.match(/#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i);
if(_c){
var _d=parseInt(_c[1],16);
var _e=parseInt(_c[2],16);
var _f=parseInt(_c[3],16);
return new RGB(_d,_e,_f);
}
_c=_b.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
if(_c){
var _d=parseInt(_c[1]);
var _e=parseInt(_c[2]);
var _f=parseInt(_c[3]);
return new RGB(_d,_e,_f);
}
var _10=[["aqua",new RGB(0,255,255)],["black",new RGB(0,0,0)],["blue",new RGB(0,0,255)],["fuchsia",new RGB(255,0,255)],["gray",new RGB(128,128,128)],["green",new RGB(0,128,0)],["lime",new RGB(0,255,0)],["maroon",new RGB(128,0,0)],["navy",new RGB(0,0,128)],["olive",new RGB(128,128,0)],["orange",new RGB(255,165,0)],["purple",new RGB(128,0,128)],["red",new RGB(255,0,0)],["silver",new RGB(192,192,192)],["teal",new RGB(0,128,128)],["white",new RGB(255,255,255)],["yellow",new RGB(255,255,0)],];
_b=_b.toLowerCase();
for(color in _10){
if(_10[color][0]==_b){
return _10[color][1];
}
}
return null;
};
RGB.colorRange=function(_11,to,_13){
if(_13<1){
throw new Error("At least one step required");
}else{
if(_13==1){
return new Array(to.clone());
}else{
if(_13==2){
return new Array(_11.clone(),to.clone());
}
}
}
var red=_11.red;
var _15=_11.green;
var _16=_11.blue;
var _17=(to.red-_11.red)/_13;
var _18=(to.green-_11.green)/_13;
var _19=(to.blue-_11.blue)/_13;
var _1a=new Array(_11.clone());
for(var i=0;i<_13-2;i++){
red+=_17;
_15+=_18;
_16+=_19;
_1a.push(new RGB(Math.round(red),Math.round(_15),Math.round(_16)));
}
_1a.push(to.clone());
return _1a;
};
RGB.prototype.toString=function(){
return "#"+this.red.hex(2)+this.green.hex(2)+this.blue.hex(2);
};

function HSB(_1,_2,_3){
this.hue=_1;
this.saturation=_2;
this.brightness=_3;
}
HSB.fromRGB=function(_4){
var _5=_4.red/255;
var _6=_4.green/255;
var _7=_4.blue/255;
var _8=Math.min(_5,_6,_7);
var _9=Math.max(_5,_6,_7);
var _a=_9-_8;
var _b=0;
var _c=0;
var _d=_9;
if(_a!=0){
_c=_a/_9;
if(_9==_5){
_b=(_6-_7)/_a;
}else{
if(_9==_6){
_b=2+(_7-_5)/_a;
}else{
_b=4+(_5-_6)/_a;
}
}
_b*=60;
if(_b<0){
_b+=360;
}
}
return new HSB(_b,_c,_d);
};
HSB.prototype.toString=function(){
return "HSB["+this.hue+","+this.saturation+","+this.brightness+"]";
};

function Scroller(_1){
if(typeof (_1)=="string"){
this.container=document.getElementById(_1);
if(this.container==null){
alert("\""+_1+"\" does not exist");
}
}else{
this.container=_1;
}
this.orientation=Scroller.HORZ;
this.fps=20;
this.speed=1;
this.pause=2000;
this.scrollPos=0;
this.delay=0;
this.fadeInSteps=0;
this.fadeOutSteos=0;
this.prepareContainer();
this.scrollerIndex=Scroller.scrollers.length;
Scroller.scrollers[Scroller.scrollers.length]=this;
}
Scroller.scrollers=Array();
Scroller.HORZ=1;
Scroller.VERT=2;
Scroller.prototype.setOrientation=function(_2){
this.orientation=_2;
};
Scroller.prototype.setFPS=function(_3){
this.fps=_3;
};
Scroller.prototype.setSpeed=function(_4){
this.speed=_4;
};
Scroller.prototype.setPause=function(_5){
this.pause=_5;
};
Scroller.prototype.setFadeSteps=function(_6,_7){
this.fadeInSteps=_6;
this.fadeOutSteps=_7;
};
Scroller.prototype.prepareContainer=function(){
this.container.style.overflow="hidden";
};
Scroller.prototype.prepareMessages=function(){
this.messages=new Array();
var _8=this.container.childNodes;
for(var i=0;i<_8.length;i++){
var _a=_8[i];
if(_a.nodeType!=1||_a.nodeName=="SCRIPT"){
continue;
}else{
this.messages[this.messages.length]=_a;
_a.style.textAlign="left";
_a.style.display="none";
if(this.orientation==Scroller.HORZ){
_a.style.width="10000px";
_a.style.marginLeft="10000px";
}
_a.backColor=RGB.fromString(Scroller.getColor(_a,"background-color","white"));
_a.foreColor=RGB.fromString(Scroller.getColor(_a,"color","black"));
if(this.fadeInSteps){
_a.fadeIn=RGB.colorRange(_a.backColor,_a.foreColor,this.fadeInSteps);
}else{
_a.fadeIn=null;
}
if(this.fadeOutSteps){
_a.fadeOut=RGB.colorRange(_a.foreColor,_a.backColor,this.fadeOutSteps);
}else{
_a.fadeOut=null;
}
}
}
this.messageIndex=this.messages.length-1;
};
Scroller.prototype.start=function(){
this.prepareMessages();
setInterval("Scroller.callback("+this.scrollerIndex+")",1000/this.fps);
};
Scroller.prototype.scroll=function(){
if(this.messages.length==0){
return;
}
if(this.scrollPos==0&&this.delay==0){
this.messages[this.messageIndex].style.display="none";
this.messageIndex=(this.messageIndex+1)%this.messages.length;
var _b=this.messages[this.messageIndex];
_b.style.display="block";
if(this.orientation==Scroller.HORZ){
this.scrollPos=this.container.clientWidth;
_b.style.marginLeft=this.scrollPos+"px";
}else{
this.scrollPos=this.container.clientHeight-_b.offsetHeight;
_b.style.marginTop=this.scrollPos+"px";
}
if(_b.fadeIn){
this.fadeIndex=0;
Scroller.setColorDeep(_b,_b.fadeIn[this.fadeIndex++].toString());
}else{
Scroller.setColorDeep(_b,_b.foreColor.toString());
}
}else{
if(this.delay){
var _b=this.messages[this.messageIndex];
if(_b.fadeOut&&this.delay<=_b.fadeOut.length){
Scroller.setColorDeep(_b,_b.fadeOut[_b.fadeOut.length-this.delay].toString());
}
this.delay--;
}else{
this.scrollPos-=this.speed;
if(this.scrollPos<0){
this.scrollPos=0;
}
var _b=this.messages[this.messageIndex];
if(this.orientation==Scroller.HORZ){
_b.style.marginLeft=this.scrollPos+"px";
}else{
_b.style.marginTop=this.scrollPos+"px";
}
if(this.scrollPos==0){
this.delay=this.fps*this.pause/1000;
}
if(_b.fadeIn&&this.fadeIndex<_b.fadeIn.length){
Scroller.setColorDeep(_b,_b.fadeIn[this.fadeIndex++].toString());
}
}
}
};
Scroller.callback=function(_c){
var _d=Scroller.scrollers[_c];
_d.scroll();
};
Scroller.getColor=function(_e,_f,_10){
var _11=new Element(_e);
while(_11){
var _12=_11.getStyle(_f);
if(_12&&_12!="transparent"){
return _12;
}else{
_11=_11.getParent();
}
}
return _10;
};
Scroller.setColorDeep=function(_13,_14){
if(_13.style){
_13.style.color=_14;
}
var _15=_13.childNodes;
for(var i=0;i<_15.length;i++){
Scroller.setColorDeep(_15[i],_14);
}
};

