var d=document;
function px(n) { return (isNaN(n)||window.opera)?n:Math.round(n)+'px'; }
function r(n) { return (Math.round(Math.random()*n)); }
function rand(a,b) { return (Math.round(Math.random()*(b-a)))+a; }
function between(a,n,b) { return ((n>Math.min(a,b))&&(n<Math.max(a,b))); }
function undef(v) { var u; return v==u; }
function redraw() { setTimeout('window.location.reload()',200); }
function browserobject()
{
this.ver=navigator.appVersion.toLowerCase();
this.agent=navigator.userAgent.toLowerCase();
this.dom=d.getElementById?1:0;
this.op6=(this.agent.indexOf('opera 6')>-1||this.agent.indexOf('opera/6')>-1)?1:0;
this.ie5=(this.agent.indexOf('msie 5')>-1&&this.dom&&!this.op6)?1:0;
this.ie5mac=(this.ie5&&this.agent.indexOf('mac')>-1)?1:0;
this.ie6=(this.agent.indexOf('msie 6')>-1&&this.dom&&!this.op6)?1:0;
this.ns6=(this.agent.indexOf('mozilla')>-1&&this.dom&&this.agent.indexOf('gecko')>-1)?1:0;
this.ie=(this.ie5||this.ie6||this.ie5mac);
this.ns=(this.ns6);
this.bw=(this.ie||this.ns||this.op6);
return this;
}
var bw=new browserobject();
function pageobject()
{
this.mouseX=0; this.mouseY=0;
this.layerX=0; this.layerY=0;
this.mozscrollbar=bw.ns6?18:0;
return this;
}
var opage=new pageobject();
pageobject.prototype.mouse=function(e)
{
if (undef(e)) e=window.event;
if (undef(e.layerX)) this.layerX=e.offsetX; else this.layerX=e.layerX;
if (undef(e.layerY)) this.layerY=e.offsetY; else this.layerY=e.layerY;
if (!undef(e.clientX)) this.mouseX=e.clientX+this.scrollLeft();
if (!undef(e.clientY)) this.mouseY=e.clientY+this.scrollTop();
if (bw.ie5mac) { this.layerX=this.layerX+this.scrollLeft(); this.layerY=this.layerY+this.scrollTop(); }
};
pageobject.prototype.scrollLeft=function()
{
if (!undef(d.body.scrollLeft)) return d.body.scrollLeft;
else if (!undef(window.scrollX)) return window.scrollX;
};
pageobject.prototype.scrollTop=function()
{
if (!undef(d.body.scrollTop)) return d.body.scrollTop;
else if (!undef(window.scrollY)) return window.scrollY;
};
pageobject.prototype.w=function()
{
if (d.body&&d.body.clientWidth) return d.body.clientWidth+this.scrollLeft();
else if (window.innerWidth) return window.innerWidth+this.scrollLeft();
};
pageobject.prototype.h=function()
{
if (d.body&&d.body.clientHeight) return d.body.clientHeight+this.scrollTop();
else if (window.innerHeight) return window.innerHeight+this.scrollTop();
};
pageobject.prototype.nofocus=function()
{
lnk=d.getElementsByTagName?d.getElementsByTagName('a'):d.links?d.links:null;
if (lnk) { for (var l=0;lnk[l];l++) { ae(lnk[l],'focus',new Function('lnk['+l+'].blur()'),true); } }
};
function dhtmlobject(obj)
{
this.el=d.getElementById?d.getElementById(obj):null;
if (undef(this.el)) alert(obj);
this.css=this.el.style;
this.obj=obj+'Object'; eval(this.obj+'=this');
this.x=this.el.offsetLeft?this.el.offsetLeft:0;
this.y=this.el.offsetTop?this.el.offsetTop:0;
this.w=this.el.offsetWidth?this.el.offsetWidth:0;
this.h=this.el.offsetHeight?this.el.offsetHeight:0;
this.z=this.css.zIndex?this.css.zIndex:0;
this.opaq=100; this.fadetimer=0;
return this;
}
dhtmlobject.prototype.update=function()
{
this.x=this.el.offsetLeft?this.el.offsetLeft:parseInt(this.css.left)?parseInt(this.css.left):0;
this.y=this.el.offsetTop?this.el.offsetTop:parseInt(this.css.top)?parseInt(this.css.top):0;
this.w=this.el.offsetWidth?this.el.offsetWidth:parseInt(this.css.width)?parseInt(this.css.width):0;
this.h=this.el.offsetHeight?this.el.offsetHeight:parseInt(this.css.height)?parseInt(this.css.height):0;
};
dhtmlobject.prototype.setv=function(v) { this.css.visibility=(v==0)?'hidden':'visible'; };
dhtmlobject.prototype.setd=function(d) { this.css.display=d; };
dhtmlobject.prototype.seto=function(o)
{
if (!undef(this.css.MozOpacity)) this.css.MozOpacity=(o/100);
else if (this.el.filters) this.css.filter='alpha(opacity='+o+')';
this.opaq=o;
};
dhtmlobject.prototype.geto=function()
{
if (!undef(this.css.MozOpacity)) return this.css.MozOpacity*100;
else if (this.el.filters) return this.el.filters.alpha.opacity;
};
dhtmlobject.prototype.write=function(text) { this.el.innerHTML=text; this.update(); };
dhtmlobject.prototype.sethtml=function(text) { if (bw.ns6) { var r=d.createRange(); r.selectNodeContents(this.el); r.deleteContents(); var f=r.createContextualFragment(text); this.el.appendChild(f); this.update(); } };
dhtmlobject.prototype.fg=function(color) { this.css.color=color; };
dhtmlobject.prototype.bg=function(color) { this.css.backgroundColor=color; };
dhtmlobject.prototype.bgimg=function(image) { this.css.backgroundImage='url('+image+')'; };
dhtmlobject.prototype.setz=function(z) { this.z=z; this.css.zIndex=this.z; };
dhtmlobject.prototype.moveto=function(x,y)
{
if (!undef(x)) { this.x=x; this.css.left=px(this.x); }
if (!undef(y)) { this.y=y; this.css.top=px(this.y); }
};
dhtmlobject.prototype.moveby=function(x,y) { this.moveto(this.x+x,this.y+y); };
dhtmlobject.prototype.alignto=function(num)
{
if (num==1) this.moveto(0,opage.h()-this.h);
if (num==2) this.moveto(opage.w()/2-this.w/2,opage.h()-this.h);
if (num==3) this.moveto(opage.w()-this.w,opage.h()-this.h);
if (num==4) this.moveto(0,opage.h()/2-this.h/2);
if (num==5) this.moveto(opage.w()/2-this.w/2,opage.h()/2-this.h/2);
if (num==6) this.moveto(opage.w()-this.w,opage.h()/2-this.h/2);
if (num==7) this.moveto(0,0);
if (num==8) this.moveto(opage.w()/2-this.w/2,0);
if (num==9) this.moveto(opage.w()-this.w,0);
};
dhtmlobject.prototype.setw=function(w) { this.w=w; this.css.width=px(this.w); };
dhtmlobject.prototype.seth=function(h) { this.h=h; this.css.height=px(this.h); };
dhtmlobject.prototype.getw=function()
{
if (this.el.offsetWidth) return this.el.offsetWidth;
else if (parseInt(this.css.width)) return parseInt(this.css.width);
else return 0;
};
dhtmlobject.prototype.geth = function()
{
if (this.el.offsetHeight) return this.el.offsetHeight;
else if (parseInt(this.css.height)) return parseInt(this.css.height);
else return 0;
};
dhtmlobject.prototype.clipto=function(t,r,b,l,d)
{
if (t<0) t=0; if (r<0) r=0; if (b<0) b=0; if (l<0) l=0;
this.css.clip='rect('+px(t)+','+px(r)+','+px(b)+','+px(l)+')';
if (!undef(d)) { this.setw(r); this.seth(b); }
};
dhtmlobject.prototype.fadeto=function(target,step,time) { clearTimeout(this.fadetimer); this.fade(target,step,time); };
dhtmlobject.prototype.fade=function(target,step,time)
{
if (target>this.opaq) this.seto(this.opaq+step); else this.seto(this.opaq-step);
if (Math.abs(target-this.opaq)>step) { this.fadetimer=setTimeout(this.obj+'.fade('+target+','+step+','+time+')',time); }
else { this.seto(target); clearTimeout(this.fadetimer); }
};
function ae(el,et,fn,cap)
{
if (el.addEventListener) { el.addEventListener(et,fn,cap); return true; }
else if (el.attachEvent) { var ae=el.attachEvent('on'+et,fn); return ae; }
else { el['on'+et]=fn; }
};
function re(el,et,fn,cap)
{
if (el.removeEventListener) { el.removeEventListener(et,fn,cap); return true; }
else if (el.detachEvent) { var re=el.detachEvent('on'+et,fn); return re; }
else { el['on'+et]=null; }
};
function ce(tag,id,sty,cl,nest)
{
if (d.createElement)
{
el=d.createElement(tag);
el.setAttribute('id',id);
if (bw.ie) el.style.cssText=sty;
else el.setAttribute('style',sty);
if (cl) el.className=cl;
if (nest) d.getElementById(nest).appendChild(el);
else d.body.appendChild(el);
}
}
function de(el,nest)
{
if (d.createElement&&d.getElementById(el))
{
if (nest) d.getElementById(nest).removeChild(d.getElementById(el));
else d.body.removeChild(d.getElementById(el));
}
}

