
function $(id){return document.getElementById(id);}
function sizefont(text){var allstring="";var flag=0;for(i=0,j=0;i<text.length;i=i+1){if(flag==0){j++;if(j>=7){flag=1;}}
if(flag==1){j=j-1;if(j<=0){flag=0;}}
allstring+="<FONT color=red SIZE="+j+">"+text.substring(i,i+1)+"</FONT>";}
return allstring;}
function MakeArray(n){this.length=n;for(var i=1;i<=n;i++)this[i]=i-1;return this}
hex=new MakeArray(16);hex[11]="A";hex[12]="B";hex[13]="C";hex[14]="D";hex[15]="E";hex[16]="F";function ToHex(x){var high=x/16;var s=high+"";s=s.substring(0,2);high=parseInt(s,10);var left=hex[high+1];var low=x-high*16;s=low+"";s=s.substring(0,2);low=parseInt(s,10);var right=hex[low+1];var string=left+""+right;return string;}
function rainbow1(text){text=text.substring(3,text.length-4);color_d1=255;mul=color_d1/text.length;for(i=0;i<text.length;i++){color_d1=255*Math.sin(i/(text.length/3));color_h1=ToHex(color_d1);color_d2=mul*i;color_h2=ToHex(color_d2);document.write("<FONT COLOR='#FF"+color_h1+color_h2+"'>"+text.substring(i,i+1)+'</FONT>');}}
function rainbowAndSize(sign_id){var text=$(sign_id).innerHTML;var allstring="";var flag=0;for(i=0,j=0;i<text.length;i=i+1){color_d1=255;mul=color_d1/text.length;color_d1=255*Math.sin(i/(text.length/3));color_h1=ToHex(color_d1);color_d2=mul*i;color_h2=ToHex(color_d2);if(flag==0){j++;if(j>=7){flag=1;}}
if(flag==1){j=j-1;if(j<=0){flag=0;}}
allstring+="<FONT COLOR='#FF"+color_h1+color_h2+"' SIZE="+j+">"+text.substring(i,i+1)+"</FONT>";}
$(sign_id).innerHTML=allstring;}
function wave3(obj){this.id=obj;this.text=document.getElementById(obj).innerHTML;this.n=0;this.nextSize=function(i,incMethod,textLength)
{if(incMethod==1)return(32*Math.abs(Math.sin(i/(textLength/3.14))));if(incMethod==2)return(255*Math.abs(Math.cos(i/(textLength/3.14))));}
this.sizeCycle=function(text,method,dis)
{output="";for(i=0;i<text.length;i++)
{size=parseInt(this.nextSize(i+dis,method,text.length));output+="<font style='font-size: "+size+"pt' color=red >"+text.substring(i,i+1)+"</font>";}
document.getElementById(this.id).innerHTML=output;}
this.init=function(){}
this.nextFrame=function()
{var theText3="==="+this.text+"===";this.sizeCycle(theText3,1,this.n);this.n++;if(this.n>theText3.length){this.n=0;}}}
function pulse(sign_id,options){this.from=options.from?options.from:5;this.to=options.to?options.to:11;this.glowColor=options.glowColor?options.glowColor:"lime";this.text=$(sign_id);this.i=this.to;this.direct=false;this.init=function(){};this.nextFrame=function(){if(this.direct){this.i++;if(this.i>=this.to)this.direct=false;}else{this.i--;if(this.i<=this.from)this.direct=true;}
this.text.style.filter="Glow(Color="+"lime"+", Strength="+this.i+")";}}
function wave5(obj,dilim){this.count=0;this.thePhase=0;this.aniOn=0;this.theStrength=0;this.maxCount=40;this.maxStrength=100;this.theCount=0;this.textCount=0;this.colorList=new Array("red","blue","green");this.oDiv=document.getElementById(obj);this.oQueue=new Array();this.doStart=function()
{this.oQueue=this.oDiv.innerHTML.split(dilim?dilim:".");this.oDiv.innerHTML=this.oQueue[0];this.theCount=0;this.doFilt();}
this.getStrength=function(pos)
{var ret=0
if(pos<this.maxCount)
{ret=this.maxStrength*pos*pos/(this.maxCount*this.maxCount);}
else if(pos==this.maxCount)
{this.textCount++;if(this.textCount==this.oQueue.length){this.textCount=0;this.thePhase=0;}
strNext=this.oQueue[this.textCount];this.oDiv.innerHTML=strNext;rndNum=Math.floor(Math.random()*3)
this.oDiv.style.filter+="glow(color="+this.colorList[rndNum]+", strength=5)"
ret=this.maxStrength;}
else if(pos<2*this.maxCount)
{pos=2*this.maxCount-pos;ret=this.maxStrength*pos*pos/(this.maxCount*this.maxCount);}
else
ret=0;ret=Math.ceil(ret)
return ret;}
this.anitext=function(){this.thePhase=(this.thePhase+10)
this.oDiv.filters[0].phase=this.thePhase
this.theStrength=this.getStrength(++this.theCount);if(this.theStrength==0)this.theCount=0;if(this.oQueue.length>0||this.theStrength>0)
{this.oDiv.filters[0].strength=this.theStrength;oTO=setTimeout("this.anitext()",0200);}}
this.flag=true;this.nextFrame=function(){if(this.flag){this.thePhase=(this.thePhase+10)
this.oDiv.filters[0].phase=this.thePhase
this.theStrength=this.getStrength(++this.theCount);if(this.theStrength==0)this.theCount=0;if(this.oQueue.length>0||this.theStrength>0){this.oDiv.filters[0].strength=this.theStrength;}else{this.flag=false;}}}
this.doFilt=function(){this.oDiv.style.filter="wave(add=0, freq=3, lightstrength=50, phase=0, strength=2, enabled=1); ";rndNum=Math.floor(Math.random()*3);this.oDiv.style.filter+="glow(color="+this.colorList[rndNum]+", strength=5)";}
this.init=function(){this.doStart();}}
function fade_it5(sign_id,dilim){eval("var fader_"+sign_id+" = new wave5('"+sign_id+"','"+dilim+"'); fader_"+sign_id+".init();");eval("function step_"+sign_id+"(){fader_"+sign_id+".nextFrame();}");eval("setInterval(step_"+sign_id+",200);");}
function fader(sign_id,dilim){var container=$(sign_id);this.covertop=container.style.posTop;this.coverleft=container.style.posLeft;this.message=container.innerHTML.split(dilim);this.i_message=0;this.text=document.createElement("div");this.text.className="textstyle";this.text.innerHTML=this.message[0];container.innerHTML="";container.appendChild(this.text);this.cover=document.createElement("div");this.cover.className="coverstyle";this.cover.innerHTML="<img src='slidefader.gif'>";container.appendChild(this.cover);this.coverwidth=1200;this.coverheight=96;this.texttop=this.covertop+10;this.textleft=this.coverleft+10;this.textwidth=400;this.textheight=this.coverheight;this.cliptop=0;this.clipright=this.textwidth;this.clipbottom=this.coverheight;this.clipleft=0;this.clippoints=null;this.step=40;this.timer=null;this.direct=true;this.init=function(){this.text.style.posTop=this.texttop;this.text.style.posLeft=this.textleft;this.cover.style.posTop=this.covertop;this.cover.style.posLeft=this.coverleft;this.clipleft=0;};this.nextFrame=function(){if(this.direct){if(this.cover.style.posLeft>=(-this.coverwidth+this.textwidth+this.coverleft+this.step)){this.clipleft+=this.step;this.clipright=this.clipleft+this.textwidth;this.clippoints="rect("+this.cliptop+" "+this.clipright+" "+this.clipbottom+" "+this.clipleft+")";this.cover.style.clip=this.clippoints;this.cover.style.posLeft-=this.step;}
else{this.i_message++;if(this.i_message>=this.message.length){this.i_message=0;}
this.text.innerHTML=this.message[this.i_message];this.direct=false;}}else{if(this.cover.style.posLeft<=this.coverleft){this.clipleft-=this.step;this.clipright=this.clipleft+this.textwidth;this.clippoints="rect("+this.cliptop+" "+this.clipright+" "+this.clipbottom+" "+this.clipleft+")";this.cover.style.clip=this.clippoints;this.cover.style.posLeft+=this.step;}
else{this.init();this.direct=true;}}};}
function log(msg){}
function fade_it3(sign_id){eval("var fader_"+sign_id+" = new wave3('"+sign_id+"');");eval("function step_"+sign_id+"(){fader_"+sign_id+".nextFrame();}");eval("setInterval(step_"+sign_id+",50);");}
function fade_it6(sign_id,dilim){eval("var fader_"+sign_id+" = new fader('"+sign_id+"','"+dilim+"'); fader_"+sign_id+".init();");eval("function step_"+sign_id+"(){fader_"+sign_id+".nextFrame();}");eval("setInterval(step_"+sign_id+",fader_"+sign_id+".pause);");}
function decorate(sign_id,options){var dilim=options.dilim?options.dilim:".";eval("var fader_"+sign_id+" = new "+options.effect+"('"+sign_id+"','"+dilim+"'); fader_"+sign_id+".init();");eval("function step_"+sign_id+"(){fader_"+sign_id+".nextFrame();}");var delay=options.delay?options.delay:50;eval("setInterval(step_"+sign_id+","+delay+");");}
function doAll(sign_id,type){switch(type)
{case 1:return;case 2:rainbowAndSize(sign_id);break;case 3:decorate(sign_id,{effect:"wave3"});break;case 4:decorate(sign_id,{effect:"pulse"})
break;case 5:fade_it5(sign_id,'<BR>');break;case 6:decorate(sign_id,{effect:"fader",dilim:'<BR>'});break;default:return;}}