/*  Copyright (c) 2001-2005 FOX Software Sp. z o.o. author: marcin.lisok@fox.com.pl */
var op = /opera/i.test(navigator.userAgent);
var ie = !op && /msie/i.test(navigator.userAgent);	     
var mz = !op && /mozilla\/5/i.test(navigator.userAgent); 

function loadFile( fileurl ) {
  if (ie) {
    var myXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP"); 
  } else { 
    var myXMLHTTPRequest = new XMLHttpRequest(); 
  }
  if (myXMLHTTPRequest != null) {
    myXMLHTTPRequest.open("GET", fileurl, false);
    myXMLHTTPRequest.send(null);
    return myXMLHTTPRequest.responseText;
  } else return "";
}

function popUp( imgid, imgnr, extra ) {
  var width  = screen.width; 
  var height = screen.height;
  var title  = "";
  var txt = loadFile('/getimagesize.php?id='+imgid+'&amp;nr='+imgnr);
  var arr = txt.split('|');
  if (arr.length > 0) {
    for (i=0;i<arr.length;i++) {
      if (arr[i].indexOf('width=') == 0)  { width  = parseInt(arr[i].substring(6)) } else
      if (arr[i].indexOf('height=') == 0) { height = parseInt(arr[i].substring(7)) } else
      if (arr[i].indexOf('title=') == 0)  { title  = arr[i].substring(6) }
    }
  }

  var scroll = "";
  if (width > screen.width) {
    width = screen.width - 40;
    scroll = "resizable,scrollbars";
  }
  if (height > screen.height) {
    height = screen.height - 120;
    scroll = "resizable,scrollbars";
  }
  
  var left = Math.round((screen.availWidth-width)/2);
  var top = Math.round((screen.availHeight-height)/2);
	var url = "/thumb.php?id="+imgid+"&nr="+imgnr;
  open( url,"","width="+width+",height="+height+",top="+top+",left="+left+","+scroll);
}

function zapamietaj( id ) {
  var txt = loadFile('/oferty/zapamietaj/'+id);
}

