<!--

var winhandle = null;

function popUp(aURL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(aURL, '" + id + "', 'width=200, height=100, status=no, toolbar=no, menubar=no, resizable=yes, scrollbars=yes, location=no');");

  winhandle = eval("page" + id);
    with (winhandle.document){

	  writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	  writeln('<html><head>');
      writeln('<title>Fénykép<\/title>');
      writeln('<\/head>');
      writeln('<body style="background: black; margin: 0; padding: 0; text-align: center" onclick="javascript:window.close();" onload="window.resizeTo(document.gtrimage.width+30,document.gtrimage.height+62)">');
      writeln('<div style="position:absolute; float:center; top: 15px; z-index:-1; text-align: center; width: 200px"><p style="color: white; font-family:arial,verdana; font-size:11px; text-align: center"><b>Kép betöltése...<\/b><\/p><\/div>');
      writeln('<img name="gtrimage" src="' + aURL + '" style="display: block" border="0" alt="" />');
      writeln('<\/body><\/html>');
      close();
    }

  winhandle.focus();

}

function fullsize() {
  window.open(document.getElementById('galimage').src,"_blank");
}

function GallerypopUp(aURL, komment, gkw, gkh) {

  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );

  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  //return [ scrOfX, scrOfY ];

  var mypercent = (myHeight-70)/gkh;
  var meretezve = "nem";

  if (gkh > (myHeight-30)) {
  	gkw = (gkw*mypercent);
  	gkh = (gkh*mypercent);
  	meretezve = "igen";
  }

  var gpichpos = ((myHeight/2) - (gkh/2)) + scrOfY - 35;
  var gpicwpos = ((myWidth/2) - (gkw/2));

  document.getElementById('galkep').style.visibility = "visible";
  document.getElementById('galkep').style.width = "auto";
  document.getElementById('galkep').style.height = "auto";
  document.getElementById('galkep').style.padding = "10px 10px 3px 10px";
  document.getElementById('galkep').style.margin = "0px";
  document.getElementById('galkep').style.position = "absolute";
  document.getElementById('galkep').style.background = "white";
  document.getElementById('galkep').style.top = gpichpos+"px";
  document.getElementById('galkep').style.left = gpicwpos+"px";
  document.getElementById('galkep').style.border = "2px solid #dee6eb";

  document.getElementById('galimage').src = aURL;
  document.getElementById('galimage').style.width = gkw+"px";
  document.getElementById('galimage').style.height = gkh+"px";

  if (meretezve == "igen") {document.getElementById('nagyito').style.visibility = "visible";}
  else {document.getElementById('nagyito').style.visibility = "hidden";}

  var dataNode = document.createTextNode(komment);
  var d1 = document.getElementById('galkep');
  var d2 = document.getElementById('galkomment');
  var d_new = document.createElement("p");
  d_new.setAttribute("id","galkomment");
  d_new.setAttribute("class","tx-galeria");
  d1.replaceChild(d_new, d2);
  var d2 = document.getElementById('galkomment');
  d2.appendChild(dataNode);
  document.getElementById('galkomment').outerHTML = "<p class=\"tx-kozep-nagy\" id=\"galkomment\" style=\"font-family:tahoma,arial,verdana;color:#333;font-size:11px;text-align:center;margin:0px;margin-top:2px;margin-bottom:3px;padding:3px;border:0px;border-top:1px solid #ced6db;background:#dee6eb;\">"+komment+"</p>";
  document.getElementById('galkomment').innerHTML = komment; //for firefox not to display html tags as text

  document.getElementById('galkomment').style.width = (gkw-4)+"px";
  if (document.getElementById('galkep').offsetWidth < 300) {document.getElementById('galkep').style.width = "300px";document.getElementById('galkomment').style.width = "300px";}
  if (navigator.userAgent.match("pera")) { // for fucken opera
   	document.getElementById('galkep').style.width = gkw+"px";
   	document.getElementById('galkomment').style.width = (gkw-6)+"px";
   	if (document.getElementById('galkep').offsetWidth < 300) {
   	  document.getElementById('galkep').style.width = "300px";
   	  document.getElementById('galkomment').style.width = "294px";
   	}
  }
  document.getElementById('magnifier').style.width = (document.getElementById('galkep').offsetWidth-6)+"px";
  gpicwpos = ((myWidth/2) - (document.getElementById('galkep').offsetWidth/2));
  document.getElementById('galkep').style.left = gpicwpos+"px";

}

//-->

