// Resize fix for Netscape 4+
function resizeFix() { setTimeout('history.go(0)',200); }
// Browser check (needed)
function checkBrowser()
{
this.agent=navigator.userAgent;
this.ver=navigator.appVersion;
this.dom=document.getElementById?1:0;
this.win=this.agent.indexOf('Windows')>-1;
this.mac=this.agent.indexOf("Mac")>-1;
this.ie4=(document.all && !this.dom)?1:0;
this.ie5=(this.ver.indexOf('MSIE 5')>-1 && this.dom)?1:0;
this.ie6=(this.ver.indexOf('MSIE 6')>-1 && this.dom)?1:0;
this.ie4mac=(this.ie4 && this.mac);
this.ie5mac=(this.ie5 && this.mac);
this.ns4=(document.layers && !this.dom)?1:0;
this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0;
this.ie=(this.ie4 || this.ie5 || this.ie6 || this.ie4mac || this.ie5mac);
this.ns=(this.ns4 || this.ns6);
this.w3c=(this.ie5 || this.ie6 || this.ns6 || this.ie5mac);
this.bw=(this.ie4 || this.ie5 || this.ie6 || this.ns4 || this.ns6);
return this;
}
var bw=new checkBrowser();
// Page object positioning
function makePageObject()
{
this.x=0; this.y=0;
this.x2=bw.ns?window.innerWidth:document.body.offsetWidth-20;
this.y2=bw.ns?window.innerHeight:document.body.offsetHeight-4;
this.x50=this.x2/2;
this.y50=this.y2/2;
return this;
}
// Makes crossbrowser object (with two layer nesting for Netscape 4+) 
function makeObject(obj,nest1,nest2)
{
if (bw.ns4)
{
nestedobject=!nest1&&!nest2?document.layers[obj]:nest1&&!nest2?document.layers[nest1].document.layers[obj]:nest1&&nest2?document.layers[nest2].document.layers[nest1].document.layers[obj]:0;
}
this.css=bw.w3c?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?nestedobject:0;
this.doc=bw.w3c?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?nestedobject:0;
this.wri=bw.w3c?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?nestedobject.document:0;
this.ref=bw.dom||bw.ie4?document:this.css.document;
this.writeIt=b_writeIt;
this.showIt=b_showIt;
this.hideIt=b_hideIt;
this.toggleVisibility=b_toggleVisibility;
this.getzIndex=b_getzIndex;
this.setzIndex=b_setzIndex;
this.x; this.y;
this.moveIt=b_moveIt;
this.moveBy=b_moveBy;
this.getLeft=b_getLeft;
this.getTop=b_getTop;
this.setLeft=b_getLeft;
this.setTop=b_getTop;
this.objWidth=b_objWidth;
this.objHeight=b_objHeight;
this.clipTo=b_clipTo;
this.bgChange=b_bgChange;
this.bgImage=b_bgImage;
return this;
}
// Makes an object's visibiltiy visible
function b_showIt() { this.css.visibility='visible'; }
// Makes an object's visibiltiy hidden
function b_hideIt() { this.css.visibility='hidden'; }
// Hide object if it's visible and visa versa
function b_toggleVisibility()
{
if (this.css.visibility=='visible' || this.css.visibility=='show' || this.css.visibility=='') this.css.visibility='hidden';
else this.css.visibility='visible';
}
// Sets the object z-index
function b_setzIndex(zOrder) { this.css.zIndex=zOrder; }
// Gets the object z-index
function b_getzIndex() { return (this.css.zIndex=='')?0:this.css.zIndex; }
// Writing content to object
function b_writeIt(text)
{
if (bw.ns4) { this.wri.open(); this.wri.write(text); this.wri.close(); }
else if (bw.ie4 || bw.w3c) this.wri.innerHTML=text;
}
// Set left position of object
function b_setLeft(x) { this.x=x; this.css.left=this.x; }
// Set top position of object
function b_setTop(y) { this.y=y; this.css.top=this.y; }
// Move object to
function b_moveIt(x,y)
{
this.x=x; this.y=y;
this.css.left=this.x;
this.css.top=this.y;
}
// Move object by
function b_moveBy(x,y)
{
this.x=this.x+x; this.y=this.y+y;
this.css.left=this.x;
this.css.top=this.y
}
// Changes the background color of the object
function b_bgChange(color)
{
if (bw.ie4 || bw.w3c) this.css.backgroundColor=color; else if (bw.ns4) this.css.bgColor=color;
}
// Changes the background image of the object
function b_bgImage(image)
{
if (bw.ie || bw.ns6) { this.css.backgroundImage='url('+image+')'; }
else if (bw.ns4) { this.doc.background.src=image; }
}
// Clipping the object
function b_clipTo(t,r,b,l)
{
if (bw.ns4) { this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l; }
else { if (t<0) t=0; if (r<0) r=0; if (b<0) b=0; if (b<0) b=0; this.css.clip='rect('+t+','+r+','+b+','+l+')'; }
}
// Get left position of object
function b_getLeft()
{
if (bw.ns4) { return parseInt(this.css.left); }
else if (bw.ns6) { if (this.css.left) return parseInt(this.css.left); else return this.doc.offsetLeft; }
else if (bw.ie) { if (this.css.pixelLeft) return parseInt(this.css.pixelLeft); else return this.doc.offsetLeft; }
}
// Get top position of object
function b_getTop()
{
if (bw.ns4) { return parseInt(this.css.top); }
else if (bw.ns6) { if (this.css.top) return parseInt(this.css.top); else return this.doc.offsetTop; }
else if (bw.ie) { if (this.css.pixelTop) return parseInt(this.css.pixelTop); else return this.doc.offsetTop; }
}
// Get object width
function b_objWidth()
{
if (bw.ns4) if (this.css.width) return this.css.width; else return this.css.clip.width;
else if (bw.ie) if (this.css.pixelWidth) return this.css.pixelWidth; else return this.docoffsetWidth;
else if (bw.ns6) if (this.css.width) return parseInt(this.css.width); else return this.doc.offsetWidth;
}
// Get object height
function b_objHeight()
{
if (bw.ns4) if (this.css.height) return this.css.height; else return this.css.clip.height;
else if (bw.ie) if (this.css.pixelHeight) return this.css.pixelHeight; else return this.doc.offsetHeight;
else if (bw.ns6) if (this.css.height) return parseInt(this.css.height); else return this.doc.offsetHeight;
}
// Reload function
function reloadIt() { setTimeout('history.go(0)',200); }