var IsOpen=false;
function ShowIt(url,name,width,height,close){
	if (IsOpen) pr.close();
	pr = window.open('about:blank','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=yes,top=10,left=10,width='+(width+27)+',height='+(height+27));
	IsOpen=true;
	pr.document.open();
	pr.document.write('<?xml version="1.0" encoding="windows-1250" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sk" lang="sk">\n');
	pr.document.write('	<head>\n');
	pr.document.write('		<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />\n');
	pr.document.write('		<title>'+name+'</title>\n');
	pr.document.write('		<meta name="MSSmartTagsPreventParsing" content="true" />\n');
	pr.document.write('		<meta http-equiv="imagetoolbar" content="no" />\n');
	pr.document.write('		<meta http-equiv="MSThemeCompatible" content="no" />\n');
	pr.document.write('		<link rel="stylesheet" type="text/css" href="atelier-maria/styles/popup.css" />\n');
	pr.document.write('	</head>\n');
	pr.document.write('<body onload="self.focus();Isopen=1;" onclick="window.close();IsOpen=0;" >\n');
	pr.document.write('	<a href="#" onclick="window.close();" title="'+close+'"><img src="'+url+'" border="0" alt="'+close+'" /></a>\n');
	pr.document.write('</body>\n');
	pr.document.write('</html>\n');
	pr.document.close();
	return false;
}

function CenterContent(){
 document.getElementById("content").style.left=(document.getElementsByTagName("html")[0].offsetWidth-780)/2+'px';
}

function zeroFill( number, width )
{
  width -= number.toString().length;
  if ( width > 0 )
  {
    return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number;
  }
  return number;
}


$(document).ready(function() {
       
    $("a[class^='IMGOver']").each(function(index)
    {        
        $(this).css('position', 'absolute');
        $(this).css('border', 'red');
        var posi = $('img#img'+zeroFill(index+1,3)).position();
        //if (posi == null) alert(index);        
        $(this).css('top', posi.top+'px');
        $(this).css('left', (posi.left-8)+"px");
    });
});