function popUp(myURL,myWidth,myHeight,myName) {
if(myName=='')
{
	var day=new Date();
	var myName='a'+day.getTime();		
}

var winl = (screen.width-myWidth)/2;
var wint = (screen.height-myHeight-20)/2;
var settings ='height='+myHeight+',';
settings +='width='+myWidth+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=1,';
settings +='status=0,';
settings +='resizable=1';
win=window.open(myURL,myName,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}

}

function pokaz(fotoName, width, height)
{
	popUp('pokaz.php?p='+fotoName,parseInt(width)+20,parseInt(height)+20,'');
}

function bindPopups()
{
	var links = document.getElementsByTagName("a");
	var len = links.length;
	for(var i=0; i<len; i++)
	{
		if(links[i].className == "thumb")
		{	
			links[i].onclick = function()
			{
				pokaz(this.href, this.attributes.popw.value, this.attributes.poph.value);
				return false;
			}
		}
	}
	
}
