window.addEvent("domready",function(){});function load_overlay(B,E,D,A){empty_overlays();if(!A){A=0.9}var C=new Element("div",{id:"overlay","class":"loading-ajax close trans"}).injectInside(new Element("div",{id:"overlay_container"}).injectBefore($("photo_container")));if(document.all){C.setStyles({left:"10px",top:"10px"})}vFader=new Fx.Tween(C,{property:"opacity",duration:600,wait:false}).start(A).chain(function(){vAjax=new Request({url:vSite_Root+B,onRequest:function(){},onComplete:function(F,G){C.set("html",F);if(E){init_thumb_pop("#archive_thumbs a",D)}if(D=="recentcomments"){C.addEvent("click",function(){vFader.start(0).chain(function(){var H=new Fx.Scroll(window,{wait:false,duration:400,transition:Fx.Transitions.Quad.easeOut});H.toElement("container");window.location.hash="#home"})});init_thumb_pop("#comment_list a.thumb")}else{if(D=="archivecats"){C.removeClass("close");$$("a.close").addEvent("click",function(){vFader.start(0).chain(function(){load_overlay("/archive_cat.php",false,"archive")})})}else{if(D=="archive"){C.removeClass("close");$$("a.close").addEvent("click",function(){vFader.start(0).chain(function(){var H=new Fx.Scroll(window,{wait:false,duration:400,transition:Fx.Transitions.Quad.easeOut});H.toElement("container");window.location.hash="#home"})})}else{if(D=="printsize"){$$("a.close").addEvent("click",function(){vFader.start(0).chain(function(){var H=new Fx.Scroll(window,{wait:false,duration:400,transition:Fx.Transitions.Quad.easeOut});H.toElement("container")})});$$("a.viewcart").addEvent("click",function(){load_overlay("/shop_viewcart.php",false,"viewcart")});$$("a.printsize_select").addEvent("click",function(J){J=new Event(J).stop();var H=this.getProperty("id");var I=this.getProperty("rel");if(shop_addtocart(H,I)){$("photo_info_buy_added").empty().set("html","<h3>Added print size "+I+" to your cart</h3>")}})}else{if(D=="viewcart"){C.removeClass("close");$$("a.close").addEvent("click",function(){vFader.start(0).chain(function(){var H=new Fx.Scroll(window,{wait:false,duration:400,transition:Fx.Transitions.Quad.easeOut});H.toElement("container");window.location.hash="#home"})});$$("input.item_remove").addEvent("click",function(){var H=this.parentNode.parentNode.id;var I=this.parentNode.parentNode.getAttribute("rel");shop_removeitem(H,I)});$$("input.shipping_region").addEvent("click",function(){var I=this.getProperty("rel");var H=this.getProperty("value");shop_setregion(I,H)});$$("input.changeqty").addEvent("click",function(){var H=this.parentNode.parentNode.id;var J=this.getProperty("value");if(J=="+"){J="inc"}else{J="dec"}var I=this.parentNode.parentNode.getAttribute("rel");shop_changeqty(H,I,J)});init_thumb_pop("table.cartitems a.thumb")}else{if(D=="close"||D==""){C.addEvent("click",function(){vFader.start(0).chain(function(){var H=new Fx.Scroll(window,{wait:false,duration:400,transition:Fx.Transitions.Quad.easeOut});H.toElement("container");window.location.hash="#home"})})}else{C.removeClass("close")}}}}}}C.removeClass("loading-ajax")},onFailure:function(){}}).send()})}function load_archivethumbspage(A){var B=$("archive_thumbs_wrapper").empty().addClass("loading-ajax");var C=new Request({url:vSite_Root+"/archive_thumbs.php"+A,onSuccess:function(D){$("archive_thumbs_wrapper").set("html",D);init_thumb_pop("#archive_thumbs a")},onComplete:function(D){B.removeClass("loading-ajax")}}).send()}function load_nextpage(B){var C=$("page_wrapper").empty().addClass("loading-ajax");var A=new Request({url:vSite_Root+B,onSuccess:function(D){$("page_wrapper").set("html",D)},onComplete:function(D){C.removeClass("loading-ajax")}}).send()}function init_thumb_pop(C,B){if(B=="home"){vXoff=-85;vYoff=-225;if(document.all){vYoff=-210}}else{vXoff=-75;vYoff=-240;if(document.all){vYoff=-205}}var A=new TipsX3($$(C),{showDelay:0,hideDelay:0,fixed:true,offsets:{x:vXoff,y:vYoff},initialize:function(){this.fx=new Fx.Tween(this.toolTip,{property:"opacity",duration:700,wait:false}).set(0)},onShow:function(D){this.fx.start(1)},onHide:function(D){this.fx.start(0)}})}function empty_overlays(){var B=$("overlay_container");if(B){vFader=new Fx.Tween(B,{property:"opacity",duration:400,wait:false}).start(0).chain(function(){B.dispose()})}var A=$("comments");if(A){vFader=new Fx.Tween(A,{property:"opacity",duration:400,wait:false}).start(0).chain(function(){A.empty()})}}function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}function eraseAllCookies(){var A=document.cookie.split(";");for(var B=0;B<A.length;B++){var C=A[B].split(",");createCookie(C,"",-1)}}function setActiveStyleSheet(B){var A,C;for(A=0;(C=document.getElementsByTagName("link")[A]);A++){if(C.getAttribute("rel").indexOf("style")!=-1&&C.getAttribute("title")){C.disabled=true;if(C.getAttribute("title")==B){C.disabled=false}}}}function selectStyle(B,A){createCookie(B,A,90);setActiveStyleSheet(A);return false};