/* -----------------------------------------------
   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 setVisible(obj)
{
	obj = document.getElementById(obj);
	if (obj.style.visibility == 'visible') obj.innerHTML = '';
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}

function showTab(id)
{
	var i = 0;
	while (document.getElementById('tab' + i)) {
			document.getElementById('tab' + i).style.display = 'none';
			if (document.getElementById('tablist' + i))
				document.getElementById('tablist' + i).className = '';
			i++;
	}
	document.getElementById('tab' + id).style.display = 'block';
	document.getElementById('tablist' + id).className = 'current';
}

function loadTab() {
	var loc = (document.location.href);
	if (loc.lastIndexOf("#table") > 0)
		showTab(loc.substr(loc.lastIndexOf("#table")+6));
}

function placeIt(obj, objw, objh, content)
{
	var objstr = obj;
	obj = document.getElementById(obj);

	if (!obj) return 0;

	var sw = 800;
	if (window.innerWidth) sw = window.innerWidth;
	else if (document.documentElement && document.documentElement.clientWidth) sw = document.documentElement.clientWidth;
		else if (document.body && document.body.clientWidth) sw = document.body.clientWidth;

	var sh = 600;
	if (window.innerHeight) sh = window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight) sh = document.documentElement.clientHeight;
		else if (document.body && document.body.clientHeight) sh = document.body.clientHeight;

	var objleft = Math.round((sw - objw - 26)/2);
	if (objleft < 0) objleft = 0;
	var objtop = Math.round((sh - objh - 48)/2);
	if (objtop < 0) objtop = 0;
	
	obj.style.left = objleft + 'px' ;
	obj.style.top = objtop + 'px' ;
	obj.style.width = objw + 'px' ;
	obj.style.height = objh + 'px' ;
	obj.style.visibility = 'visible';
	if (content != '') setTimeout("writeContent('"+objstr+"','"+content+"')", 500);
}

function writeContent(obj, content)
{
	var objstr = obj;
	obj = document.getElementById(obj);
	obj.innerHTML = "<div class=\"close\"><a href=\"javascript:setVisible('layer1')\">[X]</a></div>" + content + "<div class=\"close\"><a href=\"javascript:setVisible('layer1')\">[X]</a></div>";
}

function showLayers()
{
	setTimeout("placeIt('layer1', 600, 600, '<object id=\"FLVPlayer\" type=\"application/x-shockwave-flash\" data=\"/pf/FLVPlayer_Progressive.swf\" width=\"600\" height=\"514\"><param name=\"movie\" value=\"/pf/FLVPlayer_Progressive.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"opaque\" /><param name=\"scale\" value=\"noscale\" /><param name=\"salign\" value=\"lt\" /><param name=\"FlashVars\" value=\"&amp;MM_ComponentVersion=1&amp;skinName=/pf/Clear_Skin_3&amp;streamName=/pf/truck-trade-01&amp;autoPlay=true&amp;autoRewind=false\" /><param name=\"swfversion\" value=\"8,0,0,0\" /><param name=\"expressinstall\" value=\"/pf/Scripts/expressInstall.swf\" /><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p></div></object><br><br><p align=\"center\"><b>Pro správné zobrazení je nutný aktivní doplněk prohlížeče Adobe Flash Player.<br>Zapněte si, prosím, zvuk na svém počítači.</b></p>')", 1000);
}

function docHeight()
{
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
		else if (document.body && document.body.clientHeight) return document.body.clientHeight;
			else return 0;
}

/*
var doc_height = docHeight();
if (doc_height > 627)
{
	var main_height = doc_height - 95;
	document.getElementById("main").style.height = main_height.toString() + 'px';
}*/
