var typeF="G";var viewed=0;function zFrameCallback(){hideObj("zLoader"+typeF);showObj("zFrame"+typeF);fadeIn("zFrame"+typeF,0.08,1)}function gZoomFrame(c,s,g,b){mfiles=mFiles;lfiles=lFiles;function l(u,h,e){if(u.addEventListener){u.addEventListener(h,e,false)}else{if(u.attachEvent){u.attachEvent("on"+h,e)}}}try{if(getObjId("zNext"+c)){hideObj("zNext"+c)}if(getObjId("zPrev"+c)){hideObj("zPrev"+c)}showObj("zLoader"+c);var a=getObjId("zContainer"+c);if(a.style.display!="block"){getObjId("filter").style.height=document.body.offsetHeight+"px";getObjId("filter").style.display="block";var p=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;hB=p?p:0;if(document.documentElement.clientHeight<600){a.style.top=hB+10+"px"}else{a.style.top=hB+55+"px"}a.style.marginTop="0px";a.style.display="block";var m=a.offsetWidth;var t=a.offsetHeight;var d=document.body.offsetWidth;var o=gWS();var k=gPS();var r=Math.round(d*1/2-m*1/2);var n=Math.round(o[1]*1/2-t*1/2)-20;if(navigator.appName!="Microsoft Internet Explorer"){r+="px";n+="px"}}aFiles=lfiles.split(",");ffile=aFiles[g];var i=getObjId("zFrame"+c).src;i=b;i=i+"?"+encodeURIComponent(ffile);getObjId("zFrame"+c).src=i;hideObj("zFrame"+c);showObj("zLoader"+c);typeF=c;viewed++;if(getObjId("zPrev"+c)&&getObjId("zNext"+c)){if(g<s-1){var j=getObjId("aNext"+c);j.onclick=function(){gZoomFrame(c,s,g+1,b)};showObj("zNext"+c)}if(g>0){var f=getObjId("aPrev"+c);f.onclick=function(){gZoomFrame(c,s,g-1,b)};showObj("zPrev"+c)}}}catch(q){return true}return false}function gZoom(l,m,j,b){if(getObjId("zNext"+l)){hideObj("zNext"+l)}if(getObjId("zPrev"+l)){hideObj("zPrev"+l)}getObjId("zPhoto"+l).innerHTML="";showObj("zLoader"+l);var k=getObjId("zContainer"+l);if(k.style.display!="block"){getObjId("filter").style.height=document.body.offsetHeight+"px";getObjId("filter").style.display="block";var i=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;hB=i?i:0;if(document.documentElement.clientHeight<600){k.style.top=hB+10+"px"}else{k.style.top=hB+55+"px"}k.style.marginTop="0px";k.style.display="block";var o=k.offsetWidth;var f=k.offsetHeight;var e=document.body.offsetWidth;var r=gWS();var c=gPS();var d=Math.round(e*1/2-o*1/2);var q=Math.round(r[1]*1/2-f*1/2)-20;if(navigator.appName!="Microsoft Internet Explorer"){d+="px";q+="px"}}getObjId("zPhoto"+l).innerHTML='<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%"><tr><td style="width: 100%; height: 100%; text-align: center; vertical-align:middle;"><img id="lImg'+l+'" alt="" style="display: none;" /></td></table>';var g=new Image;aFiles=b.split(",");g.src=aFiles[j]+"l.jpg";var a=function(){if(!g.complete){setTimeout(a,1);return}getObjId("lImg"+l).src=g.src;fadeIn("lImg"+l,0.08,1);hideObj("zLoader"+l);showObj("lImg"+l)};setTimeout(a,1);if(getObjId("zPrev"+l)&&getObjId("zNext"+l)){if(j<m-1){var p=getObjId("aNext"+l);p.onclick=function(){gZoom(l,m,j+1,b)};showObj("zNext"+l)}if(j>0){var n=getObjId("aPrev"+l);n.onclick=function(){gZoom(l,m,j-1,b)};showObj("zPrev"+l)}}}function closeZoom(a){hideObj("zContainer"+a);hideObj("filter");if(window.viewed){viewed--;if(viewed>0){history.go(viewed*-1)}viewed=0}}function fadeIn(c,a,b){setOp(c,"in",0,a,b);return true}function setOp(b,h,a,j,i){try{var g=getObjId(b);var c;a*=1;if(h=="out"){a-=j;if(a<0){a=0}}else{if(h=="in"){a+=j;if(a>1){a=1}}}a*=100;a=Math.round(a)/100;if(g.style.MozOpacity!=null){g.style.MozOpacity=a}else{if(g.style.opacity!=null&&g.style.filter==null){g.style.opacity=a}else{if(g.style.filter!=null){c=100*a;g.style.filter="Alpha(opacity="+c+")"}}}if(a==0||a==1){if(a==0){g.style.display="none"}return true}var d=setTimeout(function(){setOp(b,h,a,j,i)},i)}catch(f){}}function gPS(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}return a}function gWS(){var c,a;if(self.innerHeight){c=self.innerWidth;a=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body){c=document.body.clientWidth;a=document.body.clientHeight}}}var b=new Array();b[0]=c;b[1]=a;return b}function doHref(b,a){b.href=a}function showGallery(d,e,f){if(!f){f=0}content='<table id="galleryBig" style="position: fixed; top: 0;"><tr><td class="tn" colspan="3"><div class="scroller"><div class="scrollContainer"></div></div></td></tr><tr><td class="prev"><div class="prev"></div></td><td class="content"><div id="closeButton"></div></td><td class="next"><div class="next"></div></td></tr></table>';$("#filter").after(content).css("height",$("body").height()).css("z-index",120).fadeTo("fast",0.5);$("#filter").css("height",$("body").height());var c=0,b,a;$("#"+d+" img").each(function(){b=$('<img src="'+$(this).attr("src")+'"/>').appendTo("#galleryBig td.tn div.scroller div.scrollContainer").data("bigUrl",$(this).parent("a").attr("href")).get();if(f==c++){a=b}});$("div.scrollContainer").css("width",$(b).offset().left+$(b).outerWidth()+20);$("div.scrollContainer").css("text-align","center");chooseGalleryPhoto(d,a,true);$("#galleryBig td.content").append("<iframe src="+e+' frameborder="0" scrolling="no" name="galleryBig" style="margin-bottom:20px;" />');$("#galleryBig td.tn img").unbind("click").click(function(){chooseGalleryPhoto(d,this)});$("#galleryBig").css("height",($(this).height())+"px");$(window).resize(function(){tikuGalleryIframe();hideClose()});$(window).scroll(function(){$("#filter").css("height",$("body").height())});$(document).unbind("keyup").keyup(function(g){if(g.which==39){$("#galleryBig div.next").trigger("click")}else{if(g.which==37){$("#galleryBig div.prev").trigger("click")}}if(g.which==27){closeMe()}});return false}function chooseGalleryPhoto(i,e,c){hideClose();var d=$(e).data("bigUrl");$("#galleryBig td.tn img").removeClass("currentPhoto");$(e).addClass("currentPhoto");var j=$("body").innerWidth();var g=$(e).offset().left;var h=$(e).outerWidth()+12;var f=Math.round(g*-1+j-h);var a=Math.round(j/2+h/2);if(g+h>j){var b=g-j-h;$("div.scrollContainer").animate({left:"+="+f},200,function(){})}else{if($("div.scrollContainer").offset().left<0&&g<0){var f=$("div.scrollContainer").offset().left+g*-1+12;$("div.scrollContainer").animate({left:f},200,function(){})}else{}}$("#galleryBig td.next div.next").unbind("click").click(function(){if(!$("#galleryBig td.tn img.currentPhoto").next().trigger("click").length){$("#galleryBig td.tn img").first().trigger("click")}});$("#galleryBig td.prev div.prev").unbind("click").click(function(){if(!$("#galleryBig td.tn img.currentPhoto").prev().trigger("click").length){$("#galleryBig td.tn img").last().trigger("click")}});window.getGalleryPhoto=function(){return d};if(!c){window.hideImgClb()}}function galleryImgHide(){window.reloadIframeCallback($("#galleryBig iframe").attr("src").replace(/\?.*/,""))}function setCallbacks(b,a,c){window.reloadIframeCallback=b;window.showImgClb=a;window.hideImgClb=c}function tikuGalleryIframe(){$("#galleryBig").css("height",($(window).height()));$("div.scroller").css("width",($(window).width())-4);$("#galleryBig td.content").css("height",($(window).height()-102));$("#galleryBig td.content").css("width",($(window).width()));var c=$("#galleryBig").data("photoSize");var d=$("#galleryBig td.content").innerWidth()-95;var a=$("#galleryBig td.content").innerHeight()-95;var e=Math.min(d,c.w);var b=Math.min(a,c.h);e=Math.round(Math.min(e,b*c.ratio));b=Math.round(Math.min(b,e/c.ratio));$("#galleryBig iframe").clearQueue().animate({width:e+"px",height:b+"px"},300,function(){window.showImgClb();showClose()});$("#filter").css("height",$("body").height())}function closeBtPosition(){$("div#closeButton").css("position","relative");$("div#closeButton").css("left",$("#galleryBig iframe").offset().left+$("#galleryBig iframe").outerWidth()-58);$("div#closeButton").css("top",18)}function showClose(){closeBtPosition();$("div#closeButton").fadeTo("fast",1);$("div#closeButton").unbind("click").click(closeMe)}function hideClose(){$("div#closeButton").fadeTo("fast",0);$("div#closeButton").unbind("click")}function setGalleryIframe(a,b){$("#galleryBig").data("photoSize",{w:a,h:b,ratio:(a/b)});tikuGalleryIframe()}function closeMe(){$("#galleryBig").fadeOut("fast",function(){$("#galleryBig").remove();$("#filter").fadeOut("fast",function(){$(this).css("z-index",110)})})};
