var timer, timer2;


function setGalleryPosition()
	{
	var obj=document.getElementById("pictureZoom");

	if (!obj) return;
	obj.style.left=Math.max(0,(document.body.clientWidth - obj.clientWidth)/2)+"px";
	}


function showGallery(id)
	{
	var html, obj=document.getElementById("pictureZoom");
	
	if (!obj) return;
		
	if (obj.style.visibility=="visible")
		{
		obj=document.getElementById("viewer");
		if (typeof(obj.init)!="function") return;
		obj.init(id,zoomedPictIds);
		if (timer)
			{
			clearInterval(timer);
			timer=null;
			}
		return;		
		}
		
	obj.style.visibility="visible";
	setGalleryPosition();

	html='  <object type="application/x-shockwave-flash" data="Skins/pl/pictures/viewer.swf" width="400" height="350" id="viewer">';
	html+='    <param name="movie" value="Skins/pl/pictures/viewer.swf">';
	html+='    <param name="quality" value="high">';
	html+='    <param name="wmode" value="transparent">';
	html+='    <param name="allowScriptAccess" value="always">';
	html+='    <param name="allowFullScreen" value="false">';
	html+='    <param name="menu" value="false">';
	html+='  </object>';

	obj.innerHTML=html;
	obj=document.getElementById("viewer");
	if (typeof(obj.init)!="function")
		timer=setInterval("showGallery("+id+")",100);
	else
		obj.init(id,zoomedPictIds);
	}
	
	
function hideGallery()
	{
	var obj=document.getElementById("pictureZoom");
	
	if (!obj) return;
	obj.style.visibility="hidden";
	obj.innerHTML="";
	}
	
	
	
function initHeader()
	{
	var obj=document.getElementById("header");
	if (typeof(obj.init)!="function") return;
	clearInterval(timer2);
	timer2=null;
	obj.init(getHeaderFilesList());
	}
	
	
function startHeader()
	{
	if (typeof(getHeaderFilesList)!="function") return;
	timer2=setInterval(initHeader,500);	
	}


function getUrl()
	{
	return window.location.href;	
	}

MM_preloadImages('Skins/pl/pictures/icnPoint_f2.gif');

initClassObj.registerFunction(startHeader);

window.onload=init;
window.onresize=setGalleryPosition;