function openNewImage(src, imgWidth, imgHeight) { var dividr = document.getElementById("gallerydiv"); var divido = document.getElementById("gallerydivoveral"); var imageid = document.getElementById("galleryimg"); var loading = document.getElementById("gallery_preloader"); var imgLoading = document.getElementById("gallery_preloader_img"); loading.style.display = 'block'; imageid.style.visibility = 'hidden'; dividr.style.visibility = 'hidden'; divido.style.display = 'block'; dividr.style.display = 'block'; var str = 'limitwinW || imgHeight > limitwinH) { rw = imgWidth/limitwinW; rh = imgHeight/limitwinH; if (rw>rh) { imgWidth = limitwinW; imgHeight /= rw; } else { imgHeight = limitwinH; imgWidth /= rh; } } browser = navigator.appName; divido.style.visibility = 'visible'; divido.style.width = winW + 'px'; divido.style.height = winH + 'px'; dividr.style.left = winW/2-imgWidth/2; if (browser != "Microsoft Internet Explorer") { dividr.style.top = winH/2-imgHeight/2 + 'px'; loading.style.top = winH/2-imgLoading.height/2 + 'px'; } str += 'width="' + imgWidth + '" '; str += 'height"' + imgHeight + '" '; str += 'src="' + src + '" '; str += 'alt="' + src + '">'; document.getElementById("galleryimgput").innerHTML = str; return false; } function finishedDownload() { var imageid = document.getElementById("galleryimg"); var dividr = document.getElementById("gallerydiv"); var loading = document.getElementById("gallery_preloader"); loading.style.display = 'none'; imageid.style.visibility = 'visible'; dividr.style.visibility = 'visible'; } function nextImg() { var imageid = document.getElementById("galleryimg"); var actimg = imageid.alt; var test = false; for (img in pictures) { if (test) break; if (pictures[img] == actimg) { test = true; } } if (test) { openNewImage(pictures[img], 0, 0); } } function prevImg() { var imageid = document.getElementById("galleryimg"); var actimg = imageid.alt; var old; var test = false; for (img in pictures) { if (pictures[img] == actimg) { test = true; break; } old = pictures[img]; } if (test && (old) ) { openNewImage(old,0,0); } } function calculateTopWidthImage(id) { var imageid = document.getElementById(id); topScreen = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; constant = (pageHeight()/2 - imageid.height/2); result = topScreen + constant; return result; } function putImage(src, imgWidth, imgHeight, maxw, maxh) { var dividr = document.getElementById("divgalleryimg"); var divout = document.getElementById("usedivout"); if (imgWidth > maxw || imgHeight > maxh) { rw = imgWidth/maxw; rh = imgHeight/maxh; if (rw>rh) { imgWidth = maxw; imgHeight /= rw; } else { imgHeight = maxh; imgWidth /= rh; } } dividr.width = Math.round(imgWidth); dividr.height = Math.round(imgHeight); dividr.src = src; return false; } function closeImg() { var dividr = document.getElementById("gallerydiv"); var divido = document.getElementById("gallerydivoveral"); var imageid = document.getElementById("galleryimg"); imageid.style.visibility = 'hidden'; divido.style.display = 'none'; dividr.style.display = 'none'; } // Browser Window Size and Position // copyright Stephen Chapman, 3rd Jan 2005, 8th Dec 2005 function pageWidth() { return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null; } function pageHeight() { return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0; } function posTop() { return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0; } function posRight() { return posLeft()+pageWidth(); } function posBottom() { return posTop()+pageHeight(); }