var macTimeout1;
var macTimeout2;
var ie = ( navigator.appName.indexOf("Microsoft") != -1 );
var mac = (navigator.appVersion.indexOf("Mac") != -1);
var macIE = ie && mac;
var safari = (navigator.appVersion.indexOf("Safari") != -1);
var nscp = ( (navigator.appName == "Netscape") && ( ! safari ) );
var vers = parseFloat(navigator.appVersion.substring(22,25));
var isNS6 = (!document.all && document.getElementById) ? true : false;
var ismc = mac;
var isie = ie;
var issafari = safari;

onload = function() {
}

function waiting() {
}

function getTop(obj)
{
	var topVal;
	if (isNS6)
	{
		topVal = getLayer(obj).offsetTop;
	}
	else
	 if (nscp)
	{	topVal = getLayer(obj).top;
	}
	else
	{	topVal = getLayer(obj).offsetTop;
	}
	return topVal;
}

// function to show layer

function show(layr)
{	obj = getObj(layr);
	obj.visibility = "visible";
}

// function to hide layer

function hide(layr)
{	obj = getObj(layr);
	obj.visibility = "hidden";
}


function getBottom(obj)
{
	var bottVal;
	if (isNS6)
	{
		bottVal = getLayer(obj).offsetTop;
	}
	else
	 if (nscp)
	{	bottVal = getLayer(obj).top;
	}
	else
	{	bottVal = (getLayer(obj).style.posTop?getLayer(obj).style.posTop:getLayer(obj).offsetTop);
	}
	bottVal += layerHeight(obj);
	return bottVal;
}

function getLayer(obj)
{
	if (isNS6)
	{
		compLayr = document.getElementById(obj);
	}
	else
	 if (nscp)
	{	compLayr = document.layers[obj];
	}
	else
	{	compLayr = eval("document.all." + obj);
	}
	return compLayr
}

function getObj(obj)
{
	if (isNS6)
	{
		compLayr = document.getElementById(obj).style;
	}
	else
	 if (nscp)
	{	compLayr = document.layers[obj];
	}
	else
	{	compLayr = eval("document.all." + obj + ".style");
	}
	return compLayr
}

function setTop(layr,num)
{	obj = getObj(layr)
    obj.position = 'absolute';
	if (isNS6)
	{	obj.top = num + "px";
	}
	else
	if (nscp)
	{	obj.top = num;
	}
	else
	{	obj.posTop = num;
	}
	    // IF its a Mac and its IE (NOT NETSCAPE)
        if ( ( ismc ) && ( document.all || issafari ) )
        {
            clearTimeout(macTimeout1);
            clearTimeout(macTimeout2);
            macTimeout1 = setTimeout("window.resizeBy(1,1);",100);
            macTimeout2 = setTimeout("window.resizeBy(-1,-1);",200);
        }
}

function findBottom() {
    var lowestPoint = 600;
    if ( isNS6 ) {
        for ( i = 0 ; i < document.getElementsByTagName("DIV").length ; i++ ) {
            var currChild = document.getElementsByTagName("DIV").item(i);
            var bttm = currChild.offsetTop + currChild.offsetHeight;
            if ( bttm > lowestPoint ) {
                lowestPoint = bttm;
            }
        }
    }
    else if ( nscp ) {
        lowestPoint = document.height;
        for ( i = 0 ; i < document.layers.length ; i++ ) {
            var currChild = document.layers[i];
            var bttm = currChild.top + currChild.document.height;
            if ( bttm > lowestPoint ) {
                lowestPoint = bttm;
            }
        }
    }
    else {
        for ( i = 0 ; i < document.body.children.length ; i++ ) {
            var currChild = document.body.children.item(i);
            var bttm = currChild.offsetTop + currChild.offsetHeight;
            if ( bttm > lowestPoint ) {
                lowestPoint = bttm;
            }
        }
    }
    return(lowestPoint);
}

function layerHeight(layr)
{
	if (isNS6)
	{
		return (parseInt(document.getElementById(layr).offsetHeight));
	}
	else
	if (nscp)
	{	return eval("document.layers['" + layr + "'].clip.height");
	}
	else
	{	return eval("document.all." + layr + ".offsetHeight");
	}
}

function getWidth(layr)
{
	return layerWidth(layr);
}

function getHeight(layr)
{
	return layerHeight(layr);
}
function layerWidth(layr)
{
	if (isNS6)
	{
		return (parseInt(document.getElementById(layr).style.width));
	}
	else
	if (nscp)
	{	return eval("document.layers['" + layr + "'].clip.width");
	}
	else
	{	return eval("document.all." + layr + ".scrollWidth");
	}
}
function setHeight(layr,num)
{	obj = getObj(layr)
	if (isNS6)
	{	obj.height = num + "px";
	}
	else
	if (nscp)
	{	obj.clip.height = num;
	}
	else
	{	obj.height = num;
	}
	    // IF its a Mac and its IE (NOT NETSCAPE)
        if ( ( ismc ) && ( document.all ) )
        {
            clearTimeout(macTimeout1);
            clearTimeout(macTimeout2);
            macTimeout1 = setTimeout("window.resizeBy(0,1);",100);
            macTimeout2 = setTimeout("window.resizeBy(0,-1);",200);
        }
}


function setLeft(layr,num)
{	obj = getObj(layr)
    obj.position = 'absolute';
	if (isNS6)
	{	obj.left = num + "px";
	}
	else
	if (nscp)
	{	obj.left = num;
	}
	else
	{	obj.posLeft = num;
	}
	    // IF its a Mac and its IE (NOT NETSCAPE)
        if ( ( ismc ) && ( document.all ) )
        {
            clearTimeout(macTimeout1);
            clearTimeout(macTimeout2);
            macTimeout1 = setTimeout("window.resizeBy(0,1);",100);
            macTimeout2 = setTimeout("window.resizeBy(0,-1);",200);
        }
}

