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[5221663]=new thumbnail(5221663,"294518","","Flava_007_thumb.jpg",130,130,5);thumbnails[5221685]=new thumbnail(5221685,"294518","","Flava_008_thumb.jpg",130,130,5);thumbnails[5221567]=new thumbnail(5221567,"294518","","Flava_001_thumb.jpg",130,130,5);thumbnails[5221587]=new thumbnail(5221587,"294518","","Flava_002_thumb.jpg",130,130,5);thumbnails[5221592]=new thumbnail(5221592,"294518","","Flava_003_thumb.jpg",130,130,5);thumbnails[5221597]=new thumbnail(5221597,"294518","","Flava_004_thumb.jpg",130,130,5);thumbnails[5221655]=new thumbnail(5221655,"294518","","Flava_005_thumb.jpg",130,130,5);thumbnails[5221661]=new thumbnail(5221661,"294518","","Flava_006_thumb.jpg",130,130,5);thumbnails[3044266]=new thumbnail(3044266,"187288","","elderslie_thumb.jpg",130,130,5);thumbnails[3045878]=new thumbnail(3045878,"187385","Main Dining Area","amber_pan_thumb.jpg",130,130,5);thumbnails[3753767]=new thumbnail(3753767,"229068","Existing Elevation","1797_bef_01_thumb.jpg",130,130,5);thumbnails[3753790]=new thumbnail(3753790,"229071","INTERIOR","turnberry_w_thumb.jpg",130,130,5);thumbnails[3753819]=new thumbnail(3753819,"229074","DENTAL SURGERY","dental-room-7-panorama-3_thumb.jpg",130,130,5);thumbnails[3753961]=new thumbnail(3753961,"229103","Photo-realistic Perspective","east_india_1_thumb.jpg",130,130,5);thumbnails[3778030]=new thumbnail(3778030,"230412","Open Courtyard","CGC_02_thumb.jpg",130,130,5);thumbnails[3885587]=new thumbnail(3885587,"235991","","arch_1_thumb.jpg",130,130,5);thumbnails[5124026]=new thumbnail(5124026,"289570","Photo-realistic 3-d image of proposal prepared in-house.","columbas_001_thumb.jpg",130,130,5);thumbnails[3044272]=new thumbnail(3044272,"187288","","elderslie_2_thumb.jpg",130,130,5);thumbnails[3753772]=new thumbnail(3753772,"229068","Rear elevation with extension","1797_aft_03_thumb.jpg",130,130,5);thumbnails[3753827]=new thumbnail(3753827,"229074","RECEPTION AREA","reception_3_thumb.jpg",130,130,5);thumbnails[3753928]=new thumbnail(3753928,"187385","Dining Area and Bar","amber_1_thumb.jpg",130,130,5);thumbnails[3754125]=new thumbnail(3754125,"229103","Elevation to Marina","east_india_2_thumb.jpg",130,130,5);thumbnails[3778032]=new thumbnail(3778032,"230412","Open Display","CGC_05_thumb.jpg",130,130,5);thumbnails[3885589]=new thumbnail(3885589,"235991","","arch_2_thumb.jpg",130,130,5);thumbnails[5124029]=new thumbnail(5124029,"289570","Photo-realistic 3-d image of proposal prepared in-house.","columbas_002_thumb.jpg",130,130,5);thumbnails[3753775]=new thumbnail(3753775,"229068","INTERIOR VIEW","1797_aft_01_thumb.jpg",130,130,5);thumbnails[3753839]=new thumbnail(3753839,"229074","Student Surgery","student-room-2_thumb.jpg",130,130,5);thumbnails[3753930]=new thumbnail(3753930,"187385","Booth Seating","amber_2_thumb.jpg",130,130,5);thumbnails[3754130]=new thumbnail(3754130,"229103","Gabel Elevation","east_india_3_thumb.jpg",130,130,5);thumbnails[3778033]=new thumbnail(3778033,"230412","Display and Pergola","CGC_06_thumb.jpg",130,130,5);thumbnails[3885591]=new thumbnail(3885591,"235991","","arch_3_thumb.jpg",130,130,5);thumbnails[4415989]=new thumbnail(4415989,"187288","","DSC_5835_thumb.jpg",130,130,5);thumbnails[5124030]=new thumbnail(5124030,"289570","Photo-realistic 3-d image of proposal prepared in-house.","columbas_003_thumb.jpg",130,130,5);thumbnails[3753776]=new thumbnail(3753776,"229068","Interior View","1797_aft_02_thumb.jpg",130,130,5);thumbnails[3753931]=new thumbnail(3753931,"187385","Dining Area and Shopfront","amber_3_thumb.jpg",130,130,5);thumbnails[3754133]=new thumbnail(3754133,"229103","Elevation to Town Centre","east_india_4_thumb.jpg",130,130,5);thumbnails[3778034]=new thumbnail(3778034,"230412","Pergola","CGC_08_thumb.jpg",130,130,5);thumbnails[3885592]=new thumbnail(3885592,"235991","","arch_4_thumb.jpg",130,130,5);thumbnails[4415990]=new thumbnail(4415990,"187288","","DSC_5854_thumb.jpg",130,130,5);thumbnails[3778038]=new thumbnail(3778038,"230412","Display and Retail Sheds","CGC_07_thumb.jpg",130,130,5);thumbnails[3754288]=new thumbnail(3754288,"229103","Site Masterplan","east_india_5_thumb.jpg",130,130,5);thumbnails[3778035]=new thumbnail(3778035,"230412","Restaurant","CGC_01_thumb.jpg",130,130,5);thumbnails[3754290]=new thumbnail(3754290,"229103","Typical Floor Plan","east_india_6_thumb.jpg",130,130,5);thumbnails[3778037]=new thumbnail(3778037,"230412","Restaurant Servery and Display","CGC_03_thumb.jpg",130,130,5);thumbnails[3778040]=new thumbnail(3778040,"230412","Restaurant Dining","CGC_04_thumb.jpg",130,130,5);thumbnails[3044277]=new thumbnail(3044277,"187289","","eldon_thumb.jpg",130,130,5);thumbnails[3753891]=new thumbnail(3753891,"229094","Dining Area","airdrie_1_thumb.jpg",130,130,5);thumbnails[3754358]=new thumbnail(3754358,"229119","Masterplan","gourock_bay_1_thumb.jpg",130,130,5);thumbnails[3885663]=new thumbnail(3885663,"235992","","projman_1_thumb.jpg",130,130,5);thumbnails[4831506]=new thumbnail(4831506,"275974","Existing Rear Elevation","cowie_001_thumb.jpg",130,130,5);thumbnails[3044286]=new thumbnail(3044286,"187289","","eldon_2_thumb.jpg",130,130,5);thumbnails[3753892]=new thumbnail(3753892,"229094","Waiting Area","airdrie_2_thumb.jpg",130,130,5);thumbnails[3754383]=new thumbnail(3754383,"229119","Marina and Transport Interchange","gourock_bay_2_thumb.jpg",130,130,5);thumbnails[3767024]=new thumbnail(3767024,"229572","Victor A Canata","VC_thumb.jpg",130,130,5);thumbnails[3885664]=new thumbnail(3885664,"235992","","projman_2_thumb.jpg",130,130,5);thumbnails[4831524]=new thumbnail(4831524,"275974","Existing Kitchen","cowie_002_thumb.jpg",130,130,5);thumbnails[3753896]=new thumbnail(3753896,"229094","Bar and Buffet Area","airdrie_3_thumb.jpg",130,130,5);thumbnails[3754391]=new thumbnail(3754391,"229119","Transport Interchange Building","gourock_bay_3_thumb.jpg",130,130,5);thumbnails[3767015]=new thumbnail(3767015,"229572","John W Seggie","JS_thumb.jpg",130,130,5);thumbnails[3885668]=new thumbnail(3885668,"235992","","projman_3_thumb.jpg",130,130,5);thumbnails[4415937]=new thumbnail(4415937,"187289","","_DSC5039_thumb.jpg",130,130,5);thumbnails[4831552]=new thumbnail(4831552,"275974","Rear Elevation with Extension","cowie_003_thumb.jpg",130,130,5);thumbnails[3754411]=new thumbnail(3754411,"229119","Marina Elevation","gourock_bay_4_thumb.jpg",130,130,5);thumbnails[3767025]=new thumbnail(3767025,"229572","Douglas Nicholson","DN_thumb.jpg",130,130,5);thumbnails[3885669]=new thumbnail(3885669,"235992","","projman_4_thumb.jpg",130,130,5);thumbnails[4415938]=new thumbnail(4415938,"187289","","_DSC5318_thumb.jpg",130,130,5);thumbnails[4831556]=new thumbnail(4831556,"275974","New Dining Room","cowie_004_thumb.jpg",130,130,5);thumbnails[3754429]=new thumbnail(3754429,"229119","Marina Housing Elevation","gourock_bay_5_thumb.jpg",130,130,5);thumbnails[3767026]=new thumbnail(3767026,"229572","Marco G Rebecchi","MR_thumb.jpg",130,130,5);thumbnails[4831563]=new thumbnail(4831563,"275974","New Kitchen","cowie_005_thumb.jpg",130,130,5);thumbnails[4831566]=new thumbnail(4831566,"275974","New Master Bedroom","cowie_006_thumb.jpg",130,130,5);thumbnails[3884442]=new thumbnail(3884442,"230353","Investors In People","IIP_1_thumb.jpg",130,130,5);thumbnails[3763619]=new thumbnail(3763619,"229484","Plot 1 House Entrance","houston_road_1_thumb.jpg",130,130,5);thumbnails[3768139]=new thumbnail(3768139,"229838","Sketch Perspective","cowans_corner_thumb.jpg",130,130,5);thumbnails[3768206]=new thumbnail(3768206,"187290","","nursery_ave1_thumb.jpg",130,130,5);thumbnails[3883687]=new thumbnail(3883687,"229573","View from Union Street","office_2_thumb.jpg",130,130,5);thumbnails[4909232]=new thumbnail(4909232,"279659","Exterior view from garden.","semple_001_thumb.jpg",130,130,5);thumbnails[3044299]=new thumbnail(3044299,"187290","","nursery_ave_2_thumb.jpg",130,130,5);thumbnails[3763627]=new thumbnail(3763627,"229484","Plot 1 House Frontage","houston_road_2_thumb.jpg",130,130,5);thumbnails[3883689]=new thumbnail(3883689,"229573","Reception Area","office_3_thumb.jpg",130,130,5);thumbnails[4909269]=new thumbnail(4909269,"279659","Night-time view from exterior.","semple_002_thumb.jpg",130,130,5);thumbnails[3883698]=new thumbnail(3883698,"229573","Production Area","office_6_thumb.jpg",130,130,5);thumbnails[3883699]=new thumbnail(3883699,"229573","Workstations","office_7_thumb.jpg",130,130,5);thumbnails[3763968]=new thumbnail(3763968,"229484","Plot 2 House Frontage","houston_road_3_thumb.jpg",130,130,5);thumbnails[3883695]=new thumbnail(3883695,"229573","Board Room","office_4_thumb.jpg",130,130,5);thumbnails[4442081]=new thumbnail(4442081,"187290","","_4033367_thumb.jpg",130,130,5);thumbnails[4909277]=new thumbnail(4909277,"279659","Night-time view of kitchen and gallery.","semple_003_thumb.jpg",130,130,5);thumbnails[3763972]=new thumbnail(3763972,"229484","Plot 2 House Entrance","houston_road_4_thumb.jpg",130,130,5);thumbnails[3883697]=new thumbnail(3883697,"229573","Meeting Room","office_5_thumb.jpg",130,130,5);thumbnails[4442084]=new thumbnail(4442084,"187290","","_4033416_thumb.jpg",130,128,5);thumbnails[4909287]=new thumbnail(4909287,"279659","Interior view showing dining area.","semple_004_thumb.jpg",130,130,5);thumbnails[3763976]=new thumbnail(3763976,"229484","Site Layout","houston_road_5_thumb.jpg",130,130,5);thumbnails[4910297]=new thumbnail(4910297,"279659","Exterior view over balcony.","semple_005_thumb.jpg",130,130,5);thumbnails[3763978]=new thumbnail(3763978,"229484","Plot 1 House Under Construction","houston_road_6_thumb.jpg",130,130,5);thumbnails[3776798]=new thumbnail(3776798,"229573","Office Floor Plan","office_1_thumb.jpg",130,130,5);thumbnails[4910300]=new thumbnail(4910300,"279659","First floor interior view","semple_006_thumb.jpg",130,130,5);thumbnails[3763982]=new thumbnail(3763982,"229484","Plot 1 House Roof Structure","houston_road_7_thumb.jpg",130,130,5);thumbnails[4933595]=new thumbnail(4933595,"279659","External view at dusk.","semple_009_thumb.jpg",130,130,5);thumbnails[4910773]=new thumbnail(4910773,"279659","View into upper floor room from terrace.","semple_008_thumb.jpg",130,130,5);thumbnails[3884150]=new thumbnail(3884150,"235923","Workstation","IT_1_thumb.jpg",130,130,5);thumbnails[3884481]=new thumbnail(3884481,"230354","Quality Manual","Quality_Systems_thumb.jpg",130,130,5);thumbnails[3884153]=new thumbnail(3884153,"235923","A0 printer","IT_2_thumb.jpg",130,130,5);thumbnails[3884156]=new thumbnail(3884156,"235923","A3 colour printer and A0 scanner","IT_3_thumb.jpg",130,130,5);thumbnails[3768135]=new thumbnail(3768135,"229833","Early Design Sketch","murphy_1_thumb.jpg",130,130,5);thumbnails[3880329]=new thumbnail(3880329,"235729","View from south west","prospecthill_1_thumb.jpg",130,130,5);thumbnails[3880339]=new thumbnail(3880339,"235729","View from South East","prospecthill_2_thumb.jpg",130,130,5);thumbnails[3880362]=new thumbnail(3880362,"235729","Detail at pend","prospecthill_4_thumb.jpg",130,130,5);thumbnails[3880367]=new thumbnail(3880367,"235729","Corner Detail","prospecthill_5_thumb.jpg",130,130,5);thumbnails[4258322]=new thumbnail(4258322,"251942","Exterior View","levan_wood_1_thumb.jpg",130,130,5);thumbnails[5050395]=new thumbnail(5050395,"285803","3D visual of completed development","1854_01_thumb.jpg",130,130,5);thumbnails[3777906]=new thumbnail(3777906,"230401","Directions from Glasgow<br>\r\n","directions_glasgow_thumb.jpg",130,130,5);thumbnails[4258327]=new thumbnail(4258327,"251942","Interior View of Living Area","levan_wood_2_thumb.jpg",130,130,5);thumbnails[3777914]=new thumbnail(3777914,"230401","Directions from Largs","directions_largs_thumb.jpg",130,130,5);thumbnails[4258330]=new thumbnail(4258330,"251942","Interior View of Living Area","levan_wood_3_thumb.jpg",130,130,5);thumbnails[4258332]=new thumbnail(4258332,"251942","Interior View of Dining Area","levan_wood_4_thumb.jpg",130,130,5);thumbnails[4992528]=new thumbnail(4992528,"283439","","1617-008_thumb.jpg",130,130,5);thumbnails[4992530]=new thumbnail(4992530,"283439","","1617-004_thumb.jpg",130,130,5);thumbnails[4992535]=new thumbnail(4992535,"283439","","1617-006_thumb.jpg",130,130,5);thumbnails[4992536]=new thumbnail(4992536,"283439","","1617-007_thumb.jpg",130,130,5);var galleries=new Object();galleries[294518]=new gallery(294518,"5221663","Cafe Flava, Gourock","gallery",[5221663,5221685,5221567,5221587,5221592,5221597,5221655,5221661]);galleries[187385]=new gallery(187385,"3045878","Amber Restaurant, Glasgow","gallery",[3045878,3753928,3753930,3753931]);galleries[235991]=new gallery(235991,"3885592,3885591,3885589,3885587","Architecture & Interior Design","section231877",[3885587,3885589,3885591,3885592]);galleries[230412]=new gallery(230412,"3778030","Cardwell Garden Centre, Gourock","gallery",[3778030,3778032,3778033,3778034,3778038,3778035,3778037,3778040]);galleries[229074]=new gallery(229074,"3753819","Dental Teach and Treat","gallery",[3753819,3753827,3753839]);galleries[229071]=new gallery(229071,"3753790","Detached House, Gourock","gallery",[3753790]);galleries[229103]=new gallery(229103,"3753961","East India Harbour, Greenock","gallery",[3753961,3754125,3754130,3754133,3754288,3754290]);galleries[187288]=new gallery(187288,"3044266","Elderslie Flats","gallery",[3044266,3044272,4415989,4415990]);galleries[229068]=new gallery(229068,"3753775","House Extension, Inverkip","gallery",[3753767,3753772,3753775,3753776]);galleries[187284]=new gallery(187284,"4992528,4258322,3880329,3768206,3044277,3044266","Residential","gallery",[]);galleries[289570]=new gallery(289570,"5124026","St. Columba's, Kilmacolm","gallery",[5124026,5124029,5124030]);galleries[229085]=new gallery(229085,"","Detached House, Gourock","gallery",[]);galleries[229572]=new gallery(229572,"3767024","Directors","section231876",[3767024,3767015,3767025,3767026]);galleries[187289]=new gallery(187289,"3044277","Eldon Street Flats","gallery",[3044277,3044286,4415937,4415938]);galleries[229119]=new gallery(229119,"3754429,3754411,3754391,3754383,3754358","Gourock Bay","gallery",[3754358,3754383,3754391,3754411,3754429]);galleries[275974]=new gallery(275974,"4831552","House Extension and Alterations, Gourock","gallery",[4831506,4831524,4831552,4831556,4831563,4831566]);galleries[229094]=new gallery(229094,"3753896,3753892,3753891","Jade Palace Restaurant, Airdrie","gallery",[3753891,3753892,3753896]);galleries[235992]=new gallery(235992,"3885669,3885668,3885664,3885663","Project Management","section231877",[3885663,3885664,3885668,3885669]);galleries[187285]=new gallery(187285,"3753790","Single Dwellings","gallery",[]);galleries[187287]=new gallery(187287,"4909287,4831552,3753775","House Extensions","gallery",[]);galleries[230353]=new gallery(230353,"3884442","Vision","section231876",[3884442]);galleries[235993]=new gallery(235993,"","CDM Co-ordination","section231877",[]);galleries[229838]=new gallery(229838,"3768139","Cowan's Corner","gallery",[3768139]);galleries[187286]=new gallery(187286,"3753819","Health Care","gallery",[]);galleries[279659]=new gallery(279659,"4909287","House Extension Proposal, Gourock","gallery",[4909232,4909269,4909277,4909287,4910297,4910300,4933595,4910773]);galleries[187290]=new gallery(187290,"3768206","Kilmarnock Flats","gallery",[3768206,3044299,4442081,4442084]);galleries[229573]=new gallery(229573,"3883689","Premises","section231876",[3883687,3883689,3883698,3883699,3883695,3883697,3776798]);galleries[229484]=new gallery(229484,"3763982,3763978,3763976,3763972,3763968,3763627,3763619","Two Detached Houses, Kilmacolm","gallery",[3763619,3763627,3763968,3763972,3763976,3763978,3763982]);galleries[235923]=new gallery(235923,"3884150","Information Technology","section231876",[3884150,3884153,3884156]);galleries[230354]=new gallery(230354,"3884481","Quality Systems","section231876",[3884481]);galleries[229833]=new gallery(229833,"3768135","Detached House, Gourock","gallery",[3768135]);galleries[235729]=new gallery(235729,"3880329","Prospecthill Street Flats","gallery",[3880329,3880339,3880362,3880367]);galleries[187384]=new gallery(187384,"5221663,3045878","Bars and Restaurants","gallery",[]);galleries[229093]=new gallery(229093,"3778030","Commercial","gallery",[]);galleries[251942]=new gallery(251942,"4258322","Levan Wood Flats","gallery",[4258322,4258327,4258330,4258332]);galleries[230401]=new gallery(230401,"3777914,3777906","Location","section231876",[3777906,3777914]);galleries[285803]=new gallery(285803,"5050395","Two Detached Houses, Newton Mearns","gallery",[5050395]);galleries[283439]=new gallery(283439,"4992528","Inverkip Road Flats","gallery",[4992528,4992530,4992535,4992536]);galleries[262362]=new gallery(262362,"3754429,3754411,3754391,3754383,3754358","Masterplanning","gallery",[]);galleries[289553]=new gallery(289553,"5124026","Education","gallery",[]);galleries[229107]=new gallery(229107,"3753961","Competitions / Unbuilt","gallery",[]);var imageSets=new Object();imageSets[1]="5221685,5221663,5124026,5050395,4933595,4910300,4909287,4909277,4909269,3880329,3763978,3753961,3753819,3753790,3753775,3045878,3044286,3044277,3044266";imageSets[2]="5221663,5124026,4992528,4909287,4831552,4258322,3884442,3884150,3883689,3880329,3778030,3768206,3767024,3753961,3753819,3753790,3753775,3045878,3044277,3044266";imageSets[3]="5221685,5221663,5221661,5221655,5221597,5221592,5221587,5221567,5124030,5124029,5124026,5050395,4992536,4992535,4992530,4992528,4933595,4910773,4910300,4910297,4909287,4909277,4909269,4909232,4831566,4831563,4831556,4831552,4831524,4831506,4442084,4442081,4415990,4415989,4415938,4415937,4258332,4258330,4258327,4258322,3885669,3885668,3885664,3885663,3885592,3885591,3885589,3885587,3884481,3884442";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 34:b="http://www9.clikpic.com/canseg1/images";break}switch(a){case 1:b="http://www1.clikpic.com/canseg1/images";break}switch(a){case 2:b="http://admin.clikpic.com/canseg1/images";break}switch(a){case 4:b="http://www.clikchurch.com/canseg1/images";break}switch(a){case 5:b="http://www2.clikpic.com/canseg1/images";break}switch(a){case 15:b="http://www3.clikpic.com/canseg1/images";break}switch(a){case 21:b="http://www6.clikpic.com/canseg1/images";break}switch(a){case 18:b="http://www4.clikpic.com/canseg1/images";break}switch(a){case 19:b="http://www5.clikpic.com/canseg1/images";break}switch(a){case 22:b="http://tpc5/clikpic/canseg1/images";break}switch(a){case 23:b="http://tpc10/clikpic/canseg1/images";break}switch(a){case 24:b="http://tpc15/clikpic/canseg1/images";break}switch(a){case 25:b="http://tpc16/clikpic/canseg1/images";break}switch(a){case 31:b="http://www7.clikpic.com/canseg1/images";break}switch(a){case 32:b="http://admin2.clikpic.com/canseg1/images";break}switch(a){case 33:b="http://www8.clikpic.com/canseg1/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="'+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="Canata & Seggie Chartered Architects: "+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+'")'})}}};