/* -----------------------------------------------
   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.
  ------------------------------------------------ */

// fullsize image size
var fullX = 375;
var fullY = 300;

function setVisible(obj,visible)
{
	obj = document.getElementById(obj);
	if( visible )
	{
		obj.style.visibility = 'visible';
	}
	else
	{
		obj.style.visibility = 'hidden';
	}
//	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
function placeIt(parent,obj)
{
	// Height of the window
	var height = 0;
	if( window.innerHeight )
	{
		height = window.innerHeight;
	}
	else
	{
		height = window.clientHeight;
	}

	// Calcluate the location of our thumb
	var offsetX = parent.offsetLeft;
	var offsetY = parent.offsetTop;
	parentElement = parent.offsetParent;
	while( parentElement != null )
	{
		offsetX += parentElement.offsetLeft;	
		offsetY += parentElement.offsetTop;
		parentElement = parentElement.offsetParent;
	}
	offsetX += parent.width;
/*
	offsetY += parent.height;
	if( offsetY + fullY >= height )
	{
		offsetY = offsetY - fullY;
	}
*/
	var theTop = 0;
	if( document.documentElement.scrollTop )
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if( document.body.scrollTop )
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	offsetY = theTop + ( fullY / 2 );

	// Move it 10 pixels to the right
	offsetX += 10; 

	obj = document.getElementById(obj);
	obj.style.left = offsetX + 'px' ;
	obj.style.top = offsetY + 'px' ;
}


