/**
 * Open popup with full size image.
 * JK Pop up image viewer script - By JavaScriptKit.com
 * Visit JavaScript Kit (http://javascriptkit.com)
 * for free JavaScript tutorials and scripts
 * This notice must stay intact for use
 *
 * Modified on 2006-12-05 by Luc
 */

var popbackground="#ffffff"; //specify backcolor or background image for pop window
var windowtitle="Alfa-System - zdjęcie";  //pop window title

function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, loc){
var leftpos=0;
var toppos=0;
function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos();
//leftpos and toppos was replaced by 60,60.
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+60+',top='+60
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
bodyattribute += ' style="margin: 0px; padding:0px;"';
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>'+windowtitle+'</title><body '+bodyattribute+'>');
jkpopwin.document.write('<div style="position: absolute; top: 0px; right: 0px; width: 95px; height: 27px; z-index: 2; text-align: right;"><a href="javascript:void(null);" onClick="window.close(); return false;"><img src="'+loc+'images/close.gif" alt="" width="95" height="27" border="0" /></a></div>');
jkpopwin.document.write('<img src="'+imgpath+'" style="position: absolute; top: 27px;">');
jkpopwin.document.write('</body></html>');
jkpopwin.document.close()
jkpopwin.focus()
}
