// JavaScript Document
var assetsSwf = "assets/swf/";

function hideShow(id)
{
  if(document.getElementById(id).style.display =='none'){soh = '';}
  else{soh = 'none';}
  document.getElementById(id).style.display = soh;
}

function genLaySWF(src, width, height, bg)
{	
	if(!document.getElementById(src) )
	{
		var flashLay = document.createElement("div");
			flashLay.id = src;			
			flashLay.className = "HidenLaySTR";
			flashLay.style.zIndex  = 10000;
			flashLay.style.display = "none";
		document.body.insertBefore(flashLay, document.body.firstChild);
		if (!bg) {bg="#000000"; tr="transparent"}
		else{tr="window"}
		var so = new SWFObject(assetsSwf+src, "swf", width, height, "8", bg);
			so.addParam("quality", "high");
			so.addParam("wmode", tr);
			so.write(src);			
	}
	showLay(src)
}


function showLay(ID)
{


var lay = document.getElementById(ID);
//document.body.parentNode.
//document.body.

if( !document.getElementById(ID+"in") )
		{			
				
		var PageHeightTable = [ document.documentElement.clientHeight, 
							   	document.documentElement.scrollHeight,
								document.documentElement.offsetHeight ]
		PageHeightTable.sort();
		var lng = PageHeightTable.length;
		var PageHeight = PageHeightTable[lng-1];
		
		var PageWidth = document.body.parentNode.clientWidth || document.body.offsetWidth;
		var scrlTP = document.documentElement.scrollTop || document.body.scrollTop ;
		//alert(document.documentElement.scrollTop+" "+document.body.scrollTop);
		lay.id = ID+'in';
		
		lay.style.display = "";		
		lay.style.top = PageHeight /2 + scrlTP - lay.scrollHeight/2 + "px"; //
		
		//lay.style.position = "fixed";

		lay.style.left = ((PageWidth - lay.scrollWidth)/2)  + "px" ;
		//alert(document.getElementById(ID+"in").scrollWidth);
		
		var objOverlay = document.createElement("div");
		var Out = document.createElement("div");
										  Out.style.overflow	= 'hidden';
			objOverlay.style.position 	= Out.style.position 	= 'absolute';
			objOverlay.style.background 						= '#000000';
			objOverlay.style.width 		= Out.style.width 		= PageWidth +"px";
			objOverlay.style.height 	= Out.style.height 		= PageHeight+"px";			
			objOverlay.style.top 		= Out.style.top 		= '0px';
			objOverlay.style.zIndex 	= Out.style.zIndex		= lay.style.zIndex - 1;
			
			objOverlay.style.opacity 	= 0.7;
			objOverlay.style.filter 	= 'alpha(opacity = 70)';
			
			objOverlay.id = ID+"bg";
			Out.id = ID;
			Out.appendChild(lay);
			Out.appendChild(objOverlay);
			document.body.appendChild(Out);
			document.getElementById(ID+"in").innerHTML+='<div class="center"><a onclick=\"hideShow(\''+ID+'\')\">Zamknij</a></div>';	
			document.getElementById(ID).innerHTML+='<\!\-\-[if lte IE 6.5]><iframe class=\"IframeFIX\"></iframe><\![endif]\-\->';
				
			
			
			

	}
	
	else
	{
		hideShow(ID);
		
	}
}

function MTO(id) {
	
	parent.location.href = "mailto:"+id+"@szami.pl";	
}
function STO(id) {
	parent.location.href = "skype:"+id+"?chat";	
}
function GTO(id) {
	parent.location.href = "gg:"+id;
}





