﻿/* -----------------------------------------------
   Floating layer - v.1
   (c) 2006 www.haan.net
   contact: jeroen@haan.net
   You may use this script but please leave the credits on top intact.
   Please inform us of any improvements made.
   When usefull we will add your credits.
  ------------------------------------------------ */

//popUpX = 20;
//popUpY = 70;
function setVisible(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
function placeIt(obj)
{
	setTimeout("placeIt('" + obj + "')",500);
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += popUpX;
	theTop += popUpY;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	obj.style.zIndex = "1005";
}

function placeItStill(obj)
{
	//setTimeout("placeIt('" + obj + "')",500);
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += popUpX;
	theTop += popUpY;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	obj.style.zIndex = "1005";
}

function backgroundFilter(objId)
{
    var div;
    if(document.getElementById)
        div = document.getElementById(objId);

    else if(document.all)
        div = document.all[objId];   

    // if the style.display value is blank we try to check it out here
    if(div.style.display== '' && div.offsetWidth != undefined && div.offsetHeight != undefined)
    {
        div.style.display = (div.offsetWidth != 0 && div.offsetHeight != 0) ? 'block':'none';
    }
    div.style.display = (div.style.display == '' || div.style.display == 'block') ? 'none':'block';
}
