n=navigator;nua=n.userAgent;if((nua.indexOf("Safari")!=-1)&&(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]<525)){exit}if(window.location.hash){window.location.href=window.location.hash.substring(1)}window.dhtmlHistory.create({toJSON:function(a){return Object.toJSON(a)},fromJSON:function(a){return a.evalJSON()}});function dynamic_history_change(a){if(window.location.hash){ajax_link(decodeURI(a))}else{window.location=window.location}}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 e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}Event.observe(window,"load",function(){redraw();preload()});function redraw(){var a=$("page");var b=a.style.display;a.style.display="none";a.style.display=b}Event.observe(window,"dom:loaded",function(){dhtmlHistory.initialize();dhtmlHistory.addListener(dynamic_history_change)});function intra_link(a){new Effect.ScrollTo(a,{duration:0.4})}function quicksearch_onfocus(a){Element.extend(a);if(a.value=="Search photos"){a.value="";a.removeClassName("tip")}}function quicksearch_onblur(a){Element.extend(a);if(a.value==""){a.value="Search photos";a.addClassName("tip")}}function photocart_product_size(a){new Ajax.InPlaceCollectionEditor(a,"/photocart/size",{collection:["Small poster (12x18″) — $48.90","Medium poster (16x24″) — $65.90","Large poster (20x30″) — $81.90","Extra large poster (30x45″) — $122.90","Large canvas (20x30″) — $245.90","Extra large canvas (30x45″) — $368.90"],ajaxOptions:{method:"post"},okControl:"button",cancelControl:"button",okText:"ok",cancelText:"cancel",submitOnBlur:"true",formClassName:"photocart-product-size-form",highlightcolor:"#5c665d",highlightendcolor:"#454c45"})}var closedInfoText="+ show tags...";var openedInfoText="― hide tags...";function photoMoreInfo_onclick(a){Element.extend(a);if(a.innerHTML==closedInfoText){openMoreInfo(a)}else{if(a.innerHTML==openedInfoText){closeMoreInfo(a)}}}var infoBoxOpenedCookie="infoBoxOpened";function openMoreInfo(a){Element.extend(a);a.innerHTML=openedInfoText;new Effect.BlindDown(a.next(".photo-infoBox"),{duration:0.4});createCookie(infoBoxOpenedCookie,"true",90)}function closeMoreInfo(a){Element.extend(a);a.innerHTML=closedInfoText;new Effect.BlindUp(a.next(".photo-infoBox"),{duration:0.4});createCookie(infoBoxOpenedCookie,"false",90)}function initializeInfoBox(){opened=(readCookie(infoBoxOpenedCookie)=="true");infoBoxControls=$$(".photo-infoBoxControl");infoBoxControls.each(function(a){if(opened){a.next(".photo-infoBox").show();a.innerHTML=openedInfoText}else{a.next(".photo-infoBox").hide();a.innerHTML=closedInfoText}})}function set_slideshow(a){a.index=0;a.preload=new Array(a.elements.length);document.onload=slideshow(a)}function slideshow(j){var c=(j.index+1)%j.elements.length;var d=j.elements[j.index];var f=j.elements[c];if(j.preload[c]==null){j.preload[c]=new Image();j.preload[c].src=f.source}else{var a=document.getElementById(j.base);var h=a.getElementsByTagName("img");if(h.length==1){a.appendChild(new Image());a.appendChild(new Image())}if(!j.canvasIndex){j.canvasIndex=0}var i=(j.canvasIndex+1)%2;var b=h[j.canvasIndex];var e=h[i];var g=h[2];a.href=f.link;e.src=f.source;g.style.visibility="hidden";g.style.width=d.width;g.style.height=d.height;e.style.display="none";b.style.position="absolute";e.style.position="absolute";b.style.top="0px";e.style.top="0px";b.style.left="0px";e.style.left="0px";new Effect.Parallel([new Effect.Appear(e,{sync:true}),new Effect.Fade(b,{sync:true}),new Effect.Morph(g,{style:{width:f.width},sync:true}),new Effect.Morph(g,{style:{height:f.height},sync:true})],{duration:0.7});j.canvasIndex=i;j.index=c}setTimeout(function(){slideshow(j)},j.period*1000)}var cacheSize=30;var cache=new Array();var cacheKeys=new Array();var cacheIndex=0;function put_cache(a,b){cacheIndex=cacheIndex+1%cacheSize;cacheKeys[a]=cacheIndex;cache[cacheIndex]=b}function get_cache(a){return cache[cacheKeys[a]]}function preload(){$$("#page .preload").each(function(a){var b=new Ajax.Updater("preload-buffer",a.href+"/Ajax",{method:"get",evalScripts:true,onComplete:function(c){if(b.success()){put_cache(a.pathname,$("preload-buffer").innerHTML)}}})})}Ajax.Request.prototype.abort=function(){this.transport.onreadystatechange=Prototype.emptyFunction;this.transport.abort();Ajax.activeRequestCount--};var ajaxUpdater=null;function ajax_link(a){if(a==""){return}if(ajaxUpdater!=null){ajaxUpdater.abort();ajaxUpdater=null;clear_ajax_queue();Effect.Fade("ajax-loading-indicator",{duration:0.3,queue:{scope:"ajax-loading-indicator"}})}var b=get_cache(encodeURI(a));if(b){$("content").innerHTML=b;initializeInfoBox();dhtmlHistory.add(encodeURI(a));clear_ajax_queue();Effect.Fade("ajax-loading-indicator",{duration:0.3,queue:{scope:"ajax-loading-indicator"}});preload()}else{ajaxUpdater=new Ajax.Updater("content",a+"/Ajax",{method:"get",evalScripts:true,onLoading:function(c){clear_ajax_queue();Effect.Appear("ajax-loading-indicator",{duration:1.5,delay:1,queue:{scope:"ajax-loading-indicator"}})},onSuccess:function(c){clear_ajax_queue();Effect.Fade("ajax-loading-indicator",{duration:0.3,queue:{scope:"ajax-loading-indicator"}});dhtmlHistory.add(encodeURI(a))},onComplete:function(c){clear_ajax_queue();Effect.Fade("ajax-loading-indicator",{duration:0.3,queue:{scope:"ajax-loading-indicator"}});preload()}})}}function clear_ajax_queue(){var a=Effect.Queues.get("ajax-loading-indicator");a.each(function(b){b.cancel()})}function purchase_link(b){Element.extend(b);var a=b.next(".buyBox");Element.extend(a);if(b.hasClassName("popup-buyBox-link_selected")){hidePopupBuyBox(b,a)}else{showPopupBuyBox(b,a)}}function hidePopupBuyBox(b,a){Element.extend(b);Element.extend(a);a.hide();b.removeClassName("popup-buyBox-link_selected");a.removeClassName("popup-buyBox-buyBox_selected");a.stopObserving("click",propagationStopper)}function showPopupBuyBox(b,a){Element.extend(b);Element.extend(a);a.show();b.addClassName("popup-buyBox-link_selected");a.addClassName("popup-buyBox-buyBox_selected");var c={link:b,box:a};c.boundHider=hider.bindAsEventListener(c);$(document).observe("click",c.boundHider);a.observe("click",propagationStopper)}function hider(a){hidePopupBuyBox(this.link,this.box);$(document).stopObserving("click",this.boundHider)}function propagationStopper(a){a.stopPropagation()};
