/* -----------------------------------------------
   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.
  ------------------------------------------------ */

function showObj(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = 'visible';
}

function hideObj(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = 'hidden';
}


function showBigPopup() {
	popup_length = 100;
	p_x = document.getElementById('big_photo').offsetLeft+document.getElementById('big_photo').width-popup_length+1;
	p_y = document.getElementById('big_photo').offsetTop;
	placeIt('popup_big',p_x,p_y);
	//placeIt('flashcontent',p_x,p_y);
	//hideObj('flashcontent');
	hideObj('popup_small');	
	showObj('popup_big');
}


function showSmallPopup() {
	popup_length = 101;
	p_x = document.getElementById('big_photo').offsetLeft+document.getElementById('big_photo').width-popup_length-1;
	p_y = document.getElementById('big_photo').offsetTop+document.getElementById('big_photo').height;
	placeIt('popup_small',p_x,p_y);
	//hideObj('flashcontent');
	hideObj('popup_big');
	showObj('popup_small');
}




function placeIt(obj,p_x,p_y)
{

	x = p_x;
	y = p_y;
	
	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 += x;
	theTop += y;*/
	
	theLeft = x;
	theTop = y;
	
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	

	
	//setTimeout("placeIt('layer1')",500);
}


function showAuctionPopup() {
	p_x = document.getElementById('btn_insert').offsetLeft-300;
	p_y = document.getElementById('btn_insert').offsetTop;
	//p_x = 100;
	//p_y = 100;
	
	placeIt('popup_auction',p_x,p_y);
	showObj('popup_auction');
}

function hideAuctionPopup() {
	hideObj('popup_auction');
}

