ow.gallery={th:3,init:function(h){if(ow.$(h)){var f=ow.$(h).id.replace(/Gallery/,"");if(ow.$(f+"ImgList").getElementsByTagName("li").length>ow.gallery.th){var e='<span id="'+f+'Prev" class="ctrlPrev" title="Poprzednie zdjęcie" style="display:none;"></span><span id="'+f+'Next" class="ctrlNext" title="Następne zdjęcie"></span>';var d=ow.$(f+"ImgList").parentNode.innerHTML;ow.$(f+"ImgList").parentNode.innerHTML=e+d;ow.$(f+"Prev").onclick=function(){ow.gallery.prev(f);return false};ow.$(f+"Next").onclick=function(){ow.gallery.next(f);return false};for(i=0;i<ow.$(f+"ImgList").getElementsByTagName("li").length;i++){ow.$(h).getElementsByTagName("li")[i].style.display=(i>=ow.gallery.th)?"none":"block"}var c=document.createElement("span");ow.$(f+"ImgBox").getElementsByTagName("a")[0].appendChild(c);var g=ow.$(f+"ImgList").getElementsByTagName("img")[0].alt;ow.$(f+"ImgBox").getElementsByTagName("img")[0].alt=g;ow.$(f+"ImgBox").getElementsByTagName("span")[0].innerHTML=g}if(ow.$(f+"ImgList").getElementsByTagName("li").length>1){ow.$(f+"ImgList").className="imgList";var b=ow.$(f+"ImgList").getElementsByTagName("a");var a=ow.$(f+"ImgList").getElementsByTagName("img");for(i=0;i<b.length;i++){a[i].id="photoThumb"+i;b[i].onclick=function(){var k=this.getElementsByTagName("img")[0].src.replace(/80x60/,"300x225");var j=this.getElementsByTagName("img")[0].id.replace(/photoThumb/,"photoMiddle");var l=this.getElementsByTagName("img")[0].alt;ow.$(f+"ImgBox").getElementsByTagName("img")[0].src=k;ow.$(f+"ImgBox").getElementsByTagName("img")[0].id=j;ow.$(f+"ImgBox").getElementsByTagName("img")[0].alt=l;return false};b[i].onmouseover=function(){var j=this.getElementsByTagName("img")[0].alt;ow.$(f+"ImgBox").getElementsByTagName("span")[0].innerHTML=j};b[i].onmouseout=function(){var j=ow.$(f+"ImgBox").getElementsByTagName("img")[0].alt;ow.$(f+"ImgBox").getElementsByTagName("span")[0].innerHTML=j}}}else{if(ow.$(f+"ImgList").getElementsByTagName("li").length<=1){ow.$(f+"ImgList").style.display="none"}}ow.$(f+"ImgBox").getElementsByTagName("img")[0].id="photoMiddle0";ow.$(f+"ImgBox").getElementsByTagName("a")[0].onclick=function(){var j=ow.$(f+"ImgBox").getElementsByTagName("img")[0].id.replace(/photoMiddle/,"");var p='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';p+='<html xmlns="http://www.w3.org/1999/xhtml">';p+="<head>";p+='<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';p+="<title>otoWakacje - Galeria</title>";p+='<link rel="stylesheet" media="all" type="text/css" href="/0/css/styleDecorPopup.css?v=2" />';p+='<script type="text/javascript" src="/0/scripts/min/ow.gallery-popup.js?v=2"><\/script>';p+="</head>";p+='<body onload="gallery.init('+j+')">';var k;m=ow.$(f+"ImgList").getElementsByTagName("li").length;if(m>1){p+='<div id="imageList"><div>';for(var n=0;n<m;n++){p+='<img src="'+ow.$(f+"ImgList").getElementsByTagName("img")[n].src.replace(/300x225/,"80x60")+'" alt="'+ow.$(f+"ImgList").getElementsByTagName("img")[n].alt+'" />'}}else{p+='<div id="imageList" style="display:none"><div>';p+='<img src="'+ow.$(f+"ImgList").getElementsByTagName("img")[0].src.replace(/300x225/,"80x60")+'" alt="'+ow.$(f+"ImgList").getElementsByTagName("img")[0].alt+'" />';k=' style="display: none"'}p+="</div></div>";p+='<div id="contentBox">';p+='<div id="imageBox" onclick="window.close()"></div>';p+='<span id="imageTitle"></span>';p+='<a id="prevImage"'+k+' class="toLeft" onclick="gallery.prev();"><span>&laquo;</span></a>';p+='<a id="nextImage"'+k+' class="toRight" onclick="gallery.next();"><span>&raquo;</span></a>';p+="</div>";p+="</body>";p+="</html>";var r=(screen.width)<820?(screen.width):820;var o=(screen.height)<700?(screen.height):700;var s=(screen.height)?(screen.height-o)/2:0;var m=(screen.width)?(screen.width-r)/2:0;var q=window.open("","","top="+s+",left="+m+",width="+r+",height="+o+",toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=yes,fullscreen=no");q.document.open();q.document.write(p);q.document.close();q.focus();return false}}},ctrl:function(b,a){ow.$(b+"Prev").style.display=(a[0].style.display=="none")?"block":"none";ow.$(b+"Next").style.display=(a[a.length-1].style.display=="none")?"block":"none"},prev:function(b){var a=ow.$(b+"ImgList").getElementsByTagName("li");if(a[0].style.display=="none"){for(i=a.length-1;i>=0;i--){if(a[i].style.display!="none"){a[i].style.display="none";break}}for(i--;i>=0;i--){if(a[i].style.display=="none"){a[i].style.display="block";break}}}ow.gallery.ctrl(b,a)},next:function(b){var a=ow.$(b+"ImgList").getElementsByTagName("li");if(a[a.length-1].style.display=="none"){for(i=0;i<a.length;i++){if(a[i].style.display!="none"){a[i].style.display="none";break}}for(i++;i<a.length;i++){if(a[i].style.display=="none"){a[i].style.display="block";break}}}ow.gallery.ctrl(b,a)}};