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[1920279]=new thumbnail(1920279,"129245","","frankie- me changed close up_thumb.jpg",130,191,1);thumbnails[1920284]=new thumbnail(1920284,"128792","","brendon lyon_thumb.jpg",130,165,1);thumbnails[1920285]=new thumbnail(1920285,"128792","","wedding shoot_thumb.jpg",130,94,1);thumbnails[1920286]=new thumbnail(1920286,"128792","","wedding shoot_thumb.jpg 4.jpg",130,185,1);thumbnails[1920287]=new thumbnail(1920287,"129245","","christine - ciaran whyte_thumb.jpg",130,179,1);thumbnails[1920289]=new thumbnail(1920289,"128793","","jeannie - ciaran whyte 1_thumb.jpg",130,180,1);thumbnails[1926814]=new thumbnail(1926814,"128794","","lyod - ciaran whyte_thumb.jpg",130,180,1);thumbnails[1926820]=new thumbnail(1926820,"129245","","jeannie - ciaran whyte 8_thumb.jpg",130,178,1);thumbnails[1926846]=new thumbnail(1926846,"129245","","christine - ciaran whyte 4_thumb.jpg",130,179,1);thumbnails[1926848]=new thumbnail(1926848,"129245","","9125643a6622426360l_thumb.jpg",130,195,1);thumbnails[1926861]=new thumbnail(1926861,"129245","","nikki - ciaran whyte_thumb.jpg",130,178,1);thumbnails[1926871]=new thumbnail(1926871,"128792","","nikki_thumb.jpg",130,195,1);thumbnails[1926877]=new thumbnail(1926877,"128792","","SELINA- SCI 5_thumb.jpg",130,182,1);thumbnails[1926884]=new thumbnail(1926884,"128794","","SELINA -SCI 61_thumb.jpg",130,182,1);thumbnails[1926993]=new thumbnail(1926993,"128793","","morgan testing shoot- emily quinn_thumb.jpg",130,195,1);thumbnails[1927008]=new thumbnail(1927008,"128794","","frankie scoot_thumb.jpg",130,116,1);thumbnails[1927009]=new thumbnail(1927009,"128794","","susan- david frain_thumb.jpg",130,107,1);thumbnails[1927010]=new thumbnail(1927010,"128793","","claire_thumb.jpg",130,182,1);thumbnails[1927017]=new thumbnail(1927017,"128793","","SELINA- SCI 3_thumb.jpg",130,182,1);thumbnails[1927020]=new thumbnail(1927020,"128793","","frankie - sci 111_thumb.jpg",130,182,1);thumbnails[1927082]=new thumbnail(1927082,"128794","","4lnjenny31_thumb.jpg",130,130,1);thumbnails[1940026]=new thumbnail(1940026,"128793","","SELINA SCI 1_thumb.jpg",130,182,1);thumbnails[2288021]=new thumbnail(2288021,"128794","","DSC_0128_thumb.jpg",130,193,1);thumbnails[2288087]=new thumbnail(2288087,"150123","Short film, directed by Stephen Crilly <br>\r\nphotos courtesy of shane @ myspace.com/howtofaketea","IMG_2897_thumb.jpg",130,87,1);thumbnails[2288093]=new thumbnail(2288093,"150123","Short horror film.<br>\r\nDirected by Stephen Crilly.<br>\r\nphotos courtesy of shane @ myspace.com/howtofaketea","IMG_3066_thumb.jpg",130,195,1);thumbnails[2288132]=new thumbnail(2288132,"150123",'applying makeup to actress Rachael Kavannagh(Fair City) for the short film "talk of the town" Directed by Damien De Burca',"DSC00104_thumb.JPG",130,98,1);thumbnails[2398623]=new thumbnail(2398623,"155472","","kiss 3_thumb.jpg",130,130,1);thumbnails[2398838]=new thumbnail(2398838,"155472","","kiss 5_thumb.jpg",130,172,1);thumbnails[2398854]=new thumbnail(2398854,"155472","","kiss 8_thumb.jpg",130,130,1);thumbnails[2398921]=new thumbnail(2398921,"155472","","kiss 11_thumb.jpg",130,117,1);thumbnails[2398953]=new thumbnail(2398953,"155472","","kiss close up_thumb.jpg",130,138,1);thumbnails[2782518]=new thumbnail(2782518,"129245","","lgilligan200708_0036_small_thumb.jpg",130,166,1);thumbnails[2782582]=new thumbnail(2782582,"128792","real brides","fees wedding_thumb.jpg",130,86,1);thumbnails[3001223]=new thumbnail(3001223,"128793","","_SC10023web_final_thumb.jpg",130,182,1);thumbnails[3227665]=new thumbnail(3227665,"129245","","_MG_9131_thumb.jpg",130,195,1);thumbnails[3227669]=new thumbnail(3227669,"129245","","_MG_9272_thumb.jpg",130,195,1);thumbnails[3227741]=new thumbnail(3227741,"128794","","IMG_0742_thumb.jpg",130,195,1);thumbnails[3227750]=new thumbnail(3227750,"128794","","IMG_4955_2_thumb.jpg",130,104,1);thumbnails[3227753]=new thumbnail(3227753,"128794","","IMG_0638_thumb.jpg",130,195,1);thumbnails[3261459]=new thumbnail(3261459,"129245","","emily_thumb.jpg",130,193,1);thumbnails[3261646]=new thumbnail(3261646,"150123","","n646725912_1667690_2531_thumb.jpg",130,98,1);thumbnails[3261654]=new thumbnail(3261654,"150123",'Makeup for actor Jack Walsh for the Tv drama "The house"',"n646725912_1667565_9473_thumb.jpg",130,98,1);thumbnails[4092440]=new thumbnail(4092440,"129245","","_MG_62041_thumb.jpg",130,195,1);thumbnails[4092459]=new thumbnail(4092459,"128793","","20090419_LisaC-146_thumb.jpg",130,196,1);thumbnails[4092463]=new thumbnail(4092463,"128794","","20081111-20081111_Rosie-237-Edit_thumb.jpg",130,87,1);thumbnails[4092471]=new thumbnail(4092471,"128793","","20081118-Rosie4panel2_thumb.jpg",130,49,1);thumbnails[4092560]=new thumbnail(4092560,"128794","Dance shoot for Jane shorthall dance students","jason_healy_14_thumb.JPG",130,195,1);thumbnails[4092567]=new thumbnail(4092567,"128794","","jason_healy_15_thumb.JPG",130,196,1);thumbnails[5577755]=new thumbnail(5577755,"128792","","797402716_hQUYD-L_thumb.jpg",130,130,1);thumbnails[5577761]=new thumbnail(5577761,"128792","","797714075_HQA5y-XL_thumb.jpg",130,87,1);thumbnails[5577771]=new thumbnail(5577771,"128792","","797017437_ZMyaJ-L_thumb.jpg",130,87,1);thumbnails[5577787]=new thumbnail(5577787,"128792","","797402434_kc94T-L_thumb.jpg",130,195,1);thumbnails[5577804]=new thumbnail(5577804,"128792","","796356595_HHksT-XL1_thumb.jpg",130,195,1);thumbnails[5577860]=new thumbnail(5577860,"128792","","797402600_Qpveo-L_thumb.jpg",130,128,1);thumbnails[5630873]=new thumbnail(5630873,"150123","","Morgan_2319_thumb.jpg",130,87,1);thumbnails[5630878]=new thumbnail(5630878,"150123","me and all my makeup :)","Morgan_2123_thumb.jpg",130,196,1);thumbnails[5630890]=new thumbnail(5630890,"150123","","Morgan_2301_thumb.jpg",130,87,1);thumbnails[5631011]=new thumbnail(5631011,"129245","","morgan_2500_copy_2copy_thumb.jpg",130,99,1);thumbnails[5631025]=new thumbnail(5631025,"128794","","Fran_Byrne_Photography_0096_thumb.jpg",130,153,1);thumbnails[6428566]=new thumbnail(6428566,"128792","","ro_wedding_thumb.jpg",130,137,1);thumbnails[1920278]=new thumbnail(1920278,"128777","","frankie -sci 12_thumb.jpg",130,182,1);thumbnails[1920283]=new thumbnail(1920283,"128777","","NIKKI -SCI 2_thumb.jpg",130,182,1);thumbnails[1926817]=new thumbnail(1926817,"128777","","lyod 2_thumb.jpg",130,180,1);thumbnails[1926851]=new thumbnail(1926851,"128777","","jeannie - ciaran whyte 3_thumb.jpg",130,179,1);thumbnails[1926853]=new thumbnail(1926853,"128777","","nikki - SCI1_thumb.jpg",130,182,1);thumbnails[1927027]=new thumbnail(1927027,"128777","","claire- sci_thumb.jpg",130,182,1);thumbnails[2124537]=new thumbnail(2124537,"128777","","IMG_2927_thumb.jpg",130,195,1);thumbnails[2124651]=new thumbnail(2124651,"128777","","IMG_2593_thumb.jpg",130,195,1);thumbnails[2288060]=new thumbnail(2288060,"128777","","lorraine gilligan_thumb.jpg",130,93,1);thumbnails[2782526]=new thumbnail(2782526,"128777","","lgilligan200708_0112_small_thumb.jpg",130,130,1);thumbnails[2782533]=new thumbnail(2782533,"128777","","cwhyte_080720_0078_alt_small_thumb.jpg",130,83,1);thumbnails[4092357]=new thumbnail(4092357,"128777","","_MG_1356_thumb.jpg",130,195,1);thumbnails[4092360]=new thumbnail(4092360,"128777","","_MG_1148_thumb.jpg",130,195,1);thumbnails[4092452]=new thumbnail(4092452,"128777","","1_thumb.jpg",130,87,1);var galleries=new Object();galleries[129245]=new gallery(129245,"3227665,1920287","Beauty","gallery",[1920279,1920287,1926820,1926846,1926848,1926861,2782518,3227665,3227669,3261459,4092440,5631011]);galleries[150123]=new gallery(150123,"3261654","behind the scenes ","gallery",[2288087,2288093,2288132,3261646,3261654,5630873,5630878,5630890]);galleries[128792]=new gallery(128792,"5577761,1920286","Bridal","gallery",[1920284,1920285,1920286,1926871,1926877,2782582,5577755,5577761,5577771,5577787,5577804,5577860,6428566]);galleries[128794]=new gallery(128794,"4092560,1926814","commercial","gallery",[1926814,1926884,1927008,1927009,1927082,2288021,3227741,3227750,3227753,4092463,4092560,4092567,5631025]);galleries[155472]=new gallery(155472,"2398953,2398921,2398854,2398838,2398623","Debs make over's","gallery",[2398623,2398838,2398854,2398921,2398953]);galleries[128793]=new gallery(128793,"4092471,1920289","model portfolios","gallery",[1920289,1926993,1927010,1927017,1927020,1940026,3001223,4092459,4092471]);galleries[128777]=new gallery(128777,"4092360,1920278","Fashion","gallery",[1920278,1920283,1926817,1926851,1926853,1927027,2124537,2124651,2288060,2782526,2782533,4092357,4092360,4092452]);var imageSets=new Object();imageSets[1]="5577761,5577755,4092560,4092360,3227741,3227665,2782533,2782526,2782518,2124537,1927017,1920287,1920279";imageSets[2]="5577761,4092560,4092471,4092360,3261654,3227665,1926814,1920289,1920287,1920286,1920278";imageSets[3]="5577860,5577755";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/sugarcubemakeup/images";break}switch(a){case 1:b="http://www1.clikpic.com/sugarcubemakeup/images";break}switch(a){case 2:b="http://admin.clikpic.com/sugarcubemakeup/images";break}switch(a){case 24:b="http://tpc15/clikpic/sugarcubemakeup/images";break}switch(a){case 4:b="http://www.clikchurch.com/sugarcubemakeup/images";break}switch(a){case 5:b="http://www2.clikpic.com/sugarcubemakeup/images";break}switch(a){case 22:b="http://tpc5/clikpic/sugarcubemakeup/images";break}switch(a){case 23:b="http://tpc10/clikpic/sugarcubemakeup/images";break}switch(a){case 25:b="http://tpc16/clikpic/sugarcubemakeup/images";break}switch(a){case 15:b="http://www3.clikpic.com/sugarcubemakeup/images";break}switch(a){case 18:b="http://www4.clikpic.com/sugarcubemakeup/images";break}switch(a){case 19:b="http://www5.clikpic.com/sugarcubemakeup/images";break}switch(a){case 31:b="http://www7.clikpic.com/sugarcubemakeup/images";break}switch(a){case 32:b="http://admin2.clikpic.com/sugarcubemakeup/images";break}switch(a){case 33:b="http://www8.clikpic.com/sugarcubemakeup/images";break}switch(a){case 34:b="http://www9.clikpic.com/sugarcubemakeup/images";break}switch(a){case 35:b="http://admin3.clikpic.com/sugarcubemakeup/images";break}switch(a){case 37:b="http://admin4.clikpic.com/sugarcubemakeup/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="Sugarcube Makeup: "+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+'")'})}}};