var maxPhotoSize=700,maxPhotoBorderSize=10,thumbnailPhotoSize=50,head_title_suffix="Ron Flickinger Photography",thumbnailRows=10,thumbnailColsPerPage=4,sections=["welcomeSection","photographsSection","informationSection","collectionsSection","cartSection"],quantityDiscount=0.2,untitledTitle="(untitled)",taxPercent=4.1,mode="r",documentReadyCalled=!1,emailAddress='<a href="',emailAddress=emailAddress+String.fromCharCode(109,97,105,108,116,111,58),emailAddress=emailAddress+"info",emailAddress=emailAddress+
String.fromCharCode(64),emailAddress=emailAddress+"ronflickinger.com",emailAddress=emailAddress+"\" style='text-decoration:underline'>",emailAddress=emailAddress+" info",emailAddress=emailAddress+String.fromCharCode(64),emailAddress=emailAddress+"ronflickinger.com",emailAddress=emailAddress+"</a>",slideShowFadeSpeed=200,highlightColor="#ffd700",timer,playing=!1,speed=2,fading=!1,welcomeSlideshowTimer,welcomeSlideshowRunning=!1,welcomeSlideshowIndex=0,view=[],viewIndex=0,viewPage=0,req_query="",req_photoID=
"",query="",photoID="",internalStateChange=!1,currentInfoPage=-1,newInfoPage=-1,menuItems=["photographsMenuItem","informationMenuItem","cartMenuItem"],cart=[],printSizes=[{aspect:"1.00",sizes:"12 x 12,16 x 16,20 x 20,24 x 24,32 x 32,40 x 40".split(",")},{aspect:"1.25",sizes:"12 x 15,16 x 20,20 x 25,24 x 30,32 x 40,40 x 50".split(",")},{aspect:"1.33",sizes:"12 x 16,18 x 24,21 x 28,24 x 32,30 x 40,42 x 56".split(",")},{aspect:"1.50",sizes:"12 x 18,16 x 24,20 x 30,24 x 36,32 x 48,40 x 60".split(",")},
{aspect:"2.00",sizes:"12 x 24,16 x 32,20 x 40,24 x 48,32 x 64,40 x 80".split(",")},{aspect:"2.50",sizes:"12 x 30,16 x 40,20 x 50,24 x 60,32 x 80,40 x 100".split(",")},{aspect:"3.00",sizes:"12 x 36,16 x 48,20 x 60,24 x 72,32 x 96,40 x 120".split(",")},{aspect:"3.50",sizes:"12 x 42,16 x 56,20 x 70,24 x 84,32 x 112,40 x 140".split(",")},{aspect:"4.00",sizes:"12 x 48,16 x 64,20 x 80,24 x 96,32 x 128,40 x 160".split(",")},{aspect:"5.00",sizes:["12 x 60","16 x 80","20 x 100","24 x 120"]},{aspect:"6.00",
sizes:["12 x 72","16 x 96","20 x 120"]},{aspect:"7.00",sizes:["12 x 84","16 x 112"]},{aspect:"8.00",sizes:["12 x 96"]},{aspect:"9.00",sizes:["12 x 108"]}],printPaperTypes=["Glossy","Metallic"],printStyles=["Unmounted Print Only","Laminated Float (Ready to Hang)","Acrylic Facemounted Float (Ready to Hang)"],printPriceCurve=[[64,30,2E3,650,0.6],[64,50,2E3,900,0.6],[64,80,2E3,1650,0.6]],shippingPriceCurve=[[64,10,2E3,20,0.75],[64,30,2E3,100,0.75]];
function documentReady(){if(!documentReadyCalled)if(documentReadyCalled=!0,$.post("http://"+window.location.hostname+"/logger.php"),jQuery.browser.msie&&8>Number(jQuery.browser.version)){var a;$("body").html("<br/><br/><br/><br/><div class=alert_information>This site cannot be displayed with a version of Internet Explorer prior to version 8. Please upgrade or switch to Chrome, Firefox, Safari, Opera, etc.</div>")}else{mode=jQuery.browser.mobile?"m":"r";a='<div id=menuWrapper><div id=menu><div style=\'position:absolute;top:0;left:20px\'><img align=center src=\'/img/rfp.png\' border=0 onclick=\'pushState("", "")\'></div><div id=menuItemArea><span id=photographsMenuItem class=menuItem onclick=\'pushState("p", "")\'>Photographs</span><span id=informationMenuItem class=menuItem onclick=\'pushState("i", "")\'>Information</span><span id=cartMenuItem class=menuItem onclick=\'pushState("c", "")\'>Cart</span></div></div></div><div id=m_menuWrapper><div id=m_menu><div id=m_menuItemArea><span id=m_homeMenuItem onclick=\'pushState("", "")\'>Home</span><span id=m_photographsMenuItem onclick=\'pushState("p", "")\'>Photographs</span><span id=m_informationMenuItem onclick=\'pushState("i", "")\'>Information</span></div></div></div><div id=welcomeSection><div style=\'text-align:center;width:930px;height:530px;margin:0 auto 0 auto;\'><table width=930 cellpadding=0 cellspacing=0 border=0><tr><td width=400><div><img src=\'/img/logo.png\' border=0 /></div><div id=welcomeWord>Welcome!</div>'+
("<div id=motd>"+(""!=motd?motd:"&nbsp;")+"</div>")+"</td><td width=530 height=530><div id=welcomeImageArea><img id=welcomeImg src='' border=0 /></div></td></tr></table></div></div>"+("<div id=m_welcomeSection style='font-size:"+percentWindowWidth(5)+"px;padding:"+percentWindowWidth(1)+"px;margin:"+percentWindowWidth(4)+"px 0 "+percentWindowWidth(4)+"px 0;'>");a=a+"<div style='text-align:center'>"+("<div><img id=m_logoImg src='/img/logo.png' border=0 style='width:"+percentWindowWidth(30)+"px'>");
a+="<img id=m_rfpImg src='/img/rfp.png' border=0 style='width:"+percentWindowWidth(50)+"px;vertical-align:"+percentWindowWidth(10)+"px'></div>";a+="<div id=m_motd style='font-size:"+percentWindowWidth(4)+"px;'>"+(""!=motd?motd:"&nbsp;")+"</div>";a+="</div></div><div id=collectionsSection></div><div id=m_collectionsSection></div><div id=photographsSection><div id=controlsAndThumbnailsArea><div id=galleryTitleArea></div><div id=controlArea><table cellpadding=0 cellspacing=0 border=0><tr><td width=2 height=24 align=center valign=top>&nbsp;</td><td width=26 height=24 align=left valign=top><img class=ssButton src='/img/prev_page.png' border=0 onclick='prevPage()' /></td><td width=26 height=24 align=left valign=top><img class=ssButton src='/img/next_page.png' border=0 onclick='nextPage()' /></td><td width=40 height=24 align=center valign=top>&nbsp;</td><td width=26 height=24 align=center valign=top><img id=speedUpImg src='/img/faster.png' border=0 onclick='speedUp()' /><img id=speedDownImg src='/img/slower.png' border=0 onclick='speedDown()' /></td><td width=26 height=24 align=center valign=top><img id=playOrPause class=ssButton src='/img/play.png' border=0 onclick='playOrPauseSlideshow()' /></td><td width=40 height=24 align=center valign=top>&nbsp;</td><td width=26 height=24 align=right valign=top><img class=ssButton src='/img/prev_photo.png' border=0 onclick='prevSlide()' /></td><td width=26 height=24 align=right valign=top><img class=ssButton src='/img/next_photo.png' border=0 onclick='nextSlide()' /></td><td width=2 height=24 align=center valign=top>&nbsp;</td></tr></table></div><div id=thumbnailAreaWrapper><div id=thumbnailArea><table id=thumbnailAreaTable cellpadding=0 cellspacing=0 border=0></table></div></div><div id=pageCount></div></div><div id=photoAndInfoArea><div id=photoArea><img id=photoRegular src='' border=0 /></div><div id=infoArea><div id=photoTitleShare><span id=photoTitleRegular>&nbsp;</span><div id=sharingArea style='float:right'></div></div><div><span id=photoLocationRegular style='float:left'>&nbsp;</span><span id=addToCart style='float:right'>Add to Cart</span></div><div id=caption>&nbsp;</div><div>&nbsp;</div><div id=photoIdKeywordsCopyright><span id=copyright>&copy;&nbsp;Ron&nbsp;Flickinger</span><span id=keywords>&nbsp;</span></div></div></div></div><div id=m_photographsSection><div id=m_photographsSectionThumbnails></div><div id=m_photographsSectionFullsize></div></div><div id=informationSection><ul class=tabtitles><li id=info0title></li><li id=info1title></li><li id=info2title></li><li id=info3title></li><li id=info4title></li></ul><div class=tabdataArea><div id=info0text class=tabdata></div><div id=info1text class=tabdata></div><div id=info2text class=tabdata></div><div id=info3text class=tabdata></div><div id=info4text class=tabdata></div></div></div><div id=m_informationSection>";
for(var b=0;b<infodb.length;b++)2!=b&&(a+=infodb[b].text.replace("EMAIL",emailAddress));$("body").html(a+"</div><div id=cartSection><div id=cartTableHolder></div><br/><div id=cartInformation><form id=cartForm action='https://www.paypal.com/cgi-bin/webscr' method=post target=_blank><input type=image src='/img/paypal-checkout-button.png' alt='Proceed to Checkout' onclick='submitCartForm()' /></form><div><p>Shipping rates apply to prints shipped to all locations within the United States and Canada. All prints are shipped fully insured. Please email for quotes on international shipping, or for shipping by particular carriers or methods.</p><p>Sales tax of <span id=taxPercent></span>% will be charged only on orders shipped to locations within the state of Colorado. Orders shipped elsewhere are tax-free. Tax will be calculated at checkout.</p></div><br/><table border=0 cellpadding=0 cellspacing=0 align=center><tr><td align=center><img src='/img/card_logos.png' border=0></td></tr></table></div></div><div id=m_cartSection>The shopping cart is not available in the mobile version of the website.</div>");
-1!=navigator.userAgent.indexOf("Linux")&&($("#speedUpImg").css("top","-3px"),-1!=navigator.userAgent.indexOf("Firefox")?$("#speedDownImg").css("top","-8px"):$("#speedDownImg").css("top","-7px"));cart=[];b=readCookie("cart");if("string"===typeof b){a=b.split("&");for(b=0;b<a.length;b++){var c=a[b].split(",");if(5==c.length&&photoIDIsValid(c[0])){var d=findPhotoById(c[0]),e=findPrintSizesByAspect(d.aspect),g=Number(c[1]),f=Number(c[2]),h=Number(c[3]),c=Number(c[4]);0<=g&&g<e.sizes.length&&0<=f&&f<
printPaperTypes.length&&0<=h&&h<printStyles.length&&0<c&&1E4>c&&cart.push({id:d.photoID,size:g,paper:f,style:h,quantity:c})}}}$("#addToCart").bind("click",function(){for(var a=!1,b=0;b<cart.length;b++)if(cart[b].id==photoID){cart[b].quantity++;a=!0;break}a||cart.push({id:photoID,size:0,paper:0,style:0,quantity:1});updateCartCookie();updateMenuItems()});$("#taxPercent").html(""+taxPercent);a=[];for(b=0;b<photoCollections.length;b++){query=photoCollections[b].id;computeView();d=!1;do{d=!1;e=view[Math.floor(Math.random()*
view.length)].photoID;for(g=0;g<a.length;g++)if(a[g]==e){d=!0;break}}while(d);photoCollections[b].rep=e}query="";createCollectionsArea();for(b=0;b<infodb.length;b++)$("#info"+b+"title").html(infodb[b].title),$("#info"+b+"text").html(infodb[b].text.replace("EMAIL",emailAddress)),$("#info"+b+"title").bind("click",function(){pushState("i"+$(this).attr("id").substr(4,1),"")});b="";b="localhost"==window.location.hostname?b+"<div style='float:right;padding-top:3px;'><img src='/img/googleplusone.png' border=0 style='position:relative;top:-1px'/><img src='/img/sharebuttons.png' border=0 /></div>":
b+"<div style='float:right;margin-right:-6px;margin-top:6px;display:inline-block'><g:plusone size='small' annotation='none'></g:plusone><div class='addthis_toolbox addthis_default_style ' style='display:inline-block;margin-left:2px;'><a class='addthis_button_facebook'></a><a class='addthis_button_twitter'></a><a class='addthis_button_email'></a><a class='addthis_button_google'></a><a class='addthis_button_compact'></a></div></div><script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e5af4415c70d7ef'><\/script>";
$("#sharingArea").html(b);setThumbnailRows();$("#thumbnailArea").bind("mousewheel",function(a,b){return $("#photographsSection").is(":visible")?(0>b?nextSlide():prevSlide(),!1):!0});$(document).bind("click",function(){return $("#collectionsMenu").is(":visible")?($("#collectionsMenu").hide(),!1):!0});$(document).bind("keydown",function(a){return keydown(a)});window.History.Adapter.bind(window,"statechange",function(){var a=window.History.getState();req_query=a.data.q;req_photoID=a.data.p;internalStateChange||
handleRequest();internalStateChange=!1});$("#photoRegular").load(function(){$(this).show()});$(window).resize(function(){$("#photographsSection").is(":visible")&&(setThumbnailRows()&&(createThumbnailArea(),setThumbnailBorders()),setFullsizePhotoSize());"m"==mode&&mobileResize()});b=getUrlVars();if("r"==b.m||"m"==b.m)mode=b.m;pushState(b.q||"",b.p||"");handleRequest();setFullsizePhotoSize();"m"==mode&&mobileResize()}}
function mobileResize(){var a=Math.min($(window).width(),$(window).height());$("#m_menuWrapper").css("height",Math.floor(0.1*a)+"px");$("#m_menu").css("height",Math.floor(0.1*a)+"px");$("#m_menuItemArea").css("padding-top",Math.floor(0.02*a)+"px");var b=Math.floor(0.05*a),b="0 "+b+"px 0 "+b+"px";$("#m_homeMenuItem").css("margin",b);$("#m_homeMenuItem").css("font-size",Math.floor(0.05*a)+"px");$("#m_photographsMenuItem").css("margin",b);$("#m_photographsMenuItem").css("font-size",Math.floor(0.05*a)+
"px");$("#m_informationMenuItem").css("margin",b);$("#m_informationMenuItem").css("font-size",Math.floor(0.05*a)+"px");$("#m_logoImg").css("width",percentWindowWidth(30)+"px");$("#m_rfpImg").css("width",percentWindowWidth(50)+"px");$("#m_rfpImg").css("vertical-align",percentWindowHeight(10)+"px");createCollectionsArea();""==req_photoID?createMobileThumbnailArea():setMobileFullsizePhoto()}
function setFullsizePhotoSize(){if("r"==mode){var a=$("#menu").outerHeight(!0)+$("#infoArea").outerHeight(!0),b=$(window).height()-a-2*maxPhotoBorderSize-16,c=view[viewIndex].aspect,d=view[viewIndex].orientation,e;e=0;a=b>=maxPhotoSize?maxPhotoSize:b;"V"==d?b>=maxPhotoSize?(d=maxPhotoSize,b=Math.floor(maxPhotoSize/c)):(d=b,b=Math.floor(b/c)):(d=maxPhotoSize/c,b>=d?(b=maxPhotoSize,e=Math.floor((a-d-2*maxPhotoBorderSize)/2)+maxPhotoBorderSize):(d=b,b=Math.floor(b*c)));$("#photoRegular").css("height",
d+"px");$("#photoRegular").css("width",b+"px");$("#photoRegular").css("top",e+"px");$("#photoArea").css("height",a+2*maxPhotoBorderSize+"px")}}function setThumbnailRows(){if("r"==mode){var a=thumbnailRows,b=Math.floor(($(window).height()-150)/60);thumbnailRows=10>b?1>b?1:b:10;return a!=thumbnailRows}}function pushState(a,b){req_query=a;req_photoID=b;window.History.pushState({q:a,p:b},"",""!=a||""!=b?"?"+(""!=a?"q="+a:"")+((""!=a&&""!=b?"&":"")+(""!=b?"p="+b:"")):"/")}
function handleRequest(){var a=query!=req_query||photoID!=req_photoID;query=req_query;photoID=req_photoID;$("#collectionsMenu").hide();if("p"!=query.substr(0,1))document.title=head_title_suffix;if(""==query&&""==photoID)showContent("welcomeSection"),updateMenuItems("");else if("c"==query.substr(0,1))updateCartTable(),showContent("cartSection"),updateMenuItems("cartMenuItem");else if("p"==query.substr(0,1))showContent("collectionsSection"),updateMenuItems("photographsMenuItem");else if("i"==query.substr(0,
1)){photoID="";a=0;if(1<query.length){var b=query.substring(1);0<=b&&b<=infodb.length&&(a=b)}showContent("informationSection");if(a!=currentInfoPage){newInfoPage=a;for(b=0;b<infodb.length;b++)$("#info"+b+"title").css("background-color",b==a?"#380404":"#333");-1==currentInfoPage?($("#info"+newInfoPage+"text").fadeIn("fast","linear"),currentInfoPage=newInfoPage,newInfoPage=-1):$("#info"+currentInfoPage+"text").fadeOut("fast","linear",function(){-1!=newInfoPage&&($("#info"+newInfoPage+"text").fadeIn("fast",
"linear"),currentInfoPage=newInfoPage,newInfoPage=-1)})}updateMenuItems("informationMenuItem")}else"r"==mode?(a&&(computeView(),createThumbnailArea()),setFullsizePhoto(),setThumbnailBorders(),gotoPage(viewPage)):(a&&computeView(),mobileResize(),""==req_photoID?(createMobileThumbnailArea(),$("#m_photographsSectionFullsize").hide(),$("#m_photographsSectionThumbnails").show()):(setMobileFullsizePhoto(),$("#m_photographsSectionThumbnails").hide(),$("#m_photographsSectionFullsize").show())),showContent("photographsSection"),
updateMenuItems("photographsMenuItem")}
function createMobileThumbnailArea(){var a;a=""+("<table cellpadding=0 cellspacing=0 border=0 style='margin-top:"+percentWindowWidth(5)+"px'>");for(var b=Math.ceil(view.length/2),c=0,d=0;d<b&&c<view.length;d++){a+="<tr>";for(var e=0;2>e&&c<view.length;e++,c++){var g=view[c].orientation,f=view[c].aspect,h=percentWindowWidth(42),g="H"==g?"width:"+h+"px;margin-top:"+Math.floor(h*(f-1)/(2*f))+"px;":"height:"+h+"px;",g=g+("border:"+percentWindowWidth(1)+"px solid white;");a+="<td align=center valign=top width="+
percentWindowWidth(50)+">";a+="<div style='padding-top:"+percentWindowWidth(5)+"px'>";a+="<img src='"+photoPath(view[c].photoID,maxPhotoSize)+"' border=0 style='"+g+"' onclick='pushState(\""+query+'", "'+view[c].photoID+"\")' />";a+="</div>";a+="</td>"}a+="</tr>\n"}$("#m_photographsSectionThumbnails").html(a+"</table>")}
function updateMenuItems(a){for(var b=0;b<menuItems.length;b++)$("#"+menuItems[b]).css("border-bottom","none"),$("#m_"+menuItems[b]).css("border-bottom","none");$("#m_homeMenuItem").css("border-bottom","none");""!=a?$("#"+("m"==mode?"m_":"")+a).css("border-bottom","1px solid red"):""==a&&"m"==mode&&$("#m_homeMenuItem").css("border-bottom","1px solid red");updateCartMenuItem()}
function updateCartMenuItem(){if("r"==mode){var a=0;if(0<cart.length)for(var b=0;b<cart.length;b++)a+=cart[b].quantity;$("#cartMenuItem").html("Cart"+(0<a?" ("+a+")":""))}}
function createCollectionsArea(){for(var a="<table id=collectionsTable cellpadding=0 cellspacing=30 border=0>",b=3,c=Math.ceil(photoCollections.length/b),d=0,e=180,g=0;g<c&&d<photoCollections.length;g++){for(var a=a+"<tr height=200>",f=0;f<b&&d<photoCollections.length;f++,d++){d==photoCollections.length-1&&0<photoCollections.length%b&&(a+="<td width="+e+" align=center valign=top>&nbsp;</td>");for(var h=100<=photoCollections[d].id?"italic":"normal",i=photoCollections[d].title,l="H",j=1,k=0;k<db.length;k++)if(db[k].photoID==
photoCollections[d].rep){l=db[k].orientation;j=db[k].aspect;break}j="H"==l?"width:"+e+"px;margin-top:"+Math.floor(e*(j-1)/(2*j))+"px":"height:"+e+"px;";a+="<td width="+e+" align=center valign=top>";a+="<div class=image><img src='"+photoPath(photoCollections[d].rep,maxPhotoSize)+"' border=0 style='"+j+"' onclick='pushState(\""+photoCollections[d].id+'", "")\' /></div>';a+="<div style='margin-top:8px;font-style:"+h+"'>"+i+"</div>";a+="</td>"}a+="</tr>\n"}$("#collectionsSection").html(a+"</table>");
for(var a="<table cellpadding=0 cellspacing="+percentWindowWidth(2)+" border=0 style='margin-top:"+percentWindowWidth(5)+"px'>",b=2,c=Math.ceil(photoCollections.length/b),d=0,e=percentWindowWidth(40),m=percentWindowWidth(3),n,g=0;g<c&&d<photoCollections.length;g++){a+="<tr>";for(f=0;f<b&&d<photoCollections.length;f++,d++){h=100<=photoCollections[d].id?"italic":"normal";i=photoCollections[d].title;l="H";j=1;for(k=0;k<db.length;k++)if(db[k].photoID==photoCollections[d].rep){l=db[k].orientation;j=db[k].aspect;
break}"H"==l?(l=e,k=Math.floor(e/j),j=Math.ceil((e+2*m-k)/2),n=m):(k=e,l=Math.floor(e/j),n=Math.ceil((e+2*m-l)/2),j=m);j="width:"+l+"px;height:"+k+"px;border-width:"+j+"px "+n+"px "+j+"px "+n+"px;border-color:#444;border-style:solid;";a+="<td align=center valign=top>";a+="<div style='margin-top:"+percentWindowWidth(5)+"px;'>";a+="<img src='"+photoPath(photoCollections[d].rep,maxPhotoSize)+"' border=0 style='"+j+"' onclick='pushState(\""+photoCollections[d].id+'", "")\' />';a+="</div>";a+="<div style='margin-top:"+
percentWindowWidth(2)+"px;font-style:"+h+"'>"+i+"</div>";a+="</td>"}a+="</tr>\n"}$("#m_collectionsSection").html(a+"</table>")}function percentWindowWidth(a){return Math.floor($(window).width()*a/100)}function percentWindowHeight(a){return Math.floor($(window).height()*a/100)}function setSlideShowTimer(){clearTimeout(timer);timer=setTimeout("nextSlide(1)",1E3*speed)}
function playOrPauseSlideshow(){playing?(clearTimeout(timer),$("#playOrPause").attr("src","/img/play.png"),playing=!1):($("#playOrPause").attr("src","/img/pause.png"),playing=!0,setSlideShowTimer())}function slideFadeOutCb(){$("<img />").attr("src",photoPath(view[viewIndex].photoID,maxPhotoSize)).css("display","none").load(function(){$("body").append($(this));setFullsizePhoto();$("#photoRegular").fadeIn(slideShowFadeSpeed,slideFadeInCb)})}
function slideFadeInCb(){fading=!1;playing&&setSlideShowTimer()}
function nextSlide(a){if(!$("#photographsSection").is(":hidden"))a||(a=1),viewIndex=(viewIndex+a)%view.length,photoID=view[viewIndex].photoID,a=Math.floor(viewIndex/(thumbnailColsPerPage*thumbnailRows)),a!=viewPage&&gotoPage(a),internalStateChange=!0,pushState(query,photoID),setThumbnailBorders(),fading?(setFullsizePhoto(),fading=!0,playing&&setSlideShowTimer()):($("#photoRegular").fadeOut(slideShowFadeSpeed,slideFadeOutCb),fading=!0)}
function prevSlide(a){if(!$("#photographsSection").is(":hidden"))a||(a=1),viewIndex=(viewIndex-a+view.length)%view.length,photoID=view[viewIndex].photoID,a=Math.floor(viewIndex/(thumbnailColsPerPage*thumbnailRows)),a!=viewPage&&gotoPage(a),internalStateChange=!0,pushState(query,photoID),setThumbnailBorders(),fading?setFullsizePhoto():$("#photoRegular").fadeOut(slideShowFadeSpeed,slideFadeOutCb),fading=!0}
function gotoPage(a){var b=Math.ceil(view.length/(thumbnailColsPerPage*thumbnailRows));a<b&&0<=a&&(viewPage=a,setPageCounter(viewPage+1,b),$("#thumbnailArea").animate({left:""+-240*viewPage},slideShowFadeSpeed))}function setPageCounter(a,b){1<b?$("#pageCount").html(a+" / "+b):$("#pageCount").empty()}function nextPage(){var a=Math.ceil(view.length/(thumbnailColsPerPage*thumbnailRows));viewPage<a-1&&gotoPage((viewPage+1)%a)}
function prevPage(){var a=Math.ceil(view.length/(thumbnailColsPerPage*thumbnailRows));0<viewPage&&gotoPage((viewPage-1+a)%a)}function speedUp(){0.5<speed&&(speed-=0.5)}function speedDown(){8>speed&&(speed+=0.5)}function thumbnailOnclick(a){var b;for(b=0;b<view.length&&!(view[b].photoID==a);b++);viewIndex=b;photoID=a;internalStateChange=!0;pushState(query,photoID);setThumbnailBorders();fading?setFullsizePhoto():$("#photoRegular").fadeOut(200,slideFadeOutCb);fading=!0}
function prevPhotoMobile(){if(!$("#m_photographsSection").is(":hidden"))viewIndex=(viewIndex-1+view.length)%view.length,photoID=view[viewIndex].photoID,internalStateChange=!0,pushState(query,photoID),setMobileFullsizePhoto()}function nextPhotoMobile(){if(!$("#m_photographsSection").is(":hidden"))viewIndex=(viewIndex+1)%view.length,photoID=view[viewIndex].photoID,internalStateChange=!0,pushState(query,photoID),setMobileFullsizePhoto()}
function indexMobile(){$("#m_photographsSection").is(":hidden")||pushState(query,"")}function createCookie(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+864E5*c);c="; expires="+d.toGMTString()}else c="";document.cookie=a+"="+b+c+"; path=/"}function readCookie(a){for(var a=a+"=",b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null}
function eraseCookie(a){createCookie(a,"",-1)}function photoIDIsValid(a){if(a)for(var b=0;b<db.length;b++)if(db[b].photoID==a)return!0;return!1}
function viewSortFcn(a,b){if(a.recency!=b.recency){var c=(new Date(Number(a.recency.substr(0,4)),Number(a.recency.substr(5,2)),Number(a.recency.substr(8,2)),0,0,0,0)).getTime(),d=(new Date(Number(b.recency.substr(0,4)),Number(b.recency.substr(5,2)),Number(b.recency.substr(8,2)),0,0,0,0)).getTime();return c>d?-1:1}return Number(a.photoID)>Number(b.photoID)?-1:1}
function computeView(){view=[];"undefined"===typeof query&&(query="");if(query.match(/^\d{5}$/)&&photoIDIsValid(query))view=db,photoID=query,query=100;else{if("100"==query)view=db;else if("101"==query)for(var a=0;a<db.length;a++){var b=db[a].recency.substr(0,4),c=db[a].recency.substr(5,2),d=db[a].recency.substr(8,2);(new Date(b,c,d,0,0,0,0)).getTime()>(new Date).getTime()-158112E5&&view.push(db[a])}else if("102"==query)for(a=0;a<db.length;a++)"B"==db[a].type&&view.push(db[a]);else for(a=0;a<db.length;a++)db[a].gallery==
query&&view.push(db[a]);view.sort(viewSortFcn)}viewPage=viewIndex=0;if(photoIDIsValid(photoID))for(a=0;a<view.length;a++){if(view[a].photoID==photoID){viewIndex=a;viewPage=Math.floor(viewIndex/(thumbnailColsPerPage*thumbnailRows));break}}else if(""!=query&&0<view.length)photoID=view[0].photoID}function setThumbnailBorders(){$("*[id^=tid]:visible").css("border-color","#555");$("#tid"+view[viewIndex].photoID).css("border-color","white")}
function setFullsizePhoto(){$("#photoRegular").attr("src",photoPath(view[viewIndex].photoID,maxPhotoSize));var a=getPhotoTitle(view[viewIndex].photoID);$("#photoTitleRegular").html(a);document.title=(a==untitledTitle?"":a+" Photo - ")+head_title_suffix;$("#head_title").html=document.title;$("#photoLocationRegular").html(photoLocationText(photoLocationEnum[view[viewIndex].location]));$("#caption").html(view[viewIndex].caption);a="";if(""!=view[viewIndex].keywords){for(var b=view[viewIndex].keywords.split(","),
c=0;c<b.length;c++)a+=keywordEnum[b[c]]+", ";a=a.substr(0,a.length-2)}a=""!=a?"Keywords: "+a+" &bull; ":"&nbsp;";$("#keywords").html(a+"#"+view[viewIndex].photoID);setFullsizePhotoSize()}
function setMobileFullsizePhoto(){var a="",a=$(window).width()<$(window).height()?a+"<table width='100%' border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img id=photoMobile src='' border=0 /></td></tr><tr><td align=center valign=middle><div id=photoTitleMobile>&nbsp;</div></td></tr><tr><td align=center valign=middle>&nbsp;</td></tr><tr><td align=center valign=middle><div id=photoLocationMobile>&nbsp;</div></td></tr><tr><td align=center valign=middle>&nbsp;</td></tr><tr><td width='75%' align=center valign=middle><span id=prevPhotoMobile onclick='prevPhotoMobile()'>&larr;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id=indexMobile onclick='indexMobile()'>Index</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id=nextPhotoMobile onclick='nextPhotoMobile()'>&rarr;</span></td></tr></table>":a+
"<table width='100%' border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img id=photoMobile src='' border=0 /></td><td align=center valign=middle><div id=photoTitleMobile>&nbsp;</div><br/><div id=photoLocationMobile>&nbsp;</div><br/><span id=prevPhotoMobile onclick='prevPhotoMobile()'>&larr;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id=indexMobile onclick='indexMobile()'>Index</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id=nextPhotoMobile onclick='nextPhotoMobile()'>&rarr;</span></td></tr></table>";
$("#m_photographsSectionFullsize").html(a);$("#m_photographsSection").css("margin-top",percentWindowWidth(5)+"px");$("#photoMobile").attr("src",photoPath(view[viewIndex].photoID,maxPhotoSize));$("#photoMobile").css("border",""+percentWindowWidth(1)+"px solid white");$(window).width()<$(window).height()?($("#photoTitleMobile").css("font-size",percentWindowWidth(8)+"px"),$("#photoLocationMobile").css("font-size",percentWindowWidth(5)+"px"),$("#prevPhotoMobile").css("font-size",percentWindowWidth(8)+
"px"),$("#nextPhotoMobile").css("font-size",percentWindowWidth(8)+"px"),$("#indexMobile").css("font-size",percentWindowWidth(8)+"px"),"H"==view[viewIndex].orientation?(a=percentWindowWidth(96),$("#photoMobile").css("width",a+"px"),$("#photoMobile").css("height",Math.floor(a/view[viewIndex].aspect)+"px")):(a=percentWindowHeight(50),$("#photoMobile").css("width",Math.floor(a/view[viewIndex].aspect)+"px"),$("#photoMobile").css("height",a+"px"))):($("#photoTitleMobile").css("font-size",percentWindowWidth(5)+
"px"),$("#photoLocationMobile").css("font-size",percentWindowWidth(2.5)+"px"),$("#prevPhotoMobile").css("font-size",percentWindowWidth(5)+"px"),$("#nextPhotoMobile").css("font-size",percentWindowWidth(5)+"px"),$("#indexMobile").css("font-size",percentWindowWidth(5)+"px"),"H"==view[viewIndex].orientation?(a=percentWindowWidth(45),$("#photoMobile").css("width",a+"px"),$("#photoMobile").css("height",Math.floor(a/view[viewIndex].aspect)+"px")):(a=percentWindowHeight(75),$("#photoMobile").css("width",
Math.floor(a/view[viewIndex].aspect)+"px"),$("#photoMobile").css("height",a+"px")));a=getPhotoTitle(view[viewIndex].photoID);$("#photoTitleMobile").html(a);document.title=(a==untitledTitle?"":a+" Photo - ")+head_title_suffix;$("#head_title").html=document.title;$("#photoLocationMobile").html(photoLocationText(photoLocationEnum[view[viewIndex].location]))}
function photoLocationText(a){if(a&&""!=a){var b=a.split(">"),a="";if(3<=b.length)for(var c=b.length-1;2<=c;c--)if(-1!=b[c].indexOf("National")){a+=b[c]+", ";break}a="Antarctica"==b[0]?a+b[0]:a+("United States"==b[1]?b[2]+", USA":b[1])}return a}
function createThumbnailArea(){$("#thumbnailArea").height(60*thumbnailRows+6);$("#thumbnailAreaWrapper").height(60*thumbnailRows+6);for(var a="",b=0;b<photoCollections.length;b++)if(photoCollections[b].id==query){a+="<div id=collectionsMenuArea>";a+="<div id=collectionsMenuText>"+photoCollections[b].title+"</div>";a+="</div>";a+="<div id=collectionsMenu></div>";$("#galleryTitleArea").html(a);break}$("#collectionsMenuArea").bind("click",function(){$("#collectionsMenu").toggle();return!1});a="";for(b=
0;b<photoCollections.length;b++)a+="<div style='font-style:"+(100<=photoCollections[b].id?"italic":"normal")+"' "+(" onclick='pushState(\""+photoCollections[b].id+'", "")\' ')+">"+photoCollections[b].title+"</div>";$("#collectionsMenu").html(a);a=Math.ceil(view.length/(thumbnailRows*thumbnailColsPerPage));b="";$("#thumbnailAreaTable").empty();for(var c=0;c<thumbnailRows;c++){for(var b="<tr>",d=0;d<a;d++)for(var e=0;e<thumbnailColsPerPage;e++){var g=d*thumbnailRows*thumbnailColsPerPage+c*thumbnailColsPerPage+
e,b=b+"<td align=center valign=middle>";if(g<view.length)var f=view[g].photoID,g=view[g].title,h=" onclick='thumbnailOnclick(\""+f+"\")' onmouseover='this.style.border=\"2px solid "+highlightColor+"\"' onmouseout='setThumbnailBorders()' ",b=b+("<img class=thumbnailPhoto src='"+photoPath(f,thumbnailPhotoSize)+"' id='tid"+f+"' "+(""!=g?"title='"+g+"' ":"")+" border=0 "+h+"/>");b+="</td>"}b+="</tr>";$("#thumbnailAreaTable").append(b)}setPageCounter(viewPage+1,a)}
function getUrlVars(){for(var a=[],b,c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),d=0;d<c.length;d++)b=c[d].split("="),a.push(b[0]),a[b[0]]=b[1];return a}
function showContent(a){"welcomeSection"!=a&&(welcomeSlideshowRunning=!1);"m"==mode?($("#menuWrapper").hide(),$("#m_menuWrapper").show()):($("#m_menuWrapper").hide(),$("#menuWrapper").show());for(var b=0;b<sections.length;b++)sections[b]!=a&&($("#"+sections[b]).hide(),$("#m_"+sections[b]).hide());$("#"+("m"!=mode?"m_":"")+a).hide();$("#"+("m"==mode?"m_":"")+a).show();"welcomeSection"==a&&"r"==mode&&($("#welcomeImageArea").hide(),$("body > img").remove(),welcomeSlideshowRunning=!0,welcomeSlideshowIndex=
Math.floor(Math.random()*db.length),$("<img />").attr("src",photoPath(db[welcomeSlideshowIndex].photoID,maxPhotoSize)).css("display","none").load(function(){$("body").append($(this));$("#welcomeImg").attr("src",photoPath(db[welcomeSlideshowIndex].photoID,maxPhotoSize));$("#welcomeImageArea").fadeIn("slow",startWelcomeSlideShow)}))}function startWelcomeSlideShow(){welcomeSlideshowTimer=setTimeout("loadNextWelcomeImage()",2E3)}
function loadNextWelcomeImage(){clearTimeout(welcomeSlideshowTimer);if(welcomeSlideshowRunning){var a;do a=Math.floor(Math.random()*db.length);while(a==welcomeSlideshowIndex);welcomeSlideshowIndex=a;$("<img />").attr("src",photoPath(db[welcomeSlideshowIndex].photoID,maxPhotoSize)).css("display","none").load(function(){$("body").append($(this));welcomeSlideFadeOut()})}}function welcomeSlideFadeOut(){clearTimeout(welcomeSlideshowTimer);$("#welcomeImageArea").fadeOut("slow",welcomeSlideFadeIn)}
function welcomeSlideFadeIn(){$("#welcomeImg").attr("src",photoPath(db[welcomeSlideshowIndex].photoID,maxPhotoSize));$("#welcomeImageArea").fadeIn("slow",welcomeNext)}function welcomeNext(){welcomeSlideshowTimer=setTimeout("loadNextWelcomeImage()",2E3)}function photoPath(a,b){var c="";100>b?c="00":1E3>b&&(c="0");return"/photo/"+a+"_"+c+b+".jpg"}
function keydown(a){switch(a.keyCode||a.which){case 37:return prevSlide(),!1;case 39:return nextSlide(),!1;case 38:return a=view.length%thumbnailColsPerPage,prevSlide(viewIndex<a?a:viewIndex<thumbnailColsPerPage?a+thumbnailColsPerPage:thumbnailColsPerPage),!1;case 40:return a=view.length%thumbnailColsPerPage,nextSlide(view.length-viewIndex<=a?a:view.length-viewIndex<=thumbnailColsPerPage?a+thumbnailColsPerPage:thumbnailColsPerPage),!1;case 13:return playOrPauseSlideshow(),!1;case 189:return speedDown(),
!1;case 187:return speedUp(),!1;default:return!0}}function findPhotoById(a){for(var b=0;b<db.length;b++)if(db[b].photoID==a)return db[b];return null}function findPrintSizesByAspect(a){for(var b=0;b<printSizes.length;b++)if(printSizes[b].aspect==a)return printSizes[b];return null}
function updateCartTable(){var a="";updateCartMenuItem();if(0==cart.length)a+="<br/><br/><br/><br/><div class=alert_information>Your shopping cart is empty.</div>",$("#cartTableHolder").empty(),$("#cartTableHolder").html(a),$("#cartInformation").hide();else{for(var a=a+"<table id=cartTable cellpadding=0 cellspacing=0 border=0><tr><td class=cartHeader width=20 style='border-top-left-radius:8px'></td><td class=cartHeader>Photograph</td><td class=cartHeader>Size</td><td class=cartHeader>Paper</td><td class=cartHeader>Style</td><td class=cartHeader>Price</td><td class=cartHeader>Quantity</td><td class=cartHeader style='border-top-right-radius:8px'>Total</td></tr>",
b=0;b<cart.length;b++){for(var c=findPhotoById(cart[b].id),d=getPhotoTitle(cart[b].id),e=findPrintSizesByAspect(c.aspect),a=a+"<tr>",a=a+("<td class=cartItemCenter style='border-left:2px solid #888'><div style='color:red;font-size:18px;text-align:center;font-style:normal;cursor:default' onclick='deleteItem("+b+")'>&times;</div></td>"),a=a+("<td class=cartItemCenter><div><img src='"+photoPath(c.photoID,maxPhotoSize)+"' border=0 /></div><div>"+d+"</div><div style='font-size:10px'>#"+cart[b].id+"</div></td>"),
a=a+"<td class=cartItemLeft width=100>",c=0;c<e.sizes.length;c++)a+="<div><label><input type=radio name=size"+b+" onchange='updateItemSize("+b+","+c+")' "+(c==cart[b].size?"checked":"")+" />"+e.sizes[c]+"&quot;</label></div>";a+="</td>";a+="<td class=cartItemLeft width=90>";for(c=0;c<printPaperTypes.length;c++)a+="<div><label><input type=radio name=paper"+b+" onchange='updateItemPaper("+b+","+c+")' "+(c==cart[b].paper?"checked":"")+" />"+printPaperTypes[c]+"</label></div>";a+="</td>";a+="<td class=cartItemLeft>";
for(c=0;c<printStyles.length;c++)a+="<div><label><input type=radio name=style"+b+" onchange='updateItemStyle("+b+","+c+")' "+(c==cart[b].style?"checked":"")+" />"+printStyles[c]+"</label></div>";a+="</td>";a+="<td id=unitPrice"+b+" class=cartItemRight></td>";a+="<td class=cartItemRight><input id=quantity"+b+" type=text value='"+cart[b].quantity+"' size=4 maxlength=4 onchange='updateItemQuantity("+b+")' style='text-align:right' /></td>";a+="<td id=linePrice"+b+" class=cartItemRight style='border-right:2px solid #888'></td>";
a+="</tr>"}a+="</table><br/><table id=cartSummaryTable cellpadding=0 cellspacing=0 border=0><tr><td class=subtotalLeft>Subtotal</td><td class=subtotalRight id=cartSubtotal></td></tr><tr><td class=subtotalLeft>Quantity Discount</td><td class=subtotalRight id=cartDiscount></td></tr><tr><td class=subtotalLeft>Shipping &amp; Handling</td><td class=subtotalRight id=cartShipping></td></tr><tr><td class=subtotalLeft>Total (USD)</td><td class=subtotalRight id=cartTotal></td></tr></table>";$("#cartTableHolder").empty();
$("#cartTableHolder").html(a);$("#cartInformation").show();jQuery.browser.msie&&($("input[type='radio']").unbind("click"),$("input[type='radio']").bind("click",function(){$(this).trigger("change")}));updateCosts()}}function priceRound(a){return 5*Math.floor(a/5+0.5)}
function getPrice(a,b,c){var d=1==a?shippingPriceCurve:printPriceCurve,c=c.split(" x ");if(2==c.length)c=c[0]*c[1],64>c&&(c=64);else return 0;var e=d[b][0],g=d[b][1],f=d[b][3],a=d[b][4],b=Math.pow(d[b][2]/e,a),b=(f-g*b)/(1-b),d=(g-b)/Math.pow(e,a);return priceRound(d*Math.pow(c,a)+b)}
function updateCartCookie(){for(var a="",b=0;b<cart.length;b++)a+=cart[b].id+","+cart[b].size+","+cart[b].paper+","+cart[b].style+","+cart[b].quantity+"&";0<a.length&&(a=a.substr(0,a.length-1));createCookie("cart",a,1E4)}function centsRound(a){return Math.round(100*a)/100}function moneyFormat(a){var b=0>a?"-":"",a=Math.abs(a),c=Math.floor(a),a=Math.floor(100*(a-c));10>a&&(a="0"+a);return b+"$"+c+"."+a}
function updateItemQuantity(a){1>Number($("#quantity"+a).val())?deleteItem(a):(cart[Number(a)].quantity=Number($("#quantity"+a).val()),updateCartCookie(),updateCartTable())}function deleteItem(a){for(var b=[],c=0;c<cart.length;c++)c!=a&&b.push(cart[c]);cart=b;updateCartCookie();updateCartTable()}
function updateCosts(){for(var a=0,b="",c="",d=0,e=0,g=0,f=0;f<cart.length;f++){var h=findPhotoById(cart[f].id),h=findPrintSizesByAspect(h.aspect),i=priceRound(getPrice(0,cart[f].style,h.sizes[cart[f].size]));$("#unitPrice"+f).html(moneyFormat(i));var l=cart[f].quantity*i;$("#linePrice"+f).html(moneyFormat(l));g+=l;e+=cart[f].quantity;i>d&&(d=i);0==cart[f].style?(i=h.sizes[cart[f].size].split(" x "),i=i[0]*i[1],i>c&&(c=h.sizes[cart[f].size])):(i=h.sizes[cart[f].size].split(" x "),i=i[0]*i[1],i>a&&
(a=i,b=h.sizes[cart[f].size]))}$("#cartSubtotal").html(moneyFormat(g));f=0;1<e&&(f=-centsRound(quantityDiscount*(g-d)));$("#cartDiscount").html(moneyFormat(f));d=0;d=0<a?centsRound(getPrice(1,1,b)+-10):centsRound(getPrice(1,0,c));$("#cartShipping").html(moneyFormat(d));a=centsRound(g+f+d);$("#cartTotal").html(moneyFormat(a))}function updateItemSize(a,b){cart[Number(a)].size=Number(b);updateCartCookie();updateCosts()}
function updateItemPaper(a,b){cart[Number(a)].paper=Number(b);updateCartCookie()}function updateItemStyle(a,b){cart[Number(a)].style=Number(b);updateCartCookie();updateCosts()}function getPhotoTitle(a){a=findPhotoById(a);return null!=a&&""!=a.title?a.title:untitledTitle}
function submitCartForm(){$("#cartForm > input[type='hidden']").remove();var a,b;a="<input type=hidden name=cmd value=_cart><input type=hidden name=upload value=1><input type=hidden name=business value='info@ronflickinger.com'><input type=hidden name=no_note value=1><input type=hidden name=currency_code value=USD>";for(var c=0;c<cart.length;c++){b=findPhotoById(cart[c].id);var d=getPhotoTitle(cart[c].id),e=findPrintSizesByAspect(b.aspect);a+="<input type=hidden name=item_name_"+(c+1)+" value=\"'"+
d+"' Photograph (#"+b.photoID+')">';a+="<input type=hidden name=on0_"+(c+1)+" value='Photo'>";b=e.sizes[cart[c].size]+", "+printPaperTypes[cart[c].paper]+", "+printStyles[cart[c].style];a+="<input type=hidden name=os0_"+(c+1)+" value='"+b+"'>";a+="<input type=hidden name=quantity_"+(c+1)+" value='"+cart[c].quantity+"'>";b=$("#unitPrice"+c).html();b=b.substr(1);a+="<input type=hidden name=amount_"+(c+1)+" value='"+b+"'>"}b=$("#cartDiscount").html();b="$0.00"==b?"0":b.substr(2);a+="<input type=hidden name=discount_amount_cart value='"+
b+"'>";b=$("#cartShipping").html();b=b.substr(1);$("#cartForm > input").append(a+("<input type=hidden name=handling_cart value='"+b+"'>"));$("#cartForm").submit()};

