
onload = function () {
    this.positionFooter();
}

onresize = function () {
    if (this.isNS4()){
        document.location.reload();
    }
    else {
        this.positionFooter();
    }
}

var p_iCenterTop = 64;
var p_iCenterLeft = 212;

positionFooter = function () {
    var oFooter = this.getElementById ("div_footer");

    if (oFooter) {
        var iFooterTop = this.getClientHeight() - this.getElementHeight(oFooter);
        var oCenter = this.getElementById ("div_center1");
        if (oCenter) {
            p_iCenterTop = 180;
            iFooterTop = Math.max(iFooterTop, p_iCenterTop + this.getElementHeight(oCenter));
        }
        else {
            oCenter = this.getElementById ("div_center2");
            if (oCenter) {
                p_iCenterTop = 180;
                iFooterTop = Math.max(iFooterTop, p_iCenterTop + this.getElementHeight(oCenter));
            }
            else {
                oCenter = this.getElementById ("div_center3");
                if (oCenter) {
                    p_iCenterTop = 180;
                    iFooterTop = Math.max(iFooterTop, p_iCenterTop + this.getElementHeight(oCenter));
                }
		else {
			oCenter = this.getElementById ("div_center4");
			if (oCenter) {
			    p_iCenterTop = 180;
			    iFooterTop = Math.max(iFooterTop, p_iCenterTop + this.getElementHeight(oCenter));
			}
		}
            }
        }
        if (oCenter) {
            var iFooterWidth = this.getElementWidth(oCenter);
            this.setElementWidth(oFooter, iFooterWidth);
        }
        var oLeft = this.getElementById ("div_left");
        if (oLeft) iFooterTop = Math.max(iFooterTop, 180 + this.getElementHeight(oLeft));
        var oRight = this.getElementById ("div_right");
        if (oRight) iFooterTop = Math.max(iFooterTop, 180 + this.getElementHeight(oRight));
    
        this.setElementTop(oFooter, iFooterTop);
        this.setElementVisible(oFooter, true);

	var oOuter = this.getElementById("div_outer");
	if (oOuter) this.setElementHeight(oOuter, iFooterTop + this.getElementHeight(oFooter));
    }
}

/**********************************************************************************
*   PopupDescriptions
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*********************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}

var bw = new lib_bwcheck()

var descx = 0;
var descy = 0;
var oPopup = null;

function popmousemove(e){
    descx = bw.ns4||bw.ns6?e.pageX:event.x;
    descy = bw.ns4||bw.ns6?e.pageY:event.y;
}

function popup(i_sID, i_iLeftOffset, i_iTopOffset){
    popdown();

    oPopup = top.getElementById(i_sID);

	var iClientWidth = top.getClientWidth();
	var iPopupWidth = top.getElementWidth(oPopup);
	var iLeft = descx - p_iCenterLeft;
    if (i_iLeftOffset == -1)	{
        iLeft -= iPopupWidth;
    }
    else if (i_iLeftOffset) {
        iLeft += i_iLeftOffset;
	}
	iLeft = Math.min(iLeft, iClientWidth - iPopupWidth - p_iCenterLeft);
	iLeft = Math.max(iLeft, 0);
	if(bw.ie5||bw.ie6) iLeft=iLeft+document.body.scrollLeft;
	oPopup.style.left=iLeft;

	var iClientHeight = top.getClientHeight();
	var iPopupHeight = top.getElementHeight(oPopup);
	var iTop = descy - p_iCenterTop;
	if (i_iTopOffset == -1) {
	   iTop -= iPopupHeight;
	}
	else if (i_iTopOffset) {
	   iTop += i_iTopOffset;
	}
	iTop = Math.min(iTop, iClientHeight - iPopupHeight - p_iCenterTop);
	iTop = Math.max(iTop, 0);
	if(bw.ie5||bw.ie6) iTop=iTop+document.body.scrollTop;
	oPopup.style.top=iTop;
	
	oPopup.style.visibility='visible';
	return false;
}

function popdown(){
	if(oPopup) oPopup.style.visibility='hidden';
	oPopup = null;
}

function popdiv(i_sID){
	if (oPopup && oPopup.id == i_sID) return false;
	popdown();

	oPopup = top.getElementById(i_sID);
    if (!oPopup) return false;

	oPopup.style.visibility='visible';
	return false;
}

if(bw.ns4)document.captureEvents(Event.MOUSEMOVE);
if(bw.ns4)document.captureEvents(Event.MOUSEUP);
document.onmousemove = popmousemove;
document.onmouseup = popdown;

