var USED_FOR_PAGE=".";var voliviewerVersion="1.6.6";var IS_VOLIVIEWER_OPENED_ON_IMAGE_CLICK=eval(getCookie("isImgOpenOnClick"))||true;var IS_OLDIMGMOVE_ALLOWED=false;var IS_OVER_IMAGE_LAYOUT=true;var IS_ALLOWED_VIEW_IMAGES_OF_VIDEOS=true;var IS_BEAUTIFUL_SLIDESHOW=false;var MIN_IMGPANEL_WIDTH=420;var MIN_IMGPANEL_HEIGHT=400;var SLIDESHOW_STATES=[['doprava','3s',"right"]];var MIN_TIME_TO_SHOW_IMAGE_IN_SLIDESHOW=800;var IMAGE_DESCRIPTION_PLACE=0;var navigationButtons=['první','doleva','doprava','poslední','zavřít','otevřít prohlížeč obrázků','zmenšit do okna prohlížeče','zvětšit do původní velikosti','vypnout centrování obrázku','zapnout centrování obrázku','načítání obrázku...','Zobrazit detaily obrázku','Odeslat pohlednici','Galerie tohoto obrázku','Původní velikost obrázku','Přehrát','Z galerie','poslat fotku jako pohlednici','zobrazit detail fotky','na straně','Spustit/zastavit'];var request=null;var isCacheStarted=false;var connAsynchronous=false;var areImagesLoaded=false;var ANIMATION_TIME=10;var DEFAULT_OPACITY_VALUE=80;var MAX_OPACITY_OVERIMGLAYOUT=10;var MIN_STEP_OLDIMAGE=40;var BORDER_AROUND_IMAGE=10;var BORDER_AROUND_IMAGE_TOP_OFFSET=40;var opacityValue=100;var images=Array();var imagesObj=null;var imgL=new Image();var timer1=null;var timer2=null;var timer3=null;var timer4=null;var timer5=null;var timer6=null;var timer7=null;var timer8=null;var timer9=null;var timer10=null;var oldScrollPosX;var oldScrollPosY;var isSetScrollPos=false;var screenWidth;var screenHeight;var browserWidth;var browserHeight;var actualObjectID=null;var oldImgSrc=null;var oldImgPosX=0;var oldImgPosY=0;var oldImgPosX_step=0;var oldImgWidth=0;var oldImgHeight=0;var isViewerOpened=false;var isViewerStarting=false;var isMoveLeft=true;var arrowLeft=null;var arrowRight=null;var slideshowWay="right";var slideshowInfo="--";var floatInfoPanelText="";var errorsCount=0;var img_pos=0;var imagesTestingCount=0;var areImagesCached=false;var areImagesPrepared=false;var isOneCycleError_Slideshow=false;var slideshow_imagesLoadErrorsCount=0;var isImageShowed=false;var slideshowTime=0;var cont_0=null;var cont_1=null;var cont=null;var wasSlideshow=false;var slideshowDefColor="";var isImageInfoWorking=false;var isFirstImg=true;var nextGalleryPages={previous:null,next:null};var isNextPageCrossingEnabled=true;var galleryPagesCount=1;var pagesURL=new Array();var slideshowSeconds=0;var actualPageIndex=getActualPageIndex(location.href);var isAnyAvailableImage=false;var IMAGES_CONTAINER_NAME="nahledy"
var PATH_TO_VOLIVIEWER_IMAGES="/aspinclude/vismoweb5/html/images/voliviewer/";var CLICKABLE_VIDEO_AREA_WIDTH=60;var CLICKABLE_VIDEO_AREA_HEIGHT=60;var isFirstImageInSlideshowStarted=false;var isSlideshowRunning=false;var IS_SLIDESHOW_CYCLING=false;var isFirstImageShowed=true;var areCSSFilesLoaded=false;timer4=setTimeout(function(){if(location.href.indexOf(USED_FOR_PAGE)>-1){createRequestObject();prepareImages(0);initCSSFile();}},0);function prepareTitles(v1,v2,v3,v4,v5,v6){SLIDESHOW_STATES=[[v2,'3s',"right"]];navigationButtons=[v3,v1,v2,v4,v5.split(';')[0],v6,v5.split(';')[1]?v5.split(';')[1]:navigationButtons[6],v5.split(';')[2]?v5.split(';')[2]:navigationButtons[7],v5.split(';')[3]?v5.split(';')[3]:navigationButtons[8],v5.split(';')[4]?v5.split(';')[4]:navigationButtons[9],v5.split(';')[5]?v5.split(';')[5]:navigationButtons[10],v5.split(';')[6]?v5.split(';')[6]:navigationButtons[11],v5.split(';')[7]?v5.split(';')[7]:navigationButtons[12],v5.split(';')[8]?v5.split(';')[8]:navigationButtons[13],v5.split(';')[9]?v5.split(';')[9]:navigationButtons[14],v5.split(';')[10]?v5.split(';')[10]:navigationButtons[15],v5.split(';')[11]?v5.split(';')[11]:navigationButtons[16],v5.split(';')[12]?v5.split(';')[12]:navigationButtons[17],v5.split(';')[13]?v5.split(';')[13]:navigationButtons[18],v5.split(';')[14]?v5.split(';')[14]:navigationButtons[19],v5.split(';')[15]?v5.split(';')[15]:navigationButtons[20]];}
function prepareImages(beginFrom){areImagesCached=false;if(!document.body){timer4=setTimeout(function(){prepareImages(beginFrom);},5);return;}
img_pos=0;try{if(location.href.indexOf(USED_FOR_PAGE)>-1){cont_1=document.body.getElementsByTagName("*");cont=null;for(var j=0;j<cont_1.length;j++){if(cont_1[j].className==IMAGES_CONTAINER_NAME||cont_1[j].className.indexOf(" "+IMAGES_CONTAINER_NAME)>-1||cont_1[j].className.indexOf(IMAGES_CONTAINER_NAME)==0){cont=cont_1[j];if(cont){var imgs=cont.getElementsByTagName("a");for(i=0;i<imgs.length;i++){if(imgs[i].getElementsByTagName("img").length>0){images[img_pos]=cont.getElementsByTagName("a")[i];img_pos++;}}}
if(!images){timer4=setTimeout(function(){prepareImages(beginFrom);},0);return;}
for(i=beginFrom;i<images.length;i++,beginFrom++){try{if(images[i].getAttribute("href").length>0){images[i].setAttribute("url",images[i].getAttribute("href"));images[i].setAttribute("id",i);images[i].isVoliviewerImage=1;if(IS_VOLIVIEWER_OPENED_ON_IMAGE_CLICK&&images[i].getAttribute("href").indexOf("id_obrazky=")>-1){images[i].onclick=function(e){getImageInfo(parseInt(this.id));return false;}}}}catch(e){}}}}}}
catch(e2){timer4=setTimeout(function(){prepareImages(beginFrom);},0);return;}
clearTimeout(timer4);areImagesPrepared=true;setTimeout(function(){cacheImages();prepareOtherLinks();},0);}
function prepareOtherLinks(){for(var i=0;i<images.length;i++){var otherLinksOfImage=document.getElementById(i).parentNode.getElementsByTagName("li");var tmpURL="";var isGga=0;for(var j=0;j<otherLinksOfImage.length;j++){if(otherLinksOfImage[j].className&&(otherLinksOfImage[j].className=="gga")&&otherLinksOfImage[j].getElementsByTagName("a").length>0){tmpURL=otherLinksOfImage[j].getElementsByTagName("a")[0].getAttribute("href");isGga=1;tmpURL=window.location;break;}}
if(isGga==0){var otherLinkOfImage_parent=document.createElement("div");var otherLinkOfImage=document.createElement("a");otherLinkOfImage.id="button_gga";otherLinkOfImage.setAttribute("href","javascript:closeImgPanel();");otherLinkOfImage_parent.appendChild(otherLinkOfImage);if(document.getElementById("zahlavi")&&document.getElementById("zahlavi").getElementsByTagName("h2").length>0){otherLinkOfImage.innerHTML=document.getElementById("zahlavi").getElementsByTagName("h2")[0].innerHTML;}
else{otherLinkOfImage.innerHTML="této";}
document.getElementById(i).otherLinkOfImage_gga=""+navigationButtons[16]+" "+otherLinkOfImage_parent.innerHTML+"&nbsp;&nbsp;|&nbsp;&nbsp;";}
for(var j=0;j<otherLinksOfImage.length;j++){if(otherLinksOfImage[j].className&&(otherLinksOfImage[j].className=="gpo"||"gpv"||"gga")&&otherLinksOfImage[j].getElementsByTagName("a").length>0){var otherLinkOfImage_parent=document.createElement("div");var otherLinkOfImage=document.createElement("a");otherLinkOfImage.id="button_"+otherLinksOfImage[j].className;otherLinkOfImage.setAttribute("href",otherLinksOfImage[j].getElementsByTagName("a")[0].getAttribute("href"));otherLinkOfImage.innerHTML=otherLinksOfImage[j].getElementsByTagName("a")[0].innerHTML;if(otherLinksOfImage[j].className=="gpv"){otherLinkOfImage.setAttribute("target","_blank");}
otherLinkOfImage_parent.appendChild(otherLinkOfImage);switch(otherLinksOfImage[j].className){case "gga":otherLinkOfImage.innerHTML=otherLinksOfImage[j].getElementsByTagName("a")[0].innerHTML;document.getElementById(i).otherLinkOfImage_gga=""+navigationButtons[16]+" "+otherLinkOfImage_parent.innerHTML+(j<otherLinksOfImage.length?"&nbsp;&nbsp;|&nbsp;&nbsp;":"");break;case "gpo":otherLinkOfImage.innerHTML=navigationButtons[17];document.getElementById(i).otherLinkOfImage_gpo=""+otherLinkOfImage_parent.innerHTML+(j<otherLinksOfImage.length?"&nbsp;&nbsp;|&nbsp;&nbsp;":"");break;case "gpv":otherLinkOfImage.innerHTML="<img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_original_size.gif' alt='"+navigationButtons[14]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'>";document.getElementById(i).otherLinkOfImage_gpv=""+otherLinkOfImage_parent.innerHTML;break;}}}}}
function initCSSFile(){try{if(areCSSFilesLoaded_Light)return;}catch(err){}
areCSSFilesLoaded=true;var cssFileName="";var cssFilesInitTimer=setInterval(function(){if(document.getElementsByTagName("body").length>0){try{if(document.getElementsByTagName("head")[0].innerHTML.indexOf("/aspinclude/vismoweb5/html/n_")>-1){cssFileName="n_voliviewer.css";}
else{cssFileName="voliviewer.css";}
var newCSSLink=document.createElement("link");newCSSLink.type="text/css";newCSSLink.rel="stylesheet";newCSSLink.href="/aspinclude/vismoWeb5/html/"+cssFileName;newCSSLink.media="screen";document.getElementsByTagName("head")[0].appendChild(newCSSLink);}
catch(err){clearInterval(cssFilesInitTimer);}
clearInterval(cssFilesInitTimer);}},50);}
function cacheImages(){if(!images)return;try{var params=null;var id_obce=0;var id_galerie=0;var imagesIDs="";imagesObj=null;imagesObj=new Array();for(var i=0;i<images.length;i++){imagesObj[i]=new Image();imagesObj[i].isVideo=0;imagesObj[i].isReceivedFromHandRequest=0;imagesObj[i].linkToDetail="";params=parseURL(images[i].getAttribute("url"));try{params[0]=images[i].getElementsByTagName("img")[0].getAttribute("src").split("id_org=")[1].split("&")[0];}catch(err){}
id_obce=params[0];id_galerie=parseURL(window.location.href)[2];imagesIDs+=params[1]+",";if(params[3].length>0){imagesObj[i].src="/VismoOnline_ActionScripts/Image.aspx?id_org="+params[0]+"&id_obrazky="+parseInt(params[3]);}
else if(params[1].length>0&&params[3].length==0){var tempImgSrc="/VismoOnline_ActionScripts/Image.aspx?id_org="+params[0]+"&id_obrazky="+createRequest(1,params[0],params[1]);imagesObj[i].src=tempImgSrc.substring(0,tempImgSrc.length-1);imagesObj[i].isReceivedFromHandRequest=1;imagesObj[i].linkToDetail=images[i].getAttribute("url");}
else{imagesObj[i].src="";}
if(images[i].getAttribute("url").indexOf("typ_sady=2")>-1){imagesObj[i].isVideo=1;imagesObj[i].linkToDetail=images[i].getAttribute("url");}}}catch(e){}
areImagesCached=true;if(imagesTestingCount==3)return;else imagesTestingCount++;if(verifyImgsCount()>0&&cont==null){timer4=setTimeout(function(){prepareImages(0);},0);return;}
if(imagesObj.length!=verifyImgsCount()){timer4=setTimeout(function(){prepareImages(0);},0);return;}
if(parseURL(window.location.href)[4]==1||getCookie("vhned")==1||getCookie("vhned")==4){getImageInfo(0,getCookie("vslideshow")!=-1?true:false,"begin");}
else if(parseURL(window.location.href)[4]==2||getCookie("vhned")==2||getCookie("vhned")==3){getImageInfo(images.length-1,getCookie("vslideshow")!=-1?true:false,"end");}
getNextPages();isAnyAvailableImage=false;for(var i=0;i<imagesObj.length;i++){if(imagesObj[i].src.indexOf("id_obrazky=")>-1){isAnyAvailableImage=true;break;}}}
function verifyImgsCount(){var imgsCount=0;for(var j=0;j<cont_1.length;j++){if(cont_1[j].className==IMAGES_CONTAINER_NAME||cont_1[j].className.indexOf(" "+IMAGES_CONTAINER_NAME)>-1||cont_1[j].className.indexOf(IMAGES_CONTAINER_NAME)==0){imgsCount+=cont_1[j].getElementsByTagName("a").length;}}
for(var j=0;j<cont_1.length;j++){if(cont_1[j].className==IMAGES_CONTAINER_NAME||cont_1[j].className.indexOf(" "+IMAGES_CONTAINER_NAME)>-1||cont_1[j].className.indexOf(IMAGES_CONTAINER_NAME)==0){var elems_help=cont_1[j].getElementsByTagName("a");for(var k=0;k<elems_help.length;k++){if(elems_help[k].parentNode.className.indexOf("popisek")>-1||elems_help[k].parentNode.className.indexOf("ktg")>-1||!elems_help[k].id||!elems_help[k].getAttribute("href")){imgsCount--;}}}}
return imgsCount;}
function getImageInfo(objLink,isSlideshow){isImageInfoWorking=true;clearInterval(timer1);if(cont==null){prepareImages(0);return;}
if(imagesObj==null){prepareImages(0);return;}
if(imagesObj.length!=verifyImgsCount()){prepareImages(0);return;}
if(!areImagesPrepared){prepareImages(0);return;}
if(!isAnyAvailableImage){return;}
if(!isViewerOpened)createEventListeners();if(!isSetScrollPos){oldScrollPosX=document.body.scrollLeft;oldScrollPosY=document.body.scrollTop;isSetScrollPos=true;}
try{actualObjectID=objLink;isViewerStarting=true;var params=parseURL(document.getElementById(objLink).getAttribute("url"));try{params[0]=document.getElementById(objLink).getElementsByTagName("img")[0].getAttribute("src").split("id_org=")[1].split("&")[0];}catch(err){}
imgL.src=imagesObj[actualObjectID].src;if((imgL.src.indexOf("id_obrazky=")==-1&&arguments.length>2)||(imgL.src.indexOf("id_obrazky=")==-1&&arguments.length==1&&actualObjectID==0)){if(imgL.src.indexOf("id_obrazky=")==-1&&arguments.length==1&&actualObjectID==0){arguments[1]="false";arguments[2]="right";if(!isViewerOpened){var imgLWidth=imgL.width;var imgLHeight=imgL.height;showImage(objLink);isImageInfoWorking=false;changeImage(arguments[2],isSlideshow);return;}}
if(arguments[2]=="left"||arguments[2]=="right"){changeImage(arguments[2],isSlideshow);isImageInfoWorking=false;return;}
else if(arguments[2]=="begin"){changeImage("right",isSlideshow);isImageInfoWorking=false;return;}
else if(arguments[2]=="end"){changeImage("left",isSlideshow);isImageInfoWorking=false;return;}}
var imgLWidth=imgL.width;var imgLHeight=imgL.height;timer5=setTimeout(function(){showImage(objLink);isImageInfoWorking=false;},ANIMATION_TIME+50);}catch(e){}}
function parseURL(urlToParse){var arrayPos=0;parsedData_help=urlToParse.split("#");parsedData_help=parsedData_help[0].split("&");var parsedData=new Array(5);for(var i=0;i<5;i++){parsedData[i]="";}
for(var i=0;i<parsedData_help.length;i++){if(parsedData_help[i].indexOf("id_org=")>-1){parsedData[0]=parsedData_help[i].split("=")[1];}
if(parsedData_help[i].indexOf("id_fotopary=")>-1){parsedData[1]=parsedData_help[i].split("=")[1];}
if(parsedData_help[i].indexOf("id_galerie=")>-1){parsedData[2]=parsedData_help[i].split("=")[1];}
if(parsedData_help[i].indexOf("id_obrazky=")>-1){parsedData[3]=parsedData_help[i].split("=")[1];}
if(parsedData_help[i].indexOf("vhned=")>-1){parsedData[4]=parsedData_help[i].split("=")[1];}}
return parsedData;}
function areImgsLoaded(){var areImagesLoaded_help=true;for(var i=0;i<imagesObj.length;i++){if(images[i].getAttribute("href")!="javascript:void(0);"){areImagesLoaded_help=false;break;}}
areImagesLoaded=areImagesLoaded_help;}
function showImage(objLink){clearTimeout(timer5);clearTimeout(timer8);clearInterval(timer10);if(!areImagesLoaded)areImgsLoaded();document.body.scrollLeft=0;document.body.scrollTop=0;window.document.body.style.overflow="hidden";var MAX_OPACITY=80;var MAX_OPACITY_INFOPANEL=80;try{var isIE=(navigator.userAgent.indexOf("MSIE ")>-1);var isFF=(navigator.userAgent.indexOf("Firefox/")>-1);var isSAF=(navigator.userAgent.indexOf("Safari/")>-1);screenWidth=window.innerWidth;screenHeight=window.innerHeight;browserWidth=document.body.clientWidth;browserHeight=isSAF?window.innerHeight:document.body.clientHeight;var imgPanel=null;var imageArrow_left=null;var imageArrow_right=null;if(document.getElementById("imgPanel")==null){imgBgPanel=document.createElement("div");imgPanel=document.createElement("div");navigationPanel=document.createElement("div");infoPanel=document.createElement("div");floatInfoPanel=document.createElement("div");imageArrow_left=document.createElement("img");imageArrow_right=document.createElement("img");document.getElementsByTagName("body")[0].appendChild(imgBgPanel);document.getElementsByTagName("body")[0].appendChild(imgPanel);document.getElementsByTagName("body")[0].appendChild(navigationPanel);document.getElementsByTagName("body")[0].appendChild(infoPanel);document.getElementsByTagName("body")[0].appendChild(floatInfoPanel);imageArrow_left.id="imageArrow_left";imageArrow_left.style.position="absolute";imageArrow_left.style.display="none";imageArrow_left.style.left="-30px";imageArrow_right.id="imageArrow_right";imageArrow_right.style.position="absolute";imageArrow_right.style.display="none";imageArrow_right.style.right="-30px";imgBgPanel.id="imgBgPanel";imgBgPanel.style.left=document.body.scrollLeft;imgBgPanel.style.top=document.body.scrollTop;imgBgPanel.style.MozOpacity=MAX_OPACITY/100;imgBgPanel.style.opacity=MAX_OPACITY/100;imgBgPanel.style.filter="alpha(opacity="+MAX_OPACITY+")";imgBgPanel.onclick=function(e){if(!verifySecretEvents(e))return;closeImgPanel();}
imgPanel.id="imgPanel";navigationPanel.id="navigationPanel";navigationPanel.style.fontWeight="bold";var voliviewerTopToolbar=document.createElement("div");voliviewerTopToolbar.id="voliviewer_top_center_toolbar";voliviewerTopToolbar.innerHTML="<div id='otherLinksArea'><\/div>";navigationPanel.appendChild(voliviewerTopToolbar);var voliviewerBottomToolbar=document.createElement("div");voliviewerBottomToolbar.id="voliviewer_bottom_toolbar";var initImage_info=document.createElement("span");initImage_info.id="initImage_info";initImage_info.style.color="#FFFFFF";initImage_info.innerHTML=navigationButtons[10];navigationPanel.appendChild(initImage_info);infoPanel.id="infoPanel";if(IMAGE_DESCRIPTION_PLACE==0)infoPanel.innerHTML="<div class='voliviewer-info' id='voliviewer-info'>"+document.getElementById(actualObjectID).getElementsByTagName("img")[0].alt.toString()+"<\/div>";else if(IMAGE_DESCRIPTION_PLACE==1)infoPanel.innerHTML="<div class='voliviewer-info' id='voliviewer-info'>"+document.getElementById(actualObjectID).getElementsByTagName("span")[0].innerHTML.toString()+"<\/div>";infoPanel.innerHTML+="<div style='sf'><!-- --><\/div>";infoPanel.appendChild(voliviewerBottomToolbar);var collectedCode="<div class='voliviewer-buttons'>";collectedCode+="<span class='voliviewer-counter' id='voliviewer-counter'>"+(getOnlyImagePosition()+1)+"/"+(getOnlyImagesCount()[0])+" "+navigationButtons[19]+" "+(galleryPagesCount)+"<\/span>";collectedCode+="<a href='javascript:void(0)' onclick='changeImage(\"begin\",false);' id='buttonBegin' onmouseover='floatInfoPanelText=\""+navigationButtons[0]+"\";' style='margin-left:1px;'><img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_first.gif' alt='"+navigationButtons[0]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'><\/a>";collectedCode+="<a href='javascript:void(0)' onclick='changeImage(\"left\",false);' id='buttonLeft' onmouseover='floatInfoPanelText=\""+navigationButtons[1]+"\";' style='margin-left:1px;'><img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_previous.gif' alt='"+navigationButtons[1]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'><\/a>";if(IS_BEAUTIFUL_SLIDESHOW){collectedCode+="<div style='position:relative;float:left;'>";collectedCode+="<div class='voliviewer-slideshowInfo' id='slideshowInfo'><\/div>";collectedCode+="<div id='voliviewer-slideshow'>";}
else{collectedCode+="<div class='voliviewer-slideshowInfo' id='slideshowInfo'><\/div>";}
for(var i=0;i<SLIDESHOW_STATES.length;i++){if(IS_BEAUTIFUL_SLIDESHOW){collectedCode+="<a href='javascript:void(0);' class='voliviewer-slideshow' onclick='setAsActiveSlideshowType(this);slideshowInfo=\""+SLIDESHOW_STATES[i][0]+"\";slideshow("+parseInt(SLIDESHOW_STATES[i][1])+",\""+SLIDESHOW_STATES[i][2]+"\");' onmouseover='floatInfoPanelText=\"SLIDESHOW (start/stop): "+SLIDESHOW_STATES[i][0]+","+SLIDESHOW_STATES[i][1]+"\";setOverBackgroundColor(this,\"#339900\");' onmouseout='setOverBackgroundColor(this,\"#FFCC66\");'>&nbsp;&nbsp;<\/a>";}
else{collectedCode+="<a id='voliviewer-slideshow' href='javascript:void(0);' class='voliviewer-slideshow' onclick='if(isFirstImageInSlideshowStarted || isSlideshowRunning){isFirstImageInSlideshowStarted=false;stopSlideshow();return;} isFirstImageInSlideshowStarted=false;setAsActiveSlideshowType(this);slideshowInfo=\""+SLIDESHOW_STATES[i][0]+"\";slideshow("+parseInt(SLIDESHOW_STATES[i][1])+",\""+SLIDESHOW_STATES[i][2]+"\");' onmouseover='floatInfoPanelText=\""+navigationButtons[20]+"\";'>";collectedCode+="<img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_slideshow.gif' alt='"+navigationButtons[20]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'>";collectedCode+="<\/a>";collectedCode+=(i<SLIDESHOW_STATES.length-1?" | ":"");}}
if(IS_BEAUTIFUL_SLIDESHOW){collectedCode+="<\/div>";collectedCode+="<\/div>";}
collectedCode+="<a href='javascript:void(0)' onclick='changeImage(\"right\",false);' id='buttonRight' onmouseover='floatInfoPanelText=\""+navigationButtons[2]+"\";' style='margin-left:1px;'><img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_next.gif' alt='"+navigationButtons[2]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'><\/a>";collectedCode+="<a href='javascript:void(0)' onclick='changeImage(\"end\",false);' id='buttonEnd' onmouseover='floatInfoPanelText=\""+navigationButtons[3]+"\";' style='margin-left:1px;'><img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_last.gif' alt='"+navigationButtons[3]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'><\/a>";collectedCode+="<\/div>";voliviewerTopToolbar.innerHTML+=collectedCode;var controlButtons=["buttonBegin","buttonLeft","buttonRight","buttonEnd","buttonClose","buttonDetail","button_gpo","button_gga","button_gpv","voliviewer-slideshow"];for(var j=0;j<controlButtons.length;j++){if(document.getElementById(controlButtons[j])){document.getElementById(controlButtons[j]).onmousemove=function(e){setFloatInfoPanel(e,document.getElementById("floatInfoPanel"));}
document.getElementById(controlButtons[j]).onmouseout=function(e){document.getElementById("floatInfoPanel").style.display="none";}}}
setSlideshowInfo(slideshowInfo);floatInfoPanel.id="floatInfoPanel";floatInfoPanel.style.position="absolute";floatInfoPanel.style.display="none";floatInfoPanel.style.zIndex=200;floatInfoPanel.className="voliviewer-floatInfoPanel";}
else{imgBgPanel=document.getElementById("imgBgPanel");navigationPanel=document.getElementById("navigationPanel");infoPanel=document.getElementById("infoPanel");imgPanel=document.getElementById("imgPanel");imageArrow_left=document.getElementById("imageArrow_left");imageArrow_right=document.getElementById("imageArrow_right");}
imgBgPanel.style.width=browserWidth;imgBgPanel.style.height=browserHeight;var imgPanelType=0;var tmpImgHeight=0;var imgPanel_tmpImgHeight=0;var AROUND_IMAGE_RESERVE=90;var max_top_offset=0;var act_image_height=0;try{if(IMAGE_DESCRIPTION_PLACE==0)document.getElementById("voliviewer-info").innerHTML=document.getElementById(actualObjectID).getElementsByTagName("span")[0].innerHTML.toString();else if(IMAGE_DESCRIPTION_PLACE==1)document.getElementById("voliviewer-info").innerHTML=document.getElementById(actualObjectID).getElementsByTagName("span")[0].innerHTML.toString();}
catch(error){}
document.getElementById("voliviewer_bottom_toolbar").innerHTML="";document.getElementById("voliviewer_bottom_toolbar").onmouseout=function(e){document.getElementById("floatInfoPanel").style.display="none";}
document.getElementById("otherLinksArea").innerHTML="";document.getElementById("otherLinksArea").onmouseout=function(e){document.getElementById("floatInfoPanel").style.display="none";}
try{if(document.getElementById(actualObjectID).otherLinkOfImage_gga)document.getElementById("voliviewer_bottom_toolbar").innerHTML+=document.getElementById(actualObjectID).otherLinkOfImage_gga;if(document.getElementById(actualObjectID).otherLinkOfImage_gpo)document.getElementById("voliviewer_bottom_toolbar").innerHTML+=document.getElementById(actualObjectID).otherLinkOfImage_gpo;if(document.getElementById(actualObjectID).otherLinkOfImage_gpv)document.getElementById("otherLinksArea").innerHTML+=document.getElementById(actualObjectID).otherLinkOfImage_gpv;document.getElementById("voliviewer_bottom_toolbar").innerHTML+="<a href='"+document.getElementById(actualObjectID).getAttribute("href")+"' id='buttonDetail' onmouseover='floatInfoPanelText=\""+navigationButtons[11]+"\";'>"+navigationButtons[18]+"<\/a>";document.getElementById("otherLinksArea").innerHTML+="<a href='javascript:void(0)' onclick='closeImgPanel();' id='buttonClose' onmouseover='floatInfoPanelText=\""+navigationButtons[4]+"\";' style='margin-left:5px;'><img src='"+PATH_TO_VOLIVIEWER_IMAGES+"button_close.gif' alt='"+navigationButtons[4]+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'><\/a>";setTimeout(function(){if(document.getElementById("button_gpv"))document.getElementById("button_gpv").onmousemove=function(e){floatInfoPanelText=navigationButtons[14];setFloatInfoPanel(e,document.getElementById("floatInfoPanel"));}
if(document.getElementById("buttonClose"))document.getElementById("buttonClose").onmousemove=function(e){floatInfoPanelText=navigationButtons[4];setFloatInfoPanel(e,document.getElementById("floatInfoPanel"));}},100);}
catch(err){}
if(parseInt(imgPanel.style.height)<MIN_IMGPANEL_HEIGHT||parseInt(imgL.height)<parseInt(imgPanel.style.height)||(parseInt(imgL.height)+parseInt(document.getElementById("infoPanel").offsetHeight)+AROUND_IMAGE_RESERVE>parseInt(browserHeight))){var percents=90;imgPanelType=0;max_top_offset=0;act_image_height=((browserHeight*percents)/100)-document.getElementById("infoPanel").offsetHeight-BORDER_AROUND_IMAGE_TOP_OFFSET*2;max_top_offset=((browserHeight-document.getElementById("infoPanel").offsetHeight-BORDER_AROUND_IMAGE_TOP_OFFSET-act_image_height)/2);imgPanel_tmpImgHeight=tmpImgHeight=act_image_height;if(parseInt(imgL.height)>parseInt(imgPanel.style.height)){while(imgPanel_tmpImgHeight>parseInt(imgL.height)){percents-=10;imgPanel_tmpImgHeight=tmpImgHeight=(parseInt(browserHeight)*percents)/100;}}
else{if((parseInt(document.getElementById("navigationPanel").style.height)+(AROUND_IMAGE_RESERVE*2)>MIN_IMGPANEL_HEIGHT&&parseInt(document.getElementById("navigationPanel").style.height)+(AROUND_IMAGE_RESERVE*2)<browserHeight&&imgL.height<MIN_IMGPANEL_HEIGHT)||imgL.height>MIN_IMGPANEL_HEIGHT){imgPanel_tmpImgHeight=tmpImgHeight=MIN_IMGPANEL_HEIGHT;max_top_offset=0;act_image_height=imgPanel_tmpImgHeight;max_top_offset=((browserHeight-document.getElementById("infoPanel").offsetHeight-BORDER_AROUND_IMAGE_TOP_OFFSET-act_image_height)/2);}}
setImgPanelSizes(imgPanel,imgPanelType,imgPanel_tmpImgHeight);if(tmpImgHeight+AROUND_IMAGE_RESERVE>browserHeight){}
if(parseInt(imgL.height)<parseInt(imgPanel.style.height)){tmpImgHeight=imgL.height;}}
else{imgPanelType=1;max_top_offset=0;act_image_height=imgL.height;imgPanel_tmpImgHeight=tmpImgHeight=act_image_height;setImgPanelSizes(imgPanel,imgPanelType,imgPanel_tmpImgHeight);max_top_offset=((browserHeight-document.getElementById("infoPanel").offsetHeight-BORDER_AROUND_IMAGE_TOP_OFFSET-document.getElementById("imgPanel").offsetHeight)/2);}
imgPanel.style.left=(browserWidth-parseInt(imgPanel.style.width))/2;imgPanel.style.top=document.body.scrollTop+max_top_offset+BORDER_AROUND_IMAGE_TOP_OFFSET;if(IMAGE_DESCRIPTION_PLACE==0)imgPanel.innerHTML="<img height="+tmpImgHeight+" src='"+imgL.src+"' alt='"+document.getElementById(actualObjectID).getElementsByTagName("img")[0].alt.toString()+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'>";else if(IMAGE_DESCRIPTION_PLACE==1)imgPanel.innerHTML="<img height="+tmpImgHeight+" src='"+imgL.src+"' alt='"+document.getElementById(actualObjectID).getElementsByTagName("span")[0].innerHTML.toString()+"' onmouseover='removeAttributeFromElement(this,\"alt\",true);' onmouseout='setAttributeToElementFromBackup(this,\"alt\",true)'>";navigationPanel.style.width=parseInt(imgPanel.style.width)+(BORDER_AROUND_IMAGE*2);navigationPanel.style.height=parseInt(imgPanel.style.height)+BORDER_AROUND_IMAGE_TOP_OFFSET;navigationPanel.style.left=((browserWidth-parseInt(imgPanel.style.width))/2)-BORDER_AROUND_IMAGE;navigationPanel.style.top=max_top_offset;infoPanel.style.width=parseInt(imgPanel.style.width)+(BORDER_AROUND_IMAGE*2);infoPanel.style.left=((browserWidth-parseInt(imgPanel.style.width))/2)-BORDER_AROUND_IMAGE;infoPanel.style.top=max_top_offset+parseInt(imgPanel.style.height)+BORDER_AROUND_IMAGE_TOP_OFFSET;try{if(IMAGE_DESCRIPTION_PLACE==0)document.getElementById("voliviewer-info").innerHTML=document.getElementById(actualObjectID).getElementsByTagName("img")[0].alt.toString();else if(IMAGE_DESCRIPTION_PLACE==1)document.getElementById("voliviewer-info").innerHTML=document.getElementById(actualObjectID).getElementsByTagName("span")[0].innerHTML.toString();}
catch(error){}
document.getElementById("voliviewer-counter").innerHTML=(getOnlyImagePosition()+1)+"/"+(getOnlyImagesCount()[0])+" "+navigationButtons[19]+" "+(actualPageIndex);imgPanel.appendChild(imageArrow_left);imgPanel.appendChild(imageArrow_right);window.onscroll=function(){if(isViewerStarting){document.body.scrollTop=0;}}
window.onresize=function(){if(isViewerOpened&&wasSlideshow==false){showImage(null);return;}}
if(IS_OVER_IMAGE_LAYOUT)showOverImageLayout(imgPanel);else isViewerOpened=true;imgPanel.onclick=function(e){changeImage(e,false);}}
catch(e){}
var imageArrowLeft_tmpImg=new Image();imageArrow_left.src=PATH_TO_VOLIVIEWER_IMAGES+"button_arrow_left_big.png";imageArrowLeft_tmpImg.onload=function(){imageArrow_left.style.top=(parseInt(imgPanel.style.height)-parseInt(imageArrowLeft_tmpImg.height))/2;}
imageArrowLeft_tmpImg.src=PATH_TO_VOLIVIEWER_IMAGES+"button_arrow_left_big.png";var imageArrowRight_tmpImg=new Image();imageArrow_right.src=PATH_TO_VOLIVIEWER_IMAGES+"button_arrow_right_big.png";imageArrowRight_tmpImg.onload=function(){imageArrow_right.style.top=(parseInt(imgPanel.style.height)-parseInt(imageArrowRight_tmpImg.height))/2;}
imageArrowRight_tmpImg.src=PATH_TO_VOLIVIEWER_IMAGES+"button_arrow_right_big.png";imgPanel.onmousemove=function(e){var mousePosition=getMousePosition(e);document.getElementById("imageArrow_left").style.display="none";document.getElementById("imageArrow_left").style.cursor="default";document.getElementById("imageArrow_right").style.display="none";document.getElementById("imageArrow_right").style.cursor="default";if((getOnlyImagePosition()>0||actualPageIndex>1)&&mousePosition.x<=browserWidth/2&&(actualObjectID>0||(actualObjectID==0&&isNextPageCrossingEnabled))){document.getElementById("imageArrow_left").style.display="block";document.getElementById("imageArrow_left").style.cursor="pointer";}
if(((getOnlyImagePosition()<getOnlyImagesCount()[0]-1&&actualPageIndex==galleryPagesCount)||(getOnlyImagePosition()<=getOnlyImagesCount()[0]&&actualPageIndex<galleryPagesCount))&&mousePosition.x>browserWidth/2&&(actualObjectID<images.length-1||(actualObjectID<images.length&&isNextPageCrossingEnabled))){document.getElementById("imageArrow_right").style.display="block";document.getElementById("imageArrow_right").style.cursor="pointer";}
if(isMouseOverVideoButton()){floatInfoPanelText=navigationButtons[15];setFloatInfoPanel(e,document.getElementById("floatInfoPanel"));document.getElementById("imgPanel").style.cursor="pointer";document.getElementById("imageArrow_right").style.display="none";document.getElementById("imageArrow_right").style.cursor="default";}
else{document.getElementById("floatInfoPanel").style.display="none";document.getElementById("imgPanel").style.cursor="default";}
this.style.cursor="pointer";}
imgPanel.onmouseout=function(e){var mousePosition=getMousePosition(e);if(mousePosition.x<=browserWidth/2&&(actualObjectID>0||(actualObjectID==0&&isNextPageCrossingEnabled))){document.getElementById("imageArrow_left").style.display="none";document.getElementById("imageArrow_left").style.cursor="default";}
else if(mousePosition.x>browserWidth/2&&(actualObjectID<images.length-1||(actualObjectID<images.length&&isNextPageCrossingEnabled))){document.getElementById("imageArrow_right").style.display="none";document.getElementById("imageArrow_right").style.cursor="default";}
document.getElementById("floatInfoPanel").style.display="none";}
setButtonsStates();setTimeout(function(){setImgPanelSizes(imgPanel,imgPanelType,imgPanel_tmpImgHeight);imgPanel.style.left=(browserWidth-parseInt(imgPanel.style.width))/2;navigationPanel.style.width=parseInt(imgPanel.style.width)+(BORDER_AROUND_IMAGE*2);navigationPanel.style.height=parseInt(imgPanel.style.height)+BORDER_AROUND_IMAGE_TOP_OFFSET;navigationPanel.style.left=((browserWidth-parseInt(imgPanel.style.width))/2)-BORDER_AROUND_IMAGE;infoPanel.style.width=parseInt(imgPanel.style.width)+(BORDER_AROUND_IMAGE*2);infoPanel.style.left=((browserWidth-parseInt(imgPanel.style.width))/2)-BORDER_AROUND_IMAGE;},800);if(getCookie("vhned")==1&&getCookie("vslideshow").split("_")[0]==1){slideshowInfo=navigationButtons[2];slideshow(getCookie("vslideshow").split("_")[1],"right");document.cookie="vhned=-1";document.cookie="vslideshow=-1";}
else if(getCookie("vhned")==2&&getCookie("vslideshow").split("_")[0]==1){slideshowInfo=navigationButtons[1];slideshow(getCookie("vslideshow").split("_")[1],"left");document.cookie="vhned=-1";document.cookie="vslideshow=-1";}
timer7=setInterval(function(){verifyImageInitialisation();},5);isImageShowed=false;document.getElementById("imgPanel").getElementsByTagName("img")[0].src=imgL.src;timer10=setInterval(function(){if(wasSlideshow&&areImagesCached&&imgL.width>0&&imgL.height>0){clearInterval(timer10);timer8=setTimeout(function(){isImageShowed=true;},slideshowTime*1000);}},5);if(isFirstImageShowed){isFirstImageShowed=false;showImage(null);}}
function setImgPanelSizes(imgPanel,type,imgHeight){imgPanel.style.width=parseInt(imgL.width)<MIN_IMGPANEL_WIDTH?MIN_IMGPANEL_WIDTH:imgL.width;if(type==0){imgPanel.style.height=imgHeight;}
else{imgPanel.style.height=parseInt(imgL.height)<MIN_IMGPANEL_HEIGHT?MIN_IMGPANEL_HEIGHT:imgL.height;}}
function verifyImageInitialisation(){if(imgL.width>0&&imgL.height>0){clearInterval(timer7);showHideInitImageInfo("none");}}
function showHideInitImageInfo(infoState){if(document.getElementById("initImage_info"))document.getElementById("initImage_info").style.display=infoState;}
function showOverImageLayout(imgPanel){try{var overImgLayout=document.createElement("div");overImgLayout.id="overImgLayout";overImgLayout.style.width=imgPanel.style.width;overImgLayout.style.height=imgPanel.style.height;overImgLayout.style.left=imgPanel.style.left;overImgLayout.style.top=imgPanel.style.top;overImgLayout.style.MozOpacity=1;overImgLayout.style.opacity=1;overImgLayout.style.filter="alpha(opacity=100)";overImgLayout.onclick=function(e){try{changeImage(e,false);}catch(e){}}
opacityValue=DEFAULT_OPACITY_VALUE;document.getElementsByTagName("body")[0].appendChild(overImgLayout);oldImgPosX_step=0;timer1=setInterval(function(){changeImgOverLayoutTransparency();},ANIMATION_TIME);}
catch(e){}}
function changeImgOverLayoutTransparency(){try{var overImgLayout=document.getElementById("overImgLayout");if(overImgLayout){if(document.getElementById("overImgLayout").style.MozOpacity<=0||document.getElementById("overImgLayout").style.opacity<=0||opacityValue<=0){oldImgSrc=imgL.src;isViewerOpened=true;window.document.getElementsByTagName("body")[0].removeChild(document.getElementById("overImgLayout"));window.document.getElementsByTagName("body")[0].removeChild(document.getElementById("oldImg"));clearInterval(timer1);return;}}
if(document.getElementById("overImgLayout")){document.getElementById("overImgLayout").style.MozOpacity-=MAX_OPACITY_OVERIMGLAYOUT/100;document.getElementById("overImgLayout").style.opacity-=MAX_OPACITY_OVERIMGLAYOUT/100;opacityValue-=MAX_OPACITY_OVERIMGLAYOUT;document.getElementById("overImgLayout").style.filter="alpha(opacity:"+opacityValue+")";}
if(IS_OLDIMGMOVE_ALLOWED&&isViewerOpened&&!isFirstImg)moveOldImg();}
catch(e){}}
function setFloatInfoPanel(e,obj){var posX=0;var posY=0;var oEvent=e?e:event;var targetElement=oEvent.target||oEvent.srcElement;if(e){posX=e.clientX;posY=e.clientY;}
else if(event){posX=event.x;posY=event.y;}
obj.style.left=posX+BORDER_AROUND_IMAGE-10;obj.style.top=posY+20;obj.innerHTML=floatInfoPanelText;obj.style.display="block";}
function setAsActiveSlideshowType(obj){for(var i=0;i<document.getElementById("voliviewer-slideshow").childNodes.length;i++){try{if(IS_BEAUTIFUL_SLIDESHOW){document.getElementById("voliviewer-slideshow").childNodes[i].className="voliviewer-slideshow";document.getElementById("voliviewer-slideshow").childNodes[i].style.backgroundColor='#FFCC66';}
else{}}
catch(err){}}
if(obj){if(isSlideshowRunning){obj.className="voliviewer-slideshow-act";setSlideshowButtonIcon("button_stop.gif");}
else if(!isSlideshowRunning){obj.className="voliviewer-slideshow";setSlideshowButtonIcon("button_slideshow.gif");}
if(IS_BEAUTIFUL_SLIDESHOW){obj.style.backgroundColor='#339900';}}}
function setSlideshowButtonIcon(fileName){document.getElementById("voliviewer-slideshow").getElementsByTagName("img")[0].setAttribute("src",PATH_TO_VOLIVIEWER_IMAGES+fileName);}
function setSlideshowInfo(slideshowInfo){if(IS_BEAUTIFUL_SLIDESHOW){document.getElementById("slideshowInfo").innerHTML="SLIDESHOW (start/stop): "+slideshowInfo+"&nbsp;&nbsp;";}
document.getElementById("slideshowInfo").innerHTML="";}
function stopSlideshow(){isSlideshowRunning=false;setAsActiveSlideshowType(document.getElementById("voliviewer-slideshow"));setSlideshowButtonIcon("button_slideshow.gif");isFirstImageInSlideshowStarted=false;clearInterval(timer2);timer2=null;clearInterval(timer3);clearTimeout(timer8);clearTimeout(timer9);clearInterval(timer10);}
function slideshow(seconds,way){clearInterval(timer3);clearTimeout(timer8);clearTimeout(timer9);clearInterval(timer10);setSlideshowButtonIcon("button_stop.gif");if(seconds==0){return;}
isSlideshowRunning=true;slideshowWay=way;isImageShowed=true;var seconds_help=seconds;var seconds_help2=seconds;slideshowSeconds=parseInt(seconds);if(IS_BEAUTIFUL_SLIDESHOW){document.getElementById("slideshowInfo").innerHTML="SLIDESHOW (start/stop): "+slideshowInfo+", "+(parseInt(seconds_help--))+"s&nbsp;";}
if(isOneCycleError_Slideshow){seconds_help=seconds=1;}
if(IS_BEAUTIFUL_SLIDESHOW){timer3=setInterval(function(){document.getElementById("slideshowInfo").innerHTML="SLIDESHOW (start/stop): "+slideshowInfo+", "+(parseInt(seconds_help--))+"s&nbsp;";},1000);}
timer9=setTimeout(function(){timer2=setInterval(function(){if(isImageShowed||parseInt(seconds_help)<0){isImageShowed=false;var tmpImg=document.getElementById("imgPanel").getElementsByTagName("img")[0];if(slideshow_imagesLoadErrorsCount<3&&!(tmpImg.width>0)){document.getElementById("stred").innerHTML=document.getElementById("stred").innerHTML+" zapinam ";slideshow_imagesLoadErrorsCount++;isOneCycleError_Slideshow=true;slideshow(seconds_help2,way);return;}
else if(slideshow_imagesLoadErrorsCount==3){slideshow_imagesLoadErrorsCount=0;}
if(!isImageInfoWorking){if(actualObjectID==images.length-1&&slideshowWay=="right"&&(!isNextPageCrossingEnabled||(isNextPageCrossingEnabled&&nextGalleryPages.next==null)))actualObjectID=-1;else if(actualObjectID==0&&slideshowWay=="left"&&(!isNextPageCrossingEnabled||(isNextPageCrossingEnabled&&nextGalleryPages.previous==null)))actualObjectID=images.length;seconds_help=seconds;slideshowTime=seconds_help2;isFirstImageInSlideshowStarted=true;changeImage(slideshowWay,true);}
if(isOneCycleError_Slideshow){document.getElementById("stred").innerHTML=document.getElementById("stred").innerHTML+" vypinam ";isOneCycleError_Slideshow=false;slideshow(seconds_help2,way);return;}}},20);},seconds*1000);}
function changeImage(e,isSlideshow){var posX=0;var posY=0;var newImage;showHideInitImageInfo("block");isFirstImg=false;oldImgSrc=imgL.src;oldImgWidth=imgL.width;oldImgHeight=imgL.height;oldImgPosX=document.getElementById("imgPanel").style.left;oldImgPosY=document.getElementById("imgPanel").style.top;isViewerOpened=true;clearInterval(timer1);if(isSlideshowRunning){document.getElementById("voliviewer-slideshow").className="voliviewer-slideshow-act";setSlideshowButtonIcon("button_stop.gif");}
if(!IS_SLIDESHOW_CYCLING&&isSlideshow&&actualObjectID==-1){stopSlideshow();wasSlideshow=false;actualObjectID=newImage=document.getElementById(images.length-1).id;return;}
if((!isSlideshow&&wasSlideshow)){stopSlideshow();clearInterval(timer2);clearInterval(timer3);setSlideshowInfo(" --");setAsActiveSlideshowType(null);wasSlideshow=false;showHideInitImageInfo("none");return;}
if(!isSlideshow){clearInterval(timer2);clearInterval(timer3);clearTimeout(timer8);clearInterval(timer10);setSlideshowInfo(" --");setAsActiveSlideshowType(null);wasSlideshow=false;document.getElementById("voliviewer-slideshow").className="voliviewer-slideshow";setSlideshowButtonIcon("button_slideshow.gif");}
else{wasSlideshow=true;}
if(!isFirstImageInSlideshowStarted){stopSlideshow();}
if(document.getElementById("oldImg")!=null)window.document.getElementsByTagName("body")[0].removeChild(document.getElementById("oldImg"));if(document.getElementById("overImgLayout")!=null)window.document.getElementsByTagName("body")[0].removeChild(document.getElementById("overImgLayout"));oldImgStep=(parseInt(document.getElementById("imgPanel").style.left)+parseInt(document.getElementById("imgPanel").style.width))/(100/MAX_OPACITY_OVERIMGLAYOUT);if(oldImgStep<MIN_STEP_OLDIMAGE)oldImgStep=MIN_STEP_OLDIMAGE;if(e=="begin"){try{if(galleryPagesCount>1&&isCrossToNextGalleryImage(true,false,-4))return;isMoveLeft=true;newImage=document.getElementById(0).id;getImageInfo(newImage,isSlideshow,"begin");}catch(e){}
return;}
else if(e=="end"){try{if(galleryPagesCount>1&&isCrossToNextGalleryImage(false,false,-4))return;isMoveLeft=false;newImage=document.getElementById(images.length-1).id;getImageInfo(newImage,isSlideshow,"end");}catch(e){}
return;}
if(!(e=="left"||e=="right")){if(e){posX=e.clientX;posY=e.clientY;}
else if(event){posX=event.x;posY=event.y;}}
else{if(e=="left")posX=0;else if(e=="right")posX=browserWidth;}
if(isMouseOverVideoButton()){location.href=imagesObj[actualObjectID].linkToDetail;return;}
if(posX<=browserWidth/2&&(actualObjectID>0||(actualObjectID==0&&isNextPageCrossingEnabled))){try{if(getOnlyImagePosition()<=0&&actualPageIndex==1&&!isSlideshow&&!isCrossToNextGalleryImage(isMoveLeft,isSlideshow,parseInt(actualObjectID)-1)){showHideInitImageInfo("none");return;}
isMoveLeft=true;if((actualObjectID==0&&galleryPagesCount==1&&actualPageIndex==1)||(actualObjectID==0&&actualPageIndex==1)){showHideInitImageInfo("none");}
if(isCrossToNextGalleryImage(isMoveLeft,isSlideshow,parseInt(actualObjectID)-1)){return;}
if(document.getElementById(actualObjectID-1)){newImage=document.getElementById(actualObjectID-1).id;getImageInfo(newImage,isSlideshow,"left");}
if(actualObjectID<0&&isSlideshow&&actualPageIndex==1){getImageInfo(getOnlyImagesCount()[1],isSlideshow,true);}}catch(err){}
return;}
else if(posX>browserWidth/2&&(actualObjectID<images.length-1||(actualObjectID<images.length&&isNextPageCrossingEnabled))){try{if(((getOnlyImagePosition()==getOnlyImagesCount()[0]&&galleryPagesCount==1&&getOnlyImagesCount()[0]>1)||(getOnlyImagePosition()>getOnlyImagesCount()[0]-1&&galleryPagesCount>1))&&!isSlideshow&&!isCrossToNextGalleryImage(isMoveLeft,isSlideshow,parseInt(actualObjectID)+1)){showHideInitImageInfo("none");return;}
isMoveLeft=false;if((actualObjectID==images.length-1&&galleryPagesCount==1)||(actualObjectID==images.length-1&&actualPageIndex==galleryPagesCount)){showHideInitImageInfo("none");}
if(isCrossToNextGalleryImage(isMoveLeft,isSlideshow,parseInt(actualObjectID)+1)){return;}
if(document.getElementById(parseInt(actualObjectID)+1)){newImage=document.getElementById(parseInt(actualObjectID)+1).id;getImageInfo(newImage,isSlideshow,"right");}
if(getOnlyImagePosition()>=getOnlyImagesCount()[0]&&isSlideshow){getImageInfo(getOnlyFirstImageID(),isSlideshow,true);}}catch(err){}
return;}
showHideInitImageInfo("none");}
function closeImgPanel(){clearInterval(timer1);clearInterval(timer2);clearInterval(timer3);clearTimeout(timer8);clearTimeout(timer9);clearInterval(timer10);isFirstImageShowed=true;isViewerOpened=false;isViewerStarting=false;isSetScrollPos=false;isFirstImageInSlideshowStarted=false;isSlideshowRunning=false;document.cookie="vhned=-1";document.body.scrollLeft=oldScrollPosX;document.body.scrollTop=oldScrollPosY;removeEventListeners();window.document.body.style.overflow="auto";slideshowInfo="--";var objectsToRemove=["navigationPanel","infoPanel","imgPanel","overImgLayout","oldImg","floatInfoPanel"];for(var i=0;i<objectsToRemove.length;i++){if(document.getElementById(objectsToRemove[i])!=null){window.document.getElementsByTagName("body")[0].removeChild(document.getElementById(objectsToRemove[i]));}}
timer6=setTimeout(function(){if(document.getElementById("imgBgPanel")!=null)window.document.getElementsByTagName("body")[0].removeChild(document.getElementById("imgBgPanel"));clearTimeout(timer6);},300);}
function moveOldImg(){var MAX_OPACITY=60;var oldImg=null;if((document.getElementById("oldImg")!=null)&&(parseInt(document.getElementById("oldImg").style.left)>browserWidth)||(document.getElementById("oldImg")!=null)&&(parseInt(document.getElementById("oldImg").style.left)+parseInt(document.getElementById("oldImg").style.width)<0)){return;}
if(document.getElementById("oldImg")==null){oldImg=document.createElement("div");oldImg.id="oldImg";oldImg.style.zIndex="160";oldImg.style.position="absolute";oldImg.style.width=oldImgWidth;oldImg.style.height=oldImgHeight;oldImg.style.top=oldImgPosY;oldImg.style.backgroundColor="black";oldImg.innerHTML="<img src='"+oldImgSrc+"'>";window.document.getElementsByTagName("body")[0].appendChild(oldImg);}
else{if(document.getElementById("oldImg"))oldImg=document.getElementById("oldImg");}
oldImgPosX_step+=oldImgStep*(isMoveLeft==true?1:-1);oldImg.style.left=parseInt(oldImgPosX)+oldImgPosX_step;}
function setButtonsStates(){var bRight=document.getElementById("buttonRight");var bEnd=document.getElementById("buttonEnd");var bLeft=document.getElementById("buttonLeft");var bBegin=document.getElementById("buttonBegin");if(getOnlyImagesCount()[0]==1){bRight.style.visibility="hidden";bEnd.style.visibility="hidden";bLeft.style.visibility="hidden";bBegin.style.visibility="hidden";document.getElementById("slideshowInfo").style.visibility="hidden";document.getElementById("voliviewer-slideshow").style.visibility="hidden";}
else if((getOnlyImagePosition()==getOnlyImagesCount()[0]-1&&galleryPagesCount==1)||(getOnlyImagePosition()==getOnlyImagesCount()[0]-1&&actualPageIndex==galleryPagesCount)){if(IS_BEAUTIFUL_SLIDESHOW){bRight.style.visibility="hidden";bEnd.style.visibility="hidden";bLeft.style.visibility="visible";bBegin.style.visibility="visible";}
else{bEnd.style.MozOpacity=bRight.style.MozOpacity=50/100;bEnd.style.opacity=bRight.style.opacity=50/100;bEnd.style.filter="alpha(opacity=50)";bRight.style.filter="alpha(opacity=50)";bBegin.style.MozOpacity=bLeft.style.MozOpacity=100;bBegin.style.opacity=bLeft.style.opacity=100;bBegin.style.filter="alpha(opacity=100)";bLeft.style.filter="alpha(opacity=100)";}}
else if((getOnlyImagePosition()==0&&galleryPagesCount==1)||(getOnlyImagePosition()==0&&actualPageIndex==1)){if(IS_BEAUTIFUL_SLIDESHOW){bLeft.style.visibility="hidden";bBegin.style.visibility="hidden";bRight.style.visibility="visible";bEnd.style.visibility="visible";}
else{bEnd.style.MozOpacity=bRight.style.MozOpacity=100;bEnd.style.opacity=bRight.style.opacity=100;bEnd.style.filter="alpha(opacity=100)";bRight.style.filter="alpha(opacity=100)";bBegin.style.MozOpacity=bLeft.style.MozOpacity=50/100;bBegin.style.opacity=bLeft.style.opacity=50/100;bBegin.style.filter="alpha(opacity=50)";bLeft.style.filter="alpha(opacity=50)";}}
else{if(IS_BEAUTIFUL_SLIDESHOW){bLeft.style.visibility="visible";bBegin.style.visibility="visible";bRight.style.visibility="visible";bEnd.style.visibility="visible";}
else{bEnd.style.MozOpacity=bRight.style.MozOpacity=100;bEnd.style.opacity=bRight.style.opacity=100;bEnd.style.filter="alpha(opacity=100)";bRight.style.filter="alpha(opacity=100)";bBegin.style.MozOpacity=bLeft.style.MozOpacity=100;bBegin.style.opacity=bLeft.style.opacity=100;bBegin.style.filter="alpha(opacity=100)";bLeft.style.filter="alpha(opacity=100)";}}}
function keyPressed_handler(e){if(isViewerOpened){try{document.body.scrollLeft=0;var charCode=e.keyCode?e.keyCode:e.which;switch(charCode){case 27:closeImgPanel();break;case 37:changeImage("left",false);break;case 39:changeImage("right",false);break;case 36:changeImage("begin",false);break;case 35:changeImage("end",false);break;}}
catch(e){}}}
function createEventListeners(){if(window.addEventListener){window.document.addEventListener("keyup",keyPressed_handler,false);}
if(window.attachEvent){window.document.attachEvent("onkeyup",keyPressed_handler);}}
function removeEventListeners(){if(window.addEventListener){window.document.removeEventListener("keyup",keyPressed_handler,false);}
else if(window.attachEvent){window.document.detachEvent("onkeyup",keyPressed_handler);}
window.onkeyup=null;}
function createRequestObject(){if(window.XMLHttpRequest){request=new XMLHttpRequest();}
else if(window.ActiveXObject){try{request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){xmlhttp=false;}}}}
function createRequest(queryIndex,id_obce,id_fotopary,id_galerie){var result=null;try{request.open("POST","/VismoOnline_ActionScripts/voliviewer.asp",connAsynchronous);request.setRequestHeader('Content-type','application/x-www-form-urlencoded');request.send("queryIndex="+queryIndex+"&id_obce="+id_obce+"&id_fotopary="+id_fotopary+"&id_galerie="+id_galerie);result=request.responseText;}
catch(e){}
return result;}
function getNextPageContent(pageURL){try{request.open("GET",pageURL,connAsynchronous);request.setRequestHeader('Content-type','application/x-www-form-urlencoded');request.send(null);return request.responseText;}
catch(e){}}
function setOverBackgroundColor(obj,color){if(obj.className=='voliviewer-slideshow')obj.style.backgroundColor=color;}
function verifySecretEvents(e){if(e==null)e=window.event;if(e.clientX<5&&e.clientY<5){document.cookie="isImgOpenOnClick="+(!IS_VOLIVIEWER_OPENED_ON_IMAGE_CLICK)+'';window.location.href=window.location.href;return false;}
return true;}
function getCookie(ck){if(document.cookie.length>0){var cookieList_begin=document.cookie.indexOf(ck+"=");if(cookieList_begin!=-1){cookieList_begin=cookieList_begin+ck.length+1;cookieList_end=document.cookie.indexOf(";",cookieList_begin);if(cookieList_end==-1)cookieList_end=document.cookie.length;return unescape(document.cookie.substring(cookieList_begin,cookieList_end));}}
return false;}
function getNextPages(){nextGalleryPages.previous=null;nextGalleryPages.next=null;var nextGalleryPage=document.getElementById("fgvypis");if(nextGalleryPage){nextGalleryPage=nextGalleryPage.getElementsByTagName("span");if(nextGalleryPage){for(var i=0;i<nextGalleryPage.length;i++){if(nextGalleryPage[i].className=="strzpet"){nextGalleryPages.previous=nextGalleryPage[i].getElementsByTagName("a")[0];var parNode=nextGalleryPage[i].parentNode;var urlIndex=0;chNodes=parNode.getElementsByTagName("a");galleryPagesCount=1;pagesURL=new Array();for(var j=0;j<chNodes.length;j++){if(chNodes[j].parentNode.className.indexOf("strzpet")==-1&&chNodes[j].parentNode.className.indexOf("strvpred")==-1){if(chNodes[j].href.split("stranka=")[1].length>0){galleryPagesCount=parseInt(chNodes[j].href.split("stranka=")[1].split("&")[0]);pagesURL[urlIndex++]=chNodes[j].href;}}}}
if(nextGalleryPage[i].className=="strvpred"){nextGalleryPages.next=nextGalleryPage[i].getElementsByTagName("a")[0];}}}}
if(parseInt(actualPageIndex)-1==galleryPagesCount){galleryPagesCount+=1;}}
function isCrossToNextGalleryImage(isMoveLeft,isSlideshow,objId){if(objId==-4){if(crossToNextGalleryImage(isMoveLeft,isSlideshow,objId))return true;}
else if(isNextPageCrossingEnabled&&(nextGalleryPages.previous||nextGalleryPages.next)&&((images.length==objId&&!isMoveLeft)||(-1==objId&&isMoveLeft))){if(crossToNextGalleryImage(isMoveLeft,isSlideshow,objId))return true;}
return false;}
function crossToNextGalleryImage(isMoveLeft,isSlideshow,objId){var nextPageUrl=null;var vstate=-1;if(isMoveLeft&&nextGalleryPages.previous){if(objId==-4){nextPageUrl=pagesURL[0];vstate="4";}else{nextPageUrl=nextGalleryPages.previous;vstate="2";}}
else if(!isMoveLeft&&nextGalleryPages.next){if(objId==-4){nextPageUrl=pagesURL[pagesURL.length-1];vstate="3";}else{nextPageUrl=nextGalleryPages.next;vstate="1";}}
if(nextPageUrl){document.cookie="vslideshow="+(isSlideshow?("1_"+slideshowSeconds):-1);document.cookie="vhned="+vstate;actualPageIndex=getActualPageIndex(nextPageUrl);createNextPage(getNextPageContent(nextPageUrl));}
return false;}
function createNextPage(pageContent){var onlyBody=document.createElement("div");onlyBody.innerHTML=pageContent;onlyBody=onlyBody.getElementsByTagName("div");for(var i=0;i<onlyBody.length;i++){if(onlyBody[i].id=="fgvypis"){document.getElementById("fgvypis").innerHTML=onlyBody[i].innerHTML;imagesTestingCount=0;images=null;images=Array();prepareImages(0);break;}}}
function getActualPageIndex(nextPageUrl){var tmp=nextPageUrl.toString().split('stranka=');if(tmp.length>1){return parseInt(tmp[1].split('&')[0]);}
return 1;}
function getOnlyImagePosition(){var isImagesTesting=true;var actualPos=0;var itemsCount=0;while(isImagesTesting){if(document.getElementById(actualPos)){if(actualPos==actualObjectID){isImagesTesting=false;}
else if(document.getElementById(actualPos).getAttribute("href").indexOf("id_obrazky=")>-1){itemsCount++;}}
else{isImagesTesting=false;}
actualPos++;}
return itemsCount;}
function getOnlyImagesCount(){var isImagesTesting=true;var actualPos=0;var itemsCount=0;var lastItemId=-1;while(isImagesTesting){if(document.getElementById(actualPos)){if(document.getElementById(actualPos).getAttribute("href").indexOf("id_obrazky=")>-1){itemsCount++;lastItemId=document.getElementById(actualPos).id;}}
else{isImagesTesting=false;}
actualPos++;}
return[itemsCount,lastItemId];}
function getOnlyFirstImageID(){var isImagesTesting=true;var actualPos=0;var itemsCount=0;var itemId=-1;while(isImagesTesting){if(document.getElementById(actualPos)){if(document.getElementById(actualPos).getAttribute("href").indexOf("id_obrazky=")>-1){itemId=document.getElementById(actualPos).id;isImagesTesting=false;}}
else{isImagesTesting=false;}
actualPos++;}
return itemId;}
function getMousePosition(e){if(!(e=="left"||e=="right")){if(e){posX=e.clientX;posY=e.clientY;}
else if(event){posX=event.x;posY=event.y;}}
else{if(e=="left")posX=0;else if(e=="right")posX=browserWidth;}
return{x:posX,y:posY};}
function isMouseOverVideoButton(){var imgPanel_actualImage=document.getElementById("imgPanel").getElementsByTagName("img")[0];var imgPanel_rightSidePosition=document.getElementById("imgPanel").offsetLeft+imgPanel_actualImage.offsetWidth+((document.getElementById("imgPanel").offsetWidth-imgPanel_actualImage.offsetWidth)/2);var imgPanel_bottomSidePosition=document.getElementById("imgPanel").offsetTop+imgPanel_actualImage.offsetHeight;if(imagesObj[actualObjectID]&&imagesObj[actualObjectID].isVideo==1&&(actualObjectID<images.length)&&(posX>imgPanel_rightSidePosition-CLICKABLE_VIDEO_AREA_WIDTH&&posX<imgPanel_rightSidePosition)&&(posY>imgPanel_bottomSidePosition-CLICKABLE_VIDEO_AREA_HEIGHT&&posY<imgPanel_bottomSidePosition)){return true;}
return false;}
function removeAttributeFromElement(actObj,attributeName,isClearTitle){eval("actObj."+attributeName+"_backup=actObj.getAttribute(attributeName)");actObj.setAttribute(attributeName,"");if(isClearTitle)actObj.setAttribute("title","");actObj.removeAttribute(attributeName);}
function setAttributeToElementFromBackup(actObj,attributeName,isRemoveTitle){eval("actObj.setAttribute(attributeName,actObj."+attributeName+"_backup)");if(isRemoveTitle&&actObj.getAttribute("title")!=undefined)actObj.removeAttribute("title");}
