// 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

var popbackground="#5280ba" //specify backcolor or background image for pop window
var windowtitle="Obrazek z galerie"  //pop window title
var jkstylesheet="http://foto.solvayovylomy.cz/stylindex.css";
var imgdbno=0;            // cislo zobrazovaneho obrazku     

function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){
popwidth=popwidth*1;opopwidth=popwidth;
popheight=popheight*1;opopheight=popheight;

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()

var maxHeight=window.screen.availHeight;
var winattributes='';

if (popwidth<770) {popwidth=770;}; // pro uzzsi stranky blbne sirka

var addWidth=0;
if (popheight>maxHeight-30)
 {popheight=maxHeight-30;
 winattributes=winattributes+'scrollbars=yes,';
 toppos=0;
 addWidth=16;
 };
popwidth=popwidth+addWidth;
winattributes=winattributes+'width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos

var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"';
if (popbackground=="") bodyattribute="";
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()
//if(imgdbno>0){jkpopwin.location.search='?img='+imgdbno;}
jkpopwin.document.write('<html>\n<head>\n<meta http-equiv=Content-Type content="text/html; charset=windows-1250">\n<title>'+windowtitle+'</title>\n')
if(jkstylesheet)
{jkpopwin.document.write('<link rel="stylesheet" href="'+jkstylesheet+'">')
}
jkpopwin.document.write('</head>\n<body class="album_okno" '+bodyattribute+'>')
jkpopwin.document.write('<center><img  galleryimg="false" src="'+imgpath+'" style="margin-bottom: 0.5em" ONCLICK="window.close();" title="Kliknutim na obrazek stranku zavrete"><br>\n<div class="legenda">'+textdescription+'</div>\n<h6>kliknutim na obrazek se stranka zavre')
// jkpopwin.document.write(' '+opopwidth+' '+opopheight+' '+popwidth+' '+popheight)
jkpopwin.document.write('</h6></center>')
jkpopwin.document.write('</body></html>')
jkpopwin.document.close()
jkpopwin.focus()
}


