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[1877898]=new thumbnail(1877898,"126199","Exterior 1","Exterior Front 2_thumb.jpg",130,87,1);thumbnails[1975401]=new thumbnail(1975401,"126199","Exterior 2","Holiday_Rental_exterior_thumb.jpg",130,87,1);thumbnails[1898324]=new thumbnail(1898324,"126199","Exterior 3","Townhouse_Exterior_thumb.jpg",130,87,1);thumbnails[1899645]=new thumbnail(1899645,"126199","Apartments Exterior","Apartment Complex_thumb.jpg",130,87,1);thumbnails[2542316]=new thumbnail(2542316,"126199","Apartment Complex 2","Pacific Blue Resort Pool_thumb.jpg",130,87,1);thumbnails[2542342]=new thumbnail(2542342,"126199","Exterior 4","Exterior1_thumb.jpg",130,87,1);thumbnails[4097070]=new thumbnail(4097070,"126204","Living Room","Living_Room_211_thumb.jpg",130,87,1);thumbnails[1944549]=new thumbnail(1944549,"126204","Living Area 2","Living_Room_1_thumb.jpg",130,87,1);thumbnails[4097072]=new thumbnail(4097072,"126204","Dining","Upstairs_Unit_Dining_thumb.jpg",130,87,1);thumbnails[1877901]=new thumbnail(1877901,"126204","Living Area 3","Living_Room_2112_thumb.jpg",130,87,1);thumbnails[1898181]=new thumbnail(1898181,"126204","Kitchen and Living Area","Kitchen_Plus_Living_thumb.jpg",130,87,1);thumbnails[2680218]=new thumbnail(2680218,"126204","Dining Area 2","Dining_1_thumb.jpg",130,87,1);thumbnails[4097073]=new thumbnail(4097073,"126204","Living Area","Living_Area_1b1_thumb.jpg",130,87,1);thumbnails[1898183]=new thumbnail(1898183,"126204","Balcony","Balcony_thumb.jpg",130,87,1);thumbnails[1944559]=new thumbnail(1944559,"126204","Dining Room","Dining_Living_thumb.jpg",130,87,1);thumbnails[1944558]=new thumbnail(1944558,"126204","Kitchen 3","Kitchen 1 TV_thumb.jpg",130,87,1);thumbnails[2680258]=new thumbnail(2680258,"126204","Master Bedroom 3","Main Bedroom 3_thumb.jpg",130,87,1);thumbnails[1898180]=new thumbnail(1898180,"126204","Living Area 1","Living Room 2_thumb.jpg",130,87,1);thumbnails[2680260]=new thumbnail(2680260,"126204","Living Area with view","Living_Room_11_thumb.jpg",130,87,1);thumbnails[2680262]=new thumbnail(2680262,"126204","Living Area 3","Curry St Rec Room 1_thumb.jpg",130,87,1);thumbnails[2680270]=new thumbnail(2680270,"126204","Bathroom","Ensuite Bathroom 1_thumb.jpg",130,87,1);thumbnails[2698168]=new thumbnail(2698168,"126202","Twilight Exterior 1","Curry St Exterior Rear_thumb.jpg",130,87,1);thumbnails[2001991]=new thumbnail(2001991,"126202","Twilight Exterior 2","MJ Homes Bronte 101_thumb.jpg",130,87,1);thumbnails[1944550]=new thumbnail(1944550,"126202","Twilight Exterior 3","Pool 1_thumb.jpg",130,87,1);thumbnails[1889514]=new thumbnail(1889514,"126202","Twilight Exterior 4","House_2_Exterior_3_thumb.jpg",130,87,1);thumbnails[2680245]=new thumbnail(2680245,"126202","Twilight Exterior 5","Unit_5_Exterior_Twilight_thumb.jpg",130,87,1);thumbnails[2680247]=new thumbnail(2680247,"126202","Twilight Exterior 6","Exterior 1a (fake sky)_thumb.jpg",130,87,1);thumbnails[1898302]=new thumbnail(1898302,"126202","Twilight Exterior 7","House_1_Exterior_3_thumb.jpg",130,87,1);thumbnails[1889513]=new thumbnail(1889513,"126202","Twilight Exterior 8","Outdoor Entertaining 2_thumb.jpg",130,87,1);thumbnails[2698169]=new thumbnail(2698169,"126202","Twilight Exterior 9","Curry St Pool Spa 2_thumb.jpg",130,87,1);thumbnails[4784639]=new thumbnail(4784639,"273832","Pool 1","Pool_2_thumb.jpg",130,87,1);thumbnails[4784642]=new thumbnail(4784642,"273832","Pool 2","Pool_thumb.jpg",130,87,1);thumbnails[4784645]=new thumbnail(4784645,"273832","Pool 3","Pool_3_edit_2_thumb.jpg",130,87,1);thumbnails[4784649]=new thumbnail(4784649,"273832","Outdoor Entertaining 1","Outdoor_Entertaining_thumb.jpg",130,87,1);thumbnails[4784654]=new thumbnail(4784654,"273832","Outdoor Entertaining 2","Monte_Carlo_Alfresco_3_thumb.jpg",130,87,1);thumbnails[4784657]=new thumbnail(4784657,"273832","Outdoor Entertaining 3","Sorrento_Alfresco_9_thumb.jpg",130,87,1);thumbnails[1877903]=new thumbnail(1877903,"126205","Commercial exterior 1","Commercial Exterior_thumb.jpg",130,87,1);thumbnails[1899639]=new thumbnail(1899639,"126205","Commercial Exterior 2","Price Waterhouse_adjusted_thumb.jpg",130,87,1);thumbnails[2680214]=new thumbnail(2680214,"126205","Commercial Exterior 3","Great Northern Hotel Exterior 1_thumb.jpg",130,87,1);thumbnails[1878076]=new thumbnail(1878076,"126210","Warners Bay","Warners Bay Sunset 1 signed_thumb.jpg",130,87,1);thumbnails[2202845]=new thumbnail(2202845,"126210","Newcastle Harbour 1","Breakwater Location Shot 2_thumb.jpg",130,87,1);thumbnails[1898385]=new thumbnail(1898385,"126210","Merewether 1","Merewether Baths at Dusk 5_thumb.jpg",130,87,1);thumbnails[1898388]=new thumbnail(1898388,"126210","Belmont","Belmont at Dusk 3_thumb.jpg",130,87,1);thumbnails[1898391]=new thumbnail(1898391,"126210","Nobby's Beach","Nobby's Beach 2_thumb.jpg",130,87,1);thumbnails[1898393]=new thumbnail(1898393,"126210","Caves Beach","Caves Beach 2_thumb.jpg",130,87,1);thumbnails[1898394]=new thumbnail(1898394,"126210","Bar Beach","Bar Beach Rock Platform 3_thumb.jpg",130,87,1);thumbnails[1898395]=new thumbnail(1898395,"126210","Merewether 2","10 to 2 (resized)_thumb.jpg",130,87,1);thumbnails[1898396]=new thumbnail(1898396,"126210","Bogey Hole","Bogey Hole at Dusk 10_thumb.jpg",130,87,1);thumbnails[1898397]=new thumbnail(1898397,"126210","Newcastle Beach","Newcastle Beach Childrens Pool 11_thumb.jpg",130,87,1);thumbnails[2202847]=new thumbnail(2202847,"126210","Newcastle Harbour 2","Breakwater Location Shot 1_thumb.jpg",130,87,1);thumbnails[2202848]=new thumbnail(2202848,"126210","Toronto","Toronto at Dusk 1_thumb.jpg",130,87,1);var galleries=new Object();galleries[126199]=new gallery(126199,"1898324","Exteriors","gallery",[1877898,1975401,1898324,1899645,2542316,2542342]);galleries[126204]=new gallery(126204,"1877901","Interiors","gallery",[4097070,1944549,4097072,1877901,1898181,2680218,4097073,1898183,1944559,1944558,2680258,1898180,2680260,2680262,2680270]);galleries[126202]=new gallery(126202,"2698169,2698168","Twilight","gallery",[2698168,2001991,1944550,1889514,2680245,2680247,1898302,1889513,2698169]);galleries[273832]=new gallery(273832,"4784639","Pool & Outdoor","gallery",[4784639,4784642,4784645,4784649,4784654,4784657]);galleries[126205]=new gallery(126205,"1877903","Commercial","gallery",[1877903,1899639,2680214]);galleries[126210]=new gallery(126210,"1878076","Locations","gallery",[1878076,2202845,1898385,1898388,1898391,1898393,1898394,1898395,1898396,1898397,2202847,2202848]);var imageSets=new Object();imageSets[1]="4784649,4784642,4097073,4097070,2698169,2680260,2680247,1944559,1944558,1944549,1898181,1889513";imageSets[2]="4784639,2698169,2698168,1898324,1878076,1877903,1877901";imageSets[3]="4784657,4784654,4784649,4784645,4784642,4784639,4097073,4097072,4097070,2698169,2698168,2680270,2680262,2680260,2680258,2680247,2680245,2680218,2680214,2542342,2542316,2202848,2202847,2202845,2001991,1975401,1944559,1944558,1944550,1944549,1899645,1899639,1898397,1898396,1898395,1898394,1898393,1898391,1898388,1898385,1898324,1898302,1898183,1898181,1898180,1889514,1889513,1878076,1877903,1877901";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/nrep/images";break}switch(a){case 1:b="http://www1.clikpic.com/nrep/images";break}switch(a){case 2:b="http://admin.clikpic.com/nrep/images";break}switch(a){case 24:b="http://tpc15/clikpic/nrep/images";break}switch(a){case 4:b="http://www.clikchurch.com/nrep/images";break}switch(a){case 5:b="http://www2.clikpic.com/nrep/images";break}switch(a){case 22:b="http://tpc5/clikpic/nrep/images";break}switch(a){case 23:b="http://tpc10/clikpic/nrep/images";break}switch(a){case 25:b="http://tpc16/clikpic/nrep/images";break}switch(a){case 15:b="http://www3.clikpic.com/nrep/images";break}switch(a){case 18:b="http://www4.clikpic.com/nrep/images";break}switch(a){case 19:b="http://www5.clikpic.com/nrep/images";break}switch(a){case 31:b="http://www7.clikpic.com/nrep/images";break}switch(a){case 32:b="http://admin2.clikpic.com/nrep/images";break}switch(a){case 33:b="http://www8.clikpic.com/nrep/images";break}switch(a){case 34:b="http://www9.clikpic.com/nrep/images";break}switch(a){case 35:b="http://admin3.clikpic.com/nrep/images";break}switch(a){case 37:b="http://admin4.clikpic.com/nrep/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="NEWCASTLE   REAL   ESTATE   PHOTOGRAPHY: "+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;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>"}if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Order this print:</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="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';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+'<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(c,b){imageID=randomListVal(galleries[c].featured_images);if(imageID!=0){b.src=thumbnails[imageID].src;b.width=thumbnails[imageID].width;b.height=thumbnails[imageID].height;if(b.width<130){var f=$("img#gallery"+c);f.parents(".thumbWrap").width(b.width);var a=f.siblings("h3").size()==1?f.siblings("h3"):f.parent(".thumbWrap").siblings("h3");var g=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right"));var d=parseInt(a.css("border-left-width"))+parseInt(a.css("border-right-width"));var e=parseInt(f.parents(".thumbWrap").css("border-left-width"))+parseInt(f.parents(".thumbWrap").css("border-right-width"));a.width(f.outerWidth(true)-g-d+e)}}}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+'")'})}}};