//Copyright 2007, Howling Dynamo, Inc. or its suppliers. All Rights Reserved. http://www.hdyn.com/wr/common/contact.php?addr=pr
var g_msg=null;
var g_colors=new Array();
var g_nonGrey=null;
function doLoad(bg,fg,_3){
g_colors=[bg,fg];
g_nonGrey=_3;
document.body.onmousedown=goRoot;
document.body.title="feel free to touch the wall";
startStars(bg);
}
function doUnload(){
var _4=document.getElementById("msg");
if(_4!=null){
_4.style.display="none";
}
}
function goRoot(){
if(g_msg!=null){
return;
}
var _5=Math.round(1000/g_stars.jstMillis);
if(_5<10){
_5=10;
}
g_msg=new MsgFade("g_msg",g_nonGrey==null?"flat grey wall":g_nonGrey+" is just a special case of grey",g_colors[0],221,g_colors[1],221,80,document.getElementById("msg"));
g_msg.doFade();
}
function MsgFade(_6,_7,bg,_9,fg,_b,_c,_d){
setColors(_d,bg,fg);
_d.firstChild.innerHTML=_7;
this.clock=new GPTimer();
this.name=_6;
this.bg=bg;
this.bgZ=_9;
this.fg=fg;
this.fgZ=_b;
this.dbg=getDelta(bg,_9,_c);
this.dfg=getDelta(fg,_b,_c);
this.holder=_d;
this.waitMillis=16;
this.holder.style.display="block";
this.doFade=function(){
if(this.fade(true)){
this.clock.doAfter(this.name+".doFade()",this.waitMillis);
}else{
location=g_nonGrey==null?"root.html":"http://www.flatgreywall.com/root.html";
}
};
this.fade=function(){
this.bg=fadeColor(this.bg,this.dbg,this.bgZ);
this.fg=fadeColor(this.fg,this.dfg,this.fgZ);
setColors(this.holder,this.bg,this.fg);
return this.bg!=this.bgZ||this.fg!=this.fgZ;
};
}
function setColors(ob,bg,fg){
ob.style.backgroundColor=color([bg,bg,bg]);
ob.style.color=color([fg,fg,fg]);
}
function color(c){
return "rgb("+c[0]+","+c[1]+","+c[2]+")";
}
function getDelta(cA,cZ,_14){
var d=(cZ-cA)/_14;
if(d<0){
if(d>-1){
return -1;
}
return Math.ceil(d);
}
if(d<1){
return 1;
}
return Math.floor(d);
}
function fadeColor(c,d,cZ){
c+=d;
if(d>0&&c>cZ){
return cZ;
}
if(d<0&&c<cZ){
return cZ;
}
return c;
}

