function thumbnail(g,e,b,f,d,a,c){this.id=g;this.galleries_id=e;this.caption=b;this.src=getServerPath(c)+"/"+f;this.width=d;this.height=a}function gallery(e,c,d,b,a){this.id=e;this.featured_images=c;this.title=d;this.section_code=b;this.photoIDs=a}var thumbnails=new Object();thumbnails[6242479]=new thumbnail(6242479,"347423","Crossing Broad in Snow","crossing_broad_in_snow_thumb.jpg",130,195,1);thumbnails[6242569]=new thumbnail(6242569,"347423","Alone in Paris","alone_in_paris_thumb.jpg",130,104,1);thumbnails[6242570]=new thumbnail(6242570,"347423","Grace Tavern, Philadelphia","grace_tavern_thumb.jpg",130,104,1);thumbnails[6242598]=new thumbnail(6242598,"347423","A  couple at Naghsh-e Jahan Square","A_couple_at_Naghsh-e_Jahan_Square_at_night_thumb.jpg",130,87,1);thumbnails[6242599]=new thumbnail(6242599,"347423","Jellyfish Silk","jellyfish_silk_thumb.jpg",130,87,1);thumbnails[6242601]=new thumbnail(6242601,"347423","Boathouse Row silhouettes","boathouse_row_silhouettes_thumb.jpg",130,87,1);thumbnails[6242602]=new thumbnail(6242602,"347423","Savannah Gothic","savannah_gothic_thumb.jpg",130,104,1);thumbnails[6242603]=new thumbnail(6242603,"347423","Time for a swim in the fountain","time_for_a_swim_in_the_fountain_thumb.jpg",130,104,1);thumbnails[6242604]=new thumbnail(6242604,"347423","St. Etienne du Mont interior","St_Etienne_du_Mont_interior_thumb.jpg",130,195,1);thumbnails[6242605]=new thumbnail(6242605,"347423","Stallion Shadow","stallion_shadow_thumb.jpg",130,87,1);thumbnails[6242606]=new thumbnail(6242606,"347423","When the aliens landed in Philadelphia","when_the_aliens_landed_in_Philadelphia_thumb.jpg",130,163,1);thumbnails[6242607]=new thumbnail(6242607,"347423","Trick of the Tail","trick_of_the_tail_thumb.jpg",130,104,1);thumbnails[1658174]=new thumbnail(1658174,"72655","Kimmel Center and Sky Fire","2081803010_ba773b0779_thumb.jpg",130,86,1);thumbnails[2628081]=new thumbnail(2628081,"72655","Elfreth's Alley","elfreths_thumb.jpg",130,87,1);thumbnails[3104971]=new thumbnail(3104971,"72655","Philadelphia evening colors ","eveningcolors_thumb.jpg",130,87,1);thumbnails[3104989]=new thumbnail(3104989,"72655","First Snowfall","firstsnowfall_thumb.jpg",130,173,1);thumbnails[3104996]=new thumbnail(3104996,"72655","Rittenhouse Reflection","rittenhousereflection_thumb.jpg",130,98,1);thumbnails[3104997]=new thumbnail(3104997,"72655","Sun Shower","sunshower_thumb.jpg",130,104,1);thumbnails[4916766]=new thumbnail(4916766,"72655","Philadelphia alley with skyscrapers","Philadelphia_alley_with_skyscrapers_thumb.jpg",130,87,1);thumbnails[6242815]=new thumbnail(6242815,"72655","Rittenhouse Snow","snow_in_rittenhouse_thumb.jpg",130,87,1);thumbnails[4916524]=new thumbnail(4916524,"72655","Time for a swim in the fountain","time_for_a_swim_thumb.jpg",130,107,1);thumbnails[963848]=new thumbnail(963848,"72655","Ginkos on Quince Street","gingkos_thumb.jpg",130,173,1);thumbnails[963851]=new thumbnail(963851,"72655","Philadelphia: Old and New","Philadelphia Old and New_thumb.jpg",130,87,1);thumbnails[1658176]=new thumbnail(1658176,"72655","The Red Door","2074937948_74c27ed18f_thumb.jpg",130,198,1);thumbnails[963852]=new thumbnail(963852,"72655","Sunset over Philadelphia","Philadelphia sunset_thumb.jpg",130,87,1);thumbnails[970913]=new thumbnail(970913,"72655","Night in colonial Philadelphia","night in colonial Philadelphia_thumb.jpg",130,87,1);thumbnails[963856]=new thumbnail(963856,"72655","Sun Shower","sun shower_thumb.jpg",130,164,1);thumbnails[969904]=new thumbnail(969904,"72655","Boathouse Row at Sunset","526931466_ade396ba1f_thumb.jpg",130,90,1);thumbnails[969908]=new thumbnail(969908,"72655","The Italian Market","Italian Market_thumb.jpg",130,152,1);thumbnails[969926]=new thumbnail(969926,"72655","Scullers on the Schuylkill River","Scullers on the Schuylkill_thumb.jpg",130,101,1);thumbnails[969946]=new thumbnail(969946,"72655","Twilight in Philadelphia","twilight in Philadelphia_thumb.jpg",130,103,1);thumbnails[963853]=new thumbnail(963853,"72655","Colonial alley with snow","Quince Street in snow1_thumb.jpg",130,135,1);thumbnails[970935]=new thumbnail(970935,"72655","Washington Square","washington square_thumb.jpg",130,102,1);thumbnails[1035375]=new thumbnail(1035375,"72655","Moon over Philadelphia","waterworks moon skyline small_thumb.jpg",130,76,1);thumbnails[971096]=new thumbnail(971096,"72655","Rittenhouse Square Christmas","Rittenhouse Christmas_thumb.jpg",130,121,1);thumbnails[1035373]=new thumbnail(1035373,"72655","The Waterworks","waterwork & boathouses night small_thumb.jpg",130,92,1);thumbnails[3104993]=new thumbnail(3104993,"72657","Gargoyle dragon","gargoyledragon_thumb.jpg",130,182,1);thumbnails[4916519]=new thumbnail(4916519,"72657","Magnolia Garden","magnoliasandwindow_thumb.jpg",130,87,1);thumbnails[971100]=new thumbnail(971100,"72657","The Rob't Morris Building","robt morris_thumb.jpg",130,98,1);thumbnails[968443]=new thumbnail(968443,"72657","Stable House","stable house1_thumb.jpg",130,122,1);thumbnails[969941]=new thumbnail(969941,"72657","Misty trees and railings","Misty trees and railings_thumb.jpg",130,150,1);thumbnails[970917]=new thumbnail(970917,"72657","Odd angel","odd angel_thumb.jpg",130,202,1);thumbnails[970920]=new thumbnail(970920,"72657","Ram power","ram power_thumb.jpg",130,163,1);thumbnails[970924]=new thumbnail(970924,"72657","Stone beastie","Striped Bass Beastie_thumb.jpg",130,173,1);thumbnails[971097]=new thumbnail(971097,"72657","Iron Studio bunnies, apocalypse","iron studio bunnies_thumb.jpg",130,86,1);thumbnails[968439]=new thumbnail(968439,"72657","The most beautiful fire escape","most beautiful fire escape_thumb.jpg",130,187,1);thumbnails[971101]=new thumbnail(971101,"72657","Bird plaque, City Hall","bird plaque_thumb.jpg",130,208,1);thumbnails[968438]=new thumbnail(968438,"72657","Firehouse gargoyle","Firehouse gargoyle_thumb.jpg",130,113,1);thumbnails[963847]=new thumbnail(963847,"72659","Angel at 30th Street Station","Angel at train station_thumb.jpg",130,210,1);thumbnails[963855]=new thumbnail(963855,"72659","Sky Rider","Sky Rider_thumb.jpg",130,164,1);thumbnails[963858]=new thumbnail(963858,"72659","Swann Fountain gold","873062958_cf8138b22b_thumb.jpg",130,87,1);thumbnails[963859]=new thumbnail(963859,"72659","Wanamaker Eagle & Organ","Wanamaker eagle & organ_thumb.jpg",130,173,1);thumbnails[970013]=new thumbnail(970013,"72659","The Dream Garden","dream garden_thumb.jpg",130,98,1);thumbnails[970928]=new thumbnail(970928,"72659","The Gates of Hell","The Gates of Hell_thumb.jpg",130,194,1);thumbnails[971080]=new thumbnail(971080,"72659","Sounds of Philadelphia/Geno's Steaks","sounds of phila-genos_thumb.jpg",130,83,1);thumbnails[971098]=new thumbnail(971098,"72659","Civil War Memorial","Civil War memorial_thumb.jpg",130,114,1);thumbnails[963849]=new thumbnail(963849,"72656","Liberty Place through birches","Liberty and birches_thumb.jpg",130,147,1);thumbnails[969937]=new thumbnail(969937,"72656","Kate's Place","Kate's Place_thumb.jpg",130,174,1);thumbnails[963850]=new thumbnail(963850,"72656","Little blue house","Little blue house_thumb.jpg",130,157,1);thumbnails[968442]=new thumbnail(968442,"72656","2303 Waverly Street","2303 Waverly1_thumb.jpg",130,144,1);thumbnails[969891]=new thumbnail(969891,"72656","Masonic Temple and Arch Street Church","arch street church_thumb.jpg",130,98,1);thumbnails[969906]=new thumbnail(969906,"72656","Swallows at City Hall","City Hall swallows_thumb.jpg",130,108,1);thumbnails[969899]=new thumbnail(969899,"72656","Bird at Kimmel Center","bird at Kimmel Center_thumb.jpg",130,98,1);thumbnails[970922]=new thumbnail(970922,"72656","Reading Terminal Headhouse","Reading Terminal headhouse_thumb.jpg",130,87,1);thumbnails[971092]=new thumbnail(971092,"72656","Magnolias in spring","magnolias on waverly_thumb.jpg",130,173,1);thumbnails[970931]=new thumbnail(970931,"72656","Tree shadows","tree shadows_thumb.jpg",130,173,1);thumbnails[971099]=new thumbnail(971099,"72656","Rowhouse reflection","Rowhouse reflection_thumb.jpg",130,196,1);thumbnails[971091]=new thumbnail(971091,"72656","Eastern State Penitentiary, with gargoyles","Eastern state gargoyles_thumb.jpg",130,91,1);thumbnails[973546]=new thumbnail(973546,"72656","Japanese House","japanese house_thumb.jpg",130,84,1);var galleries=new Object();galleries[347423]=new gallery(347423,"6242479","Dark and Light exhibit","gallery",[6242479,6242569,6242570,6242598,6242599,6242601,6242602,6242603,6242604,6242605,6242606,6242607]);galleries[72655]=new gallery(72655,"963856","Cityscapes","gallery",[1658174,2628081,3104971,3104989,3104996,3104997,4916766,6242815,4916524,963848,963851,1658176,963852,970913,963856,969904,969908,969926,969946,963853,970935,1035375,971096,1035373]);galleries[72657]=new gallery(72657,"968438","Architectural details","gallery",[3104993,4916519,971100,968443,969941,970917,970920,970924,971097,968439,971101,968438]);galleries[72659]=new gallery(72659,"970013","Public Art","gallery",[963847,963855,963858,963859,970013,970928,971080,971098]);galleries[72656]=new gallery(72656,"963850","Buildings","gallery",[963849,969937,963850,968442,969891,969906,969899,970922,971092,970931,971099,971091,973546]);var imageSets=new Object();imageSets[1]="6242815,4916766,4916524,3104997,1658176,1658174,963858,963853";imageSets[2]="6242479,970013,968438,963856,963850";imageSets[3]="6242815,6242607,6242606,6242605,6242604,6242603,6242602,6242601,6242599,6242598,6242570,6242569,6242479,4916766,4916524,4916519,3104997,3104996,3104993,3104989,3104971,2628081,1658176,1658174,1035375,1035373,973546,971101,971100,971099,971098,971097,971096,971092,971091,971080,970935,970931,970928,970924,970922,970920,970917,970913,970013,969946,969941,969937,969926,969908";function randomListVal(a){arrayVals=a.split(",");if(arrayVals.length){pos=Math.round(Math.random()*(arrayVals.length-1));val=arrayVals[pos]}else{val=0}return val}function getServerPath(a){var b=-1;switch(a){case 21:b="http://www6.clikpic.com/moocatmoocat/images";break}switch(a){case 1:b="http://www1.clikpic.com/moocatmoocat/images";break}switch(a){case 2:b="http://admin.clikpic.com/moocatmoocat/images";break}switch(a){case 24:b="http://tpc15/clikpic/moocatmoocat/images";break}switch(a){case 4:b="http://www.clikchurch.com/moocatmoocat/images";break}switch(a){case 5:b="http://www2.clikpic.com/moocatmoocat/images";break}switch(a){case 22:b="http://tpc5/clikpic/moocatmoocat/images";break}switch(a){case 23:b="http://tpc10/clikpic/moocatmoocat/images";break}switch(a){case 25:b="http://tpc16/clikpic/moocatmoocat/images";break}switch(a){case 15:b="http://www3.clikpic.com/moocatmoocat/images";break}switch(a){case 18:b="http://www4.clikpic.com/moocatmoocat/images";break}switch(a){case 19:b="http://www5.clikpic.com/moocatmoocat/images";break}switch(a){case 31:b="http://www7.clikpic.com/moocatmoocat/images";break}switch(a){case 32:b="http://admin2.clikpic.com/moocatmoocat/images";break}switch(a){case 33:b="http://www8.clikpic.com/moocatmoocat/images";break}switch(a){case 34:b="http://www9.clikpic.com/moocatmoocat/images";break}switch(a){case 35:b="http://admin3.clikpic.com/moocatmoocat/images";break}switch(a){case 37:b="http://admin4.clikpic.com/moocatmoocat/images";break}return b}function showHomeImage(a){imageID=randomListVal("");if(!basic){a.src=photos[imageID].src;a.width=photos[imageID].width;a.height=photos[imageID].height}else{newImage=new Image(photos[imageID].width,photos[imageID].height);newImage.src=photos[imageID].src;document.images[a.name]=newImage}}function showHomeImageInline(){html="";imageID=randomListVal(imageSets[1]);if("gallery"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="gallery.html">'}}html+='<img src="'+backgrounds[imageID].src+'" width="'+backgrounds[imageID].width+'" height="'+backgrounds[imageID].height+'" class="mainhomepageimage photo" id="mainSample" name="mainSample" alt="'+escape(backgrounds[imageID].caption)+'" border="0">';if("gallery"!=""){html+="</a>"}$("#homepageimage").html(html)}function getNextId(b,d,a){var c=getArrayPos(d,b);if(a){if(c==0){nextImgPos=d.length-1}else{nextImgPos=c-1}}else{if(c==d.length-1){nextImgPos=0}else{nextImgPos=c+1}}nextImg=d[nextImgPos];return nextImg}function next(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a);if(nextImg!=-1){updateImage(nextImg,d,b)}}function updateImage(f,e,b){if(!basic){document.getElementById("imagePhoto").innerHTML='<img class="mainphoto photo" src="'+photos[f].src+' " id="mainPic" name="mainPic" width="'+photos[f].width+'" height="'+photos[f].height+'" alt="'+photos[f].caption+'">';e.value=photos[f].id;$("#imageTitle").html(photos[f].caption);document.title="Photos of Philadelphia: "+photos[f].caption;if(photos[f].caption==""){document.getElementById("imageTitle").style.display="none"}else{document.getElementById("imageTitle").style.display="block"}var a=fnGetImageDetails(f);if(a==""){document.getElementById("imageDetails").style.display="none";var c=document.getElementById("infoWrap");var d=document.getElementById("photoInfo");if(photos[f].caption==""){if(c!=null){c.className="empty"}if(d!=null){d.className="empty"}}else{if(c!=null){c.className="noinfo"}if(d!=null){d.className="noinfo"}}}else{document.getElementById("imageDetails").style.display="block";var c=document.getElementById("infoWrap");if(c!=null){c.className="normal"}var d=document.getElementById("photoInfo");if(d!=null){d.className="normal"}}document.getElementById("imageDetails").innerHTML=a;resizePhotoInfo();toggleAddToCartConfirm()}else{window.location="photo_"+photos[f].id+".html"}}function toggleAddToCartConfirm(){if($("#paymentConfirm").size()){$("#paymentConfirm").hide();$("#paymentAddButton").unbind().click(function(){form=document.getElementById("paymentForm");option_id=0;if(form.item_option.value){option_id=form.item_option.value}if(addItemToBasket(form.item_number.value,photos,form.site.value,parseInt(form.quantity.value,10),option_id)){if($.browser.msie){$("#paymentConfirm").text("Item added to cart").show()}else{$("#paymentConfirm").text("Item added to cart").fadeIn()}}else{$("#paymentConfirm").text("Item not added - check cookies are enabled in your browser.").fadeIn()}})}}function fnGetImageDetails(b){var a="";if(photos[b].description!=""){a=a+'<p id="imageDescription">'+photos[b].description+"</p>"}if(photos[b].photo_ref!=""){a=a+'<p class="imageinfo" id="imageRef"><strong>Ref: </strong>'+photos[b].photo_ref+"</p>"}if(photos[b].takendate!=""){a=a+'<p class="imageinfo" id="imageDate"><strong>Date: </strong>'+photos[b].takendate+"</p>"}if(photos[b].location!=""){a=a+'<p class="imageinfo" id="imageLocation"><strong>Location: </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>'+photos[b].photographer+"</p>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				$"+(c.item_price).toFixed(2)+"</p>";var e=c.purchase_instruction;var d=(c.item_price).toFixed(2);var a=0}else{if(c.payment_groups_id!==""){b=b+"<p>Buy this print online:</p>";b=b+'<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';b=b+'<select class="paymentlink" name="payment_options_id" onchange="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';b=b+getPaymentOptions(c.payment_groups_id);b=b+"</select>";b=b+"</form>";var a=paymentGroups[c.payment_groups_id].options[0];if(paymentOptions[a]){var e=paymentOptions[a].payment_option;var d=paymentOptions[a].price}}else{}}if(c.item_price!==""||c.payment_groups_id!==""){b=b+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="MOOCATMOOCAT">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";b=b+'<div class="clearing">&nbsp;</div>'}return b}function previous(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a,1);if(nextImg!=-1){updateImage(nextImg,d,b)}}function showGalleryImage(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}function showGalleries(a){if(!basic){temp="";for(i=0;i<galleries.length;i++){if(galleries[i].id!=a){if(temp!=""){temp=temp+" | "}temp=temp+'<a href="gallery_'+galleries[i].id+'.html">'+galleries[i].title+"</a>"}}document.all.galleryLinks.innerHTML="Other galleries: "+temp}}function resizePhotoInfo(n){var b=$.extend({centre:false},n||{});var d=3;$("div#photoPanelOuter").height("auto");$("div#infoWrap").width(200);$("div#photoDetail").css("width","auto");var h=$("div#maincolContent").width();var j=$("div#photoWrap").outerWidth(true);var m=$("div#infoWrap").outerWidth(true);var k=$("div#photoWrap").outerHeight();var f=$("div#infoWrap").outerHeight();var c=$("div#infoWrap").hasClass("empty");floatDrop=0;var g=j;if(!c){if(h<(j+m)){floatDrop=1}if(!floatDrop){var a=$("div#infoWrap").innerWidth();$("div#infoWrap").width(a+(h-j-m-d));m=$("div#infoWrap").outerWidth(true);g=j+m;if(k>f){var e=$("div#photoPanelOuter").height();$("div#photoPanelOuter").height(e+(k-f));var f=$("div#infoWrap").outerHeight()}}else{var l=$("div#photoWrap").outerWidth();$("div#infoWrap").width(l)}}if(b.centre){$("div#photoDetail").width(g);$("div#photoDetail").css("margin-left","auto");$("div#photoDetail").css("margin-right","auto")}else{$("div#photoDetail").css("margin-left","0");$("div#photoDetail").css("margin-right","0")}}function getArrayPos(c,b){for(var a=0;a<c.length;a++){if(c[a]==b){return a}}return -1}function changeBgImg(a,e){var c=randomListVal(imageSets[e]);var d=backgrounds[c].src;var b=$(a);if(b.size()>0){if(/\bimg$/.test(a)){b.attr({src:d})}else{b.css({"background-image":'url("'+d+'")'})}}};