 function url(d){var T="";if(d.aw!=null){T+="res/theme/templ"+"ates";if(d.view!=null){return T+"/"+d.aw+"/"+d.view+".html"}else{return T+"/"+d.aw+".js"}}if(d.Q=='gallery'){T+="";if(d.item=='index'){return T+d.item+".html";}else{return T+d.item;}}if(d.Q=='data'){T+="res/data";if(d.item=='index'){return}else{return T+"/"+d.item+".js";}}if(d.Q=='css'){T+="res/theme";return T+"/"+d.item+".css";}if(d.Q=='images'){T+="theme/images";return T+"/"+d.item;}return T+d;};function fS(){var url=location.protocol+"//"+location.host+location.pathname;var cg=url.split('/');cg[cg.length-1]='';return cg.join("/");};var Url={encode:function(string){return escape(this.dE(string));},decode:function(string){return this.dD(unescape(string));},dE:function(string){string=string.replace(/\r\n/g,"\n");var U="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){U+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){U+=String.fromCharCode((c>>6)|192);U+=String.fromCharCode((c&63)|128);}else{U+=String.fromCharCode((c>>12)|224);U+=String.fromCharCode(((c>>6)&63)|128);U+=String.fromCharCode((c&63)|128);}}return U;},dD:function(U){var string="";var i=0;var c=fH=bl=0;while(i<U.length){c=U.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){bl=U.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(bl&63));i+=2;}else{bl=U.charCodeAt(i+1);dO=U.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((bl&63)<<6)|(dO&63));i+=3;}}return string;}} 
function gg(width,height){if(width>=height)return true;return false;};function eJ(dw,aw){$H(dw).each(function(el){new Ajax.Request(url({aw:aw,view:el.key}),{method:'get',asynchronous:false,onSuccess:function(transport){dw[el.key]=new Template(transport.responseText);}.bindAsEventListener(this)});});};Ajax.getTransport=function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return new XMLHttpRequest()})||false;};Ajax.bI=Class.create();Object.extend(Object.extend(Ajax.bI.prototype,Ajax.Request.prototype),{cd:"",finalResponse:"",initialize:function(av,url,templateParameters,options,onCompleteParams){this.cd=$H(templateParameters);if(options==null){options={};}options.method='get';options.asynchronous=false;this.av={success:(av.success||av),failure:(av.failure||(av.success?null:av))};this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,param,onCompleteParams){this.fz();onComplete(transport,param,onCompleteParams);}).bind(this);this.request(url);},fz:function(){var receiver=this.av[this.success()?'success':'failure'];var response=this.transport.responseText;if(!this.options.evalScripts)response=response.stripScripts();var eG=this.cd.keys();var eF=this.cd.values();eG.each(function(eN,it){response=response.gsub(new RegExp('#{'+eN+'}'),eF[it]);});this.finalResponse=response;if(receiver=$(receiver)){if(this.options.insertion)new this.options.insertion(receiver,response);else receiver.update(response);}if(this.success()){if(this.onComplete)setTimeout(this.onComplete.bind(this),10);}}});function gh(fE){x=fE.getYear();var y=x%100;y+=(y<38)?2000:1900;return y;};function fL(Q,fC){var cookie=JSONstring.make(fC);var fF=new Date();var expires=30*1000*60*60*24;var dX=new Date(fF.getTime()+(expires));xSetCookie(Q,cookie,dX,location.pathname);return cookie;};function fN(Q){var a=xGetCookie(Q);if(a==null)return $H({});return(JSONstring.toObject(a));};function gj(aa){alert(JSONstring.make(aa));};function g(fG,fA){I=fG.toString().replace(/\$|\,/g,'');if(isNaN(I))I="0";ds=(I==(I=Math.abs(I)));I=Math.floor(I*100+0.50000000001);aU=I%100;I=Math.floor(I/100).toString();if(aU<10)aU="0"+aU;for(var i=0;i<Math.floor((I.length-(1+i))/3);i++)I=I.substring(0,I.length-(4*i+3))+','+I.substring(I.length-(4*i+3));if(!fA){return(((ds)?'':'-')+fU(I+'.'+aU));}else{return(((ds)?'':'-')+I+'.'+aU);}};function fU(aM){switch(H.get("Prices","currency")){case "GBP":return "&pound;"+aM;break;case "USD":return "$"+aM;break;case "CAD":return "$"+aM;break;case "EUR":return aM+"&euro;";break;case "JPY":return "&yen;"+aM;break;case "CHF":return "CHF"+aM;break;}};function gi(aa){if((typeof(aa)=='undefined'))return false;if((typeof(aa.length)=='undefined')){return false;}else{return true;}};function fK(aa){if(typeof(aa)=='undefined'){return true;}else if(typeof aa.constructor!='function'){return true}else{return false;}};function fO(aa){if((typeof(aa)=='undefined'))return[];if((typeof(aa.length)=='undefined')){return[aa];}else{return aa;}};function fI(dH){if(aI)return;document.getElementsByClassName('visibleOnlyOnMontage',dH).each(function(el){el.hide();});} 
 function gf(event){return(((event.which)&&(event.which==3))||((event.button)&&(event.button==2)));};function fR(eU,ci,ck,cj){var ak;if((ck/eU)>(cj/ci)){ak=ci/ck;}else{ak=ci/cj;}return{width:ck*ak,height:cj*ak};};if(jQuery.browser.msie){var e=document.createElement('link');e.rel='stylesheet';e.type='text/css';if(navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)=="MSIE 7.0,7.0"||navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)=="MSIE 8.0,8.0"){e.href='res/theme/screen_ie7.css';}else{e.href='res/theme/screen_ie6.css';}document.getElementsByTagName('head')[0].appendChild(e);}function fY(browser,version){if(browser=='msie'){if(!jQuery.browser.msie)return false;var cN=navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)=="MSIE 7.0,7.0";if(version=='7.0'){return cN;}else{return!cN;}}} 
 var cy=Class.create();cy.prototype={cw:[],initialize:function(d){cw=$H(d).properties.category;},get:function(bf,property){var value='';$A(cw).each(function(el){if(el.name==bf){value=this.ec(el.property,property);return value;}}.bindAsEventListener(this));return value;},ec:function(bf,property){var ad='';if(bf.name==property)return bf.value;$A(bf).each(function(el){if(el.name==property){ad=el.value;return ad;}});return ad;}}; 
 var cZ=Class.create();cZ.prototype={montages:[],bw:{},aD:{},aE:{},initialize:function(d){this.montages=$H(d).Montages.montages.montage;this.bw=$H(d).MontagePrices.montages;var dI=JSONstring.toObject(H.get('Montage','backLabels'));var dJ=JSONstring.toObject(H.get('Montage','backValues'));var i=0;$A(dI).each(function(el){this.aD[el]=dJ[i];i++;}.bindAsEventListener(this));var dM=JSONstring.toObject(H.get('Montage','borderLabels'));var dN=JSONstring.toObject(H.get('Montage','borderValues'));i=0;$A(dM).each(function(el){this.aE[el]=dN[i];i++;}.bindAsEventListener(this));},get:function(templateId){var value='';$A(this.montages).each(function(el){if(el.name==templateId){value=el;return value;}}.bindAsEventListener(this));return value;},bx:function(l){return this.montages[l];},count:function(){return $A(this.montages).size();},bW:function(templateNo){return this.montages[templateNo].name;},bq:function(templateNo){return this.montages[templateNo].picture.length;},ef:function(){var M=fO(this.bw.montage);return M;},bt:function(templateNo){var M=this.ef()[templateNo];var row=fO(M.row);return row;},eg:function(templateNo,eY){var row=this.bt(templateNo)[eY];return fO(row.col);},getTemplateNo:function(templateId){var value='';var i=0;$A(this.montages).each(function(el){if(el.name==templateId){value=el;return i;}i++;}.bindAsEventListener(this));return-1;},eh:function(label){return "#"+this.aD[label];},ea:function(label){if(fK(this.aE[label]))return 'transparent';return "#"+this.aE[label];},getTemplateBorderSize:function(templateNo){return this.montages[templateNo].border;}}; 
 var Y=Class.create();Y.prototype={aL:'',aq:'',initialize:function(eQ,eK){var ae=[];ae=eQ.split('/');if(ae.length>2){this.aL=ae[0]+"/";}switch(eK){case 'thumb':break;case 'picture':this.aq=ae[ae.length-1];break;case 'id':if(ae.length>1){this.aL=ae[0]+"/";this.aq=ae[1];}else{this.aq=ae[0];}break;default:this.aq=ae[ae.length-1];}},ej:function(){return this.aL+"slides/"+this.aq.replace(/.jpg/i,'')+'.html';},bv:function(){return this.aL+"thumbs/"+this.aq;},bs:function(){return this.aL+"slides/"+this.aq;},al:function(){return this.aL+""+this.aq;},bX:function(maxWidth,maxHeight){var bc={};var MaxWidth;var MaxHeight;var FinalWidth;var FinalHeight;var ak;var img=new Image();img.src=this.bv();if(img.width/maxWidth>img.height/maxHeight){ak=maxWidth/img.width}else{ak=maxHeight/img.height}bc.width=img.width*ak;bc.height=img.height*ak;if(bc.width=="NaN"||bc.width=="NaN")return this.bX(maxWidth,maxHeight);return bc;}}; 
 var cC=Class.create();cC.prototype={visible:false,templates:{yesno:'',error:'',yes:'',loading:'',secretInput:''},initialize:function(d){eJ(this.templates,'DialogFactory');},hide:function(){if(this.visible)jQuery.unblockUI();},show:function(d){if(typeof(d.yesText)=='undefined'){d.yesText='Yes';}if(typeof(d.noText)=='undefined'){d.noText='No';}var B=this.templates[d.type].evaluate(d);this.hide();this.visible=true;jQuery.blockUI(B);jQuery('#dialogYes').click(function(){if(d.as!=null){d.as()};if(d.ew!=true){this.visible=false;jQuery.unblockUI();}});jQuery('#dialogNo').click(function(){if(d.ar!=null){d.ar();}if(d.keepNoBlocked!=true){this.visible=false;jQuery.unblockUI();}});if(typeof(d.cS)!='undefined'){$A(d.cS).each(function(el){jQuery('#'+el).keypress(function(event){if(event.keyCode==13){jQuery('#dialogYes').click();}if(event.keyCode==27){jQuery('#dialogNo').click();}});});}},showCustom:function(d){jQuery.blockUI($(d.block));jQuery('#dialogYes').click(function(){d.as();this.visible=false;jQuery.unblockUI();});jQuery('#dialogNo').click(function(){d.ar();this.visible=false;jQuery.unblockUI();});},dq:function(value){jQuery.blockUI.defaults.overlayCSS.opacity=value;},fd:function(){this.dq('0.5');}}; 
 var ct=Class.create();ct.prototype={ax:'',templates:{printLine:'',addToBasket:'',navigationExtended:'',navigationVisible:'',discountsTable:'',discountItem:'',priceTable:'',instructions:''},isOpen:false,aX:'',V: -1,au:{},bw:{},initialize:function(d){this.au=moData.PrintPrices.PrintPrices;this.bw=moData.MontagePrices.montages;eJ(this.templates,'Bar');$('Bar_extendedArea_navigation').innerHTML=this.templates.navigationExtended.evaluate();this.eu();$('Bar_visibleArea_navigation').innerHTML=this.templates.navigationVisible.evaluate();$('Bar_visibleArea_instructionsArea').innerHTML=this.templates.instructions.evaluate();this.fJ();fI('Bar_visibleArea');},eu:function(){$('Bar_visibleArea_pricesArea').innerHTML=this.templates.addToBasket.evaluate();var az='';var i=0;if($A(this.au.row).length==0){this.au.row=[this.au.row];}$A(this.au.row).each(function(item){az+=this.templates.printLine.evaluate({label:item.name,price:g(this.aQ(i,1)),rownum:i,discountTooltip:this.cG(i),MontageNo:'prints'});i++;}.bindAsEventListener(this));new Insertion.Top('Bar_visibleArea_priceTableArea',this.templates.priceTable.evaluate({PriceLines:az,TableId:'prints'}));$('Bar_visibleArea_priceTable_prints').show();var bZ='.hovertip_prints';jQuery(bZ).hovertipActivate(cK,targetSelectByTargetAttribute,hovertipPrepare,hovertipTargetPrepare);},dy:function(fB){var bn=this.cH(fB);if(bn!=null){if(bn.quantity==0){ai.bD(bn);}else{ai.bL(bn);}}},fJ:function(d){Event.observe('Bar_extendedArea_close','click',function(ev){if(!r)return;this.hide();aW.cp();if(aI)new Effect.Appear('Bar_visibleArea_btnMontage',{queue:'end'});}.bindAsEventListener(this));this.cL('prints');Event.observe('Bar_visibleArea_btnNextStep','click',fT);Event.observe('Bar_visibleArea_btnPreviousStep','click',fZ);Event.observe('Bar_visibleArea_gallery','click',fM);Event.observe('Bar_visibleArea_clearButton','click',function(ev){Event.stop(ev);X.show({type:'yesno',caption:'Quantities will be set to 0.',text:"Are you sure?",as:function(){if(this.aX=='print'){this.bg({pictureId:this.ax.al(),value:0});}else{this.bg({l:this.V,value:0});}this.cn();}.bindAsEventListener(this),ar:function(){}});}.bindAsEventListener(this));Event.observe('Bar_visibleArea_btnMontage','click',function(ev){Event.stop(ev);if(!r)return;fM(1);this.hide();this.dr();}.bindAsEventListener(this));},cL:function(l){document.getElementsByClassName('spin-button','Bar_visibleArea_priceTable_'+l).each(function(el){jQuery(el).SpinButton({min:'0'});Event.observe(el,'click',function(ev){Event.stop(ev);this.dy(Event.element(ev).name);this.cn();}.bindAsEventListener(this));Event.observe(el,'change',function(ev){Event.stop(ev);this.dy(Event.element(ev).name);this.cn();}.bindAsEventListener(this));}.bindAsEventListener(this));},cn:function(){var queue=Effect.Queues.get('barMsgScope');queue.each(function(e){e.cancel()});new Element.hide($('Bar_visibleArea_discountMsg'));new Element.show($('Bar_visibleArea_basketUpdatedMsg'));new Effect.Appear($('Bar_visibleArea_basketUpdatedMsg'),{queue:{position:'end',scope:'barMsgScope',limit:2}});new Effect.Event({afterFinish:function(){new Element.show($('Bar_visibleArea_discountMsg'));new Element.hide($('Bar_visibleArea_basketUpdatedMsg'));},queue:{position:'end',scope:'barMsgScope'}});},cs:function(){if(!this.isOpen){jQuery('#ScreenBar').removeClass('Bar_closed').addClass('Bar_open');jQuery('#GalleryArea').removeClass('Gallery_closed').addClass('Gallery_open');}Element.hide('Bar_visibleArea_instructionsArea');Element.show('Bar_visibleArea_pricesArea');this.isOpen=true;},cr:function(){Element.show('Bar_extendedArea');},show:function(pictureId){this.cs();this.aX='print';this.fr();this.ax=new Y(pictureId,'id');new Ajax.bI('Bar_pictureArea',url({Q:'gallery',item:this.ax.ej()}));this.bg({pictureId:pictureId});this.cr();},dr:function(l){this.hide();this.cs();this.aX='montage';L.show({G:l});this.cr();},dC:function(){if(this.isOpen){jQuery('#ScreenBar').removeClass('Bar_open').addClass('Bar_closed');jQuery('#GalleryArea').removeClass('Gallery_open').addClass('Gallery_closed');}},dB:function(){Element.hide('Bar_extendedArea');Element.hide('Bar_visibleArea_pricesArea');Element.show('Bar_visibleArea_instructionsArea');this.isOpen=false;this.aX='';},hide:function(){this.dC();$('Bar_pictureArea').innerHTML='';$('Bar_montageArea').hide();if(this.aX=='montage'){L.hide();}this.dB();},bg:function(options){if(options==null)return;if(options.pictureId!=null){var bh='prints';var ay=this.ax.al();var type='print';}else if(options.l!=null){var bh=options.l;var ay=options.l;var type='montage';}document.getElementsByClassName('Bar_visibleArea_qty','Bar_visibleArea_priceTable_'+bh).each(function(el){var bM=ai.aF(ay,el.name);var aN=ai.getItem(bM,type);if(aN!=null){if(options.value==null){this.aH(el.name,aN.quantity,options.l);}else if(options.value==0){ai.bD(this.cH(el.name));this.aH(el.name,0,options.l);}else{this.aH(el.name,options.value,options.l);}}else{ah.aH(el.name,0,options.l);}}.bindAsEventListener(this));},aH:function(productId,qty,l){if(l==null||l=='print'){var bh='prints'}else{var bh=l;}$('Bar_visibleArea_qty_'+bh+'_'+productId).value=qty;return;},cH:function(productId){if(this.V== -1){var ad={picture:this.ax.bs(),pictureId:this.ax.al(),productName:this.cJ(productId),productId:productId,quantity:this.bu(productId),pricePerUnit:this.aQ(productId,this.bu(productId))};}else{var ad={l:this.V,productName:this.cJ(productId),productId:productId,quantity:this.bu(productId),pricePerUnit:this.aQ(productId,this.bu(productId),L.cF())};}return ad;},bu:function(productId){if(this.V== -1)return $F('Bar_visibleArea_qty_prints_'+productId);return $F('Bar_visibleArea_qty_'+this.V+'_'+productId);},cJ:function(productId){if(this.V== -1)return this.au.row[productId].name;return C.bt(L.cF())[productId].name;},aQ:function(productId,units,templateNo){var cT=0;if(units<1)return-1;if(templateNo==null||templateNo== -1||fK(templateNo)){var k=this.au.row[productId].col;}else{var k=C.eg(templateNo,productId);}if((typeof(k.length)=='undefined')){return k.content;}for(i=0;i<k.length;i++){if(units<parseInt(k[i].name)){break;}if(!(typeof(k[i].content)=='undefined')&& !(k[i].content=='0.0')){cT=i;}}return k[cT].content;},cG:function(productId,templateNo){var bR='';if(templateNo==null||fK(templateNo)){var bb=fO(this.au.row);}else{var bb=C.bt(templateNo);}if($A(bb[productId].col).length==0){bR+=this.templates.discountItem.evaluate({name:bb[productId].col.name,price:g(bb[productId].col.content)});}else{$A(bb[productId].col).each(function(item){if(item.content!=null&&item.content!='0.0'&&item.content!='0'){bR+=this.templates.discountItem.evaluate({name:item.name,price:g(item.content)});}}.bindAsEventListener(this));}return this.templates.discountsTable.evaluate({rows:bR});},dF:function(l,templateNo){var az='';var i=0;if($('Bar_visibleArea_priceTable_'+l)!=null)Element.remove('Bar_visibleArea_priceTable_'+l);$A(C.bt(templateNo)).each(function(item){az+=this.templates.printLine.evaluate({label:item.name,price:g(this.aQ(i,1,templateNo)),rownum:i,discountTooltip:this.cG(i,templateNo),MontageNo:l});i++;}.bindAsEventListener(this));var B=this.templates.priceTable.evaluate({PriceLines:az,TableId:l});new Insertion.Top('Bar_visibleArea_priceTableArea',B);this.cL(l);document.getElementsByClassName('hovertip_inuse_'+l).each(function(el){el.remove();});var bZ='.hovertip_'+l;jQuery(bZ).hovertipActivate(cK,targetSelectByTargetAttribute,hovertipPrepare,hovertipTargetPrepare);document.getElementsByClassName('hovertip_'+l).each(function(el){el.addClassName('hovertip_inuse_'+l);});},fn:function(l){if(this.V== -1){Element.hide('Bar_visibleArea_priceTable_prints');}else{Element.hide('Bar_visibleArea_priceTable_'+this.V);}Element.show('Bar_visibleArea_priceTable_'+l);this.V=l;},fr:function(){if(this.V== -1)return;Element.hide('Bar_visibleArea_priceTable_'+this.V);Element.show('Bar_visibleArea_priceTable_prints');this.V= -1;}}; 
var cu=Class.create();cu.prototype={items:{prints:{},montages:{}},A:{},R:{},D:'',templates:{printSection:'',printPicture:'',printProduct:'',printOrderInfo:'',orderOption:'',orderOptionItem:'',printMontage:'',printDiscountInfo:''},bz:0,initialize:function(d){eJ(this.templates,'Basket');this.ez();this.eA();this.D=d.D;this.et();this.er();},et:function(){var df=JSONstring.toObject(H.get('OrderOptions','listOptions'));var dh=JSONstring.toObject(H.get('OrderOptions','listOptionItems'));this.bz=$A(df).size();var dg='';var i=0;for(i=0;i<this.bz;i++){var de='';for(j=0;j<$A(dh[i]).size();j++){de+=this.templates.orderOptionItem.evaluate({orderOptionItemId:dh[i][j],selectedText:(j==0)?'selected':''});}dg+=this.templates.orderOption.evaluate({orderOptionId:'orderOption_'+i,label:df[i],orderOptionItems:de});}$('Basket_orderOptions').innerHTML=dg;var i=0;for(i=0;i<this.bz;i++){new Autocompleter.SelectBox('orderOption_'+i);}},bL:function(item){if(item.pictureId!=null){var key=this.aF(item.pictureId,item.productId);this.items.prints[key]=item;}else{var key=this.aF(item.l,item.productId);this.items.montages[key]=item;}this.bE();},bD:function(item){var cQ=(item.pictureId!=null);if(cQ){var key=this.aF(item.pictureId,item.productId);var items=$H(this.items.prints);}else{var key=this.aF(item.l,item.productId);var items=$H(this.items.montages);}items.remove(key);if(cQ){this.items.prints=items;}else{this.items.montages=items;}this.bE();},clear:function(item){this.items={prints:{},montages:{}};this.A={};this.A.items=this.items;this.bE();},getItem:function(key,type){if(type==null||type=='print')return this.items.prints[key];if(type=='montage')return this.items.montages[key];},eH:function(bB){this.bE();$('Basket_submitFormBasket').value=JSONstring.make(this.A);$('Basket_submitFormAppConfig').value=JSONstring.make(moConfigData);$('Basket_submitFormMontages').value=JSONstring.make(L.dZ());$('Basket_submitFormInstanceInfo').value=JSONstring.make(an);if($H(this.items.prints).size()+$H(this.items.montages).size()==0){X.show({error:true,type:'error',caption:'Payment...',text:'Your Basket is empty.'});return;}$('Basket_submitFormData').value=this.fj(bB);var ad=this.dS();if(!ad.error){X.show({type:'yesno',yesText:'Continue',noText:'Back',caption:'Start payment process...',text:'You are going to be redirected to the payment screen. Please follow the instructions.',as:function(){this.gP()}.bindAsEventListener(this),ar:function(){},ew:true});}else{X.show(ad);}},gP:function(){if(location.protocol=="file:"){X.hide();X.show({type:'yes',caption:'Local Gallery',text:'Payments are not possible with local galleries. The gallery needs to be uploaded to a server.',yesText:'Ok'});}else{X.hide();X.show({type:'loading',caption:'Processing...',text:'Your order is being processed. It will take some seconds.'});cv=false;$('Basket_submitFormUrl').value=$('Basket_submitForm').action;$('Basket_submitForm').action="res/php/process.php";setTimeout($('Basket_submitForm').submit(),500);}},er:function(){document.getElementsByClassName('PaymentButton','ScreenBasket').each(function(el){Event.observe(el,'click',function(ev){Event.stop(ev);this.eH(el.id.replace('Basket_submitButton_',''));}.bindAsEventListener(this));}.bindAsEventListener(this));if(H.get('ECommerce','paypalEnabled')!='true'){$('Basket_submitButton_Paypal_area').hide();}if(H.get('ECommerce','nochexEnabled')!='true'){$('Basket_submitButton_Nochex_area').hide();}if(H.get('ECommerce','secpayEnabled')!='true'){$('Basket_submitButton_Secpay_area').hide();}if(H.get('ECommerce','checksEnabled')!='true'){$('Basket_submitButton_Check_area').hide();}if(H.get('ECommerce','googleEnabled')!='true'){$('Basket_submitButton_Google_area').hide();}},dS:function(){var ad={error:true,type:'error',caption:'Payment...',text:'Please fill all required information to continue with your order.'};if(this.R.name==''||this.R.addressLine1==''||this.R.zip==''||this.R.country==''||this.R.phone==''||this.R.email=='')return ad;return{error:false};},fj:function(bB){document.getElementsByClassName('Basket_input',this.D).each(function(el){this.R[el.name]=$F(el);}.bindAsEventListener(this));for(i=0;i<this.bz;i++){this.R['orderOption_'+i]=$F('orderOption_'+i+'_combo');}if(bB!=''){this.R['PaymentMethodId']=bB;}return fL('FormData',this.R);},eA:function(){this.R=fN('FormData');if($H(this.R).keys().size()==0)return;document.getElementsByClassName('Basket_input',this.D).each(function(el){el.value=this.R[el.name];}.bindAsEventListener(this));},dk:function(eW,eT){var s;var B='';var nettTotal=0;$A(eW).each(function(el){if(!fK(el)){if(!fK(el.pricePerUnit)){s={key:eT,description:el.productName,price:g(el.pricePerUnit),qty:el.quantity,cost:g(el.pricePerUnit*el.quantity)};B+=this.templates.printProduct.evaluate(s);nettTotal+=el.pricePerUnit*el.quantity;}}}.bindAsEventListener(this));return{html:B,nettTotal:nettTotal};},cb:function(){if($H(this.items.prints).values().size()==0&&$H(this.items.montages).values().size()==0){this.ff();return;}L.cM();var ao={};ao.prints=this.co(this.items.prints);ao.montages=this.co(this.items.montages);var nettTotal=0;var di='';var dj='';var da='';var cX='';$H(ao.prints).each(function(el){var aA=this.dk(el.value,el.key);nettTotal+=aA.nettTotal;var F=new Y(el.key,'id');di+=this.templates.printPicture.evaluate({src:F.bv(),pictureId:F.al(),productInfo:aA.html});dj+=this.templates.printPicture.evaluate({src:fS()+F.bv(),pictureId:F.al(),productInfo:aA.html});}.bindAsEventListener(this));$H(ao.montages).each(function(el){var aA=this.dk(el.value,el.key);nettTotal+=aA.nettTotal;var cf=new cV({maxWidth:'140',maxHeight:'140',templateNo:L.bU(el.key),backgroundColor:L.cI(el.key)});cf.dV(true);cf.fk(L.ei(el.key));da+=this.templates.printMontage.evaluate({MontagePreview:cf.bY(),MontageNo:parseInt(el.key)+1,TemplateId:C.bW(L.bU(el.key)),ProductInfo:aA.html});cX+=this.templates.printMontage.evaluate({MontagePreview:'',MontageNo:parseInt(el.key)+1,TemplateId:C.bW(L.bU(el.key)),ProductInfo:aA.html});}.bindAsEventListener(this));this.A.nettTotal=nettTotal;this.A.shippingCost=H.get('Prices','shippingCost');this.A.taxAmount=this.A.nettTotal*Number(H.get("Prices","taxPct"))/100;var ca;if(H.get("Prices","taxApplied")=='true')ca='(inc. Tax)';if(Number(H.get('Prices','discountMinAmount'))<=Number(nettTotal)){this.A.discountTotal=H.get('Prices','discountQty');}else{this.A.discountTotal=0;}var total=Number(nettTotal)+Number(this.A.shippingCost)+Number(this.A.taxAmount)-Number(this.A.discountTotal);if(Number(this.A.discountTotal)>0){var o=this.templates.printDiscountInfo.evaluate({discountTotal:"-"+g(this.A.discountTotal)});}var fu=this.templates.printOrderInfo.evaluate({orderId:an.orderId,CommentMontages:'',printsInfo:$H(ao.prints).size()?di:'Empty',montagesInfo:$H(ao.montages).size()?da:'Empty',nettTotal:g(nettTotal),taxAmount:g(this.A.taxAmount),taxPct:H.get("Prices","taxPct"),shippingCost:g(this.A.shippingCost),taxInclText:ca,total:g(total),discountDescription:o});var fp=this.templates.printOrderInfo.evaluate({orderId:an.orderId,CommentMontages:$H(ao.montages).size()?'(Previews Not Available)':'',printsInfo:$H(ao.prints).size()?dj:'Empty',montagesInfo:$H(ao.montages).size()?cX:'Empty',nettTotal:g(nettTotal),taxAmount:g(this.A.taxAmount),taxPct:H.get("Prices","taxPct"),shippingCost:g(this.A.shippingCost),taxInclText:ca,total:g(total),discountDescription:o});this.A.total=total;var B=this.templates.printSection.evaluate({orderInfo:fu});$('Basket_itemListArea').innerHTML=B;this.fm();this.A.tableHTML=fp.replace("\\r\\n","");document.getElementsByClassName('Basket_pictureLink','Basket_itemListArea').each(function(el){Event.observe(el,'click',function(ev){Event.stop(ev);fQ(el.id.replace('Basket_editItem_',''));}.bindAsEventListener(this));}.bindAsEventListener(this));document.getElementsByClassName('Basket_montageLink','Basket_itemListArea').each(function(el){Event.observe(el,'click',function(ev){Event.stop(ev);fQ(el.id.replace('Basket_editItem_',''),'montage');}.bindAsEventListener(this));}.bindAsEventListener(this));document.getElementsByClassName('Basket_removeItemButton','Basket_itemListArea').each(function(el){Event.observe(el,'click',function(ev){var key=el.id.replace('Basket_removeItem_','');this.bD(key);this.cb();Event.stop(ev);}.bindAsEventListener(this));}.bindAsEventListener(this));Event.observe('Basket_clearButton','click',function(ev){Event.stop(ev);X.show({type:'yesno',caption:'Clear Basket',text:"Are you sure?",as:function(){this.clear();this.cb();}.bindAsEventListener(this),ar:function(){}});}.bindAsEventListener(this));fI(this.D);},aF:function(ay,productId){return escape(JSONstring.make([ay,productId]));},ek:function(key){return JSONstring.toObject(unescape(key));},bE:function(){this.A.items.prints=this.items.prints;this.A.items.montages=this.items.montages;fL('Basket',this.A);},ez:function(){this.A=fN('Basket');if(this.A.items==null)this.A.items={prints:{},montages:{}};this.items=this.A.items;},co:function(dK){var b=$H(dK);var bF={};var key=[];b.each(function(el){key=this.ek(el.key);if(bF[key[0]]==null)bF[key[0]]=[];bF[key[0]][key[1]]=el.value;}.bindAsEventListener(this));return bF;},ff:function(){var B=this.templates.printSection.evaluate({orderId:an.orderId,printsInfo:''});$('Basket_itemListArea').innerHTML=B;Element.hide('Basket_Buttons');Element.show('Basket_emptyMsg');return;},fm:function(){Element.show('Basket_Buttons');Element.hide('Basket_emptyMsg');return;},es:function(l){var fw=this.co(this.items.montages);return(fw[l]!=null)}};
 var cD=Class.create();cD.prototype={aJ:'',templates:{imageBottomText:''},initialize:function(d){eJ(this.templates,'Gallery');},fg:function(d){new Ajax.bI('GalleryPicturesArea',url({Q:'gallery',item:d.dU}),null,{onComplete:this.fJ.bindAsEventListener(this)});fI('GalleryPicturesArea');},cp:function(){if(this.aJ!='')Element.removeClassName(this.aJ,'Gallery_imageFrame-hover');this.aJ='';},fJ:function(d){document.getElementsByClassName('Gallery_imageFrame_textBottom','GalleryPicturesArea').each(function(el){var F=new Y(el.id.replace('Gallery_imageFrame_textBottom_',''),'picture');el.innerHTML=this.templates.imageBottomText.evaluate({pictureId:F.al(),checked:''});}.bindAsEventListener(this));document.getElementsByClassName('Gallery_imageFrame_montageCheckbox','GalleryPicturesArea').each(function(el){el.checked=L.cP(el.name);Event.observe(el,'click',function(ev){el.checked=L.fy(el.name);}.bindAsEventListener(this));}.bindAsEventListener(this));document.getElementsByClassName('Gallery_imageFrame_montageCheckboxLabel','GalleryPicturesArea').each(function(el){Event.observe(el,'click',function(ev){var dT=el.id.replace('Gallery_imageFrame_montageCheckboxLabel_','Gallery_imageFrame_montageCheckbox_');$(dT).click();}.bindAsEventListener(this));}.bindAsEventListener(this));document.getElementsByClassName('Gallery_imageFrame','GalleryPicturesArea').each(function(el){Event.observe(el,'click',function(ev){if(!r)return;r=false;var F=new Y(el.id.replace('Gallery_imageFrame_',''),'f');ah.show(F.al());this.cp();this.aJ=el.id;Element.addClassName(this.aJ,'Gallery_imageFrame-hover');Event.stop(ev);setTimeout(function(){r=true;},500);}.bindAsEventListener(this));Event.observe(el,'mouseover',function(ev){var F=new Y(el.id.replace('Gallery_imageFrame_',''),'f');Element.addClassName(el,'Gallery_imageFrame-hover');Event.stop(ev);}.bindAsEventListener(this));Event.observe(el,'mouseout',function(ev){var F=new Y(el.id.replace('Gallery_imageFrame_',''),'f');if(this.aJ!=el.id)Element.removeClassName(el,'Gallery_imageFrame-hover');Event.stop(ev);}.bindAsEventListener(this));}.bindAsEventListener(this));},eq:function(){$('GalleryPicturesArea').hide();},fo:function(){$('GalleryPicturesArea').show();}};
 var cV=Class.create();cV.prototype={m:{},maxWidth:175,maxHeight:175,v:1,templates:{frame:'',box:'',pictureWrapper:''},bA:0,by:0,templateId:null,cq:false,bK:[],templateNo:0,backgroundColor:'transparent',initialize:function(d){this.bK=[];this.cq=false;eJ(this.templates,'MontagePreview');this.maxHeight=d.maxHeight;this.maxWidth=d.maxWidth;this.m=C.bx(d.templateNo);this.templateNo=d.templatNo;this.backgroundColor=d.backgroundColor;this.aS();},bY:function(templateNo,d){var i;var B='';if(!gi(this.m.picture)){this.m.picture=[this.m.picture];}for(i=0;i<this.m.picture.length;i++){var P=this.m.picture[i];B+=this.templates.box.evaluate({idMontage:templateNo,idBox:i,top:(this.v*P.top),left:(this.v*P.left),width:(this.v*P.width),height:(this.v*P.height),content:this.eb(this.bK[i],i),zindex:1000+i});}return this.templates.frame.evaluate({id:templateNo,width:this.v*this.m.width,height:this.v*this.m.height,BackgroundColor:this.backgroundColor,content:B});},aS:function(){var ab,ac;ab=this.maxWidth/this.m.width;ac=this.v=this.maxHeight/this.m.height;if(ab>ac){this.v=ac;}else{this.v=ab;}},fk:function(eL){this.bK=eL;},dV:function(fD){this.cq=fD;},eb:function(aY,pos){if(aY==null)return pos+1;var F=new Y(aY,'id');var aP=this.v*this.m.picture[pos].width;var aO=this.v*this.m.picture[pos].height;var bd=F.bX(aP,aO);var B=this.templates.pictureWrapper.evaluate({MaxWidth:aP,MaxHeight:aO,Width:bd.width,Height:bd.height,TemplateId:this.id,BoxId:pos,PictureName:F.bs()});return B;},aT:function(pos){return 'BasketArea_montageBox_'+this.templateNo+'_'+pos;}}; 
 var db=Class.create();db.prototype={m:{},id:0,D:'',maxWidth:450,maxHeight:450,v:1,templates:{frame:'',box:'',pictureWrapper:'',defaultTemplate:''},bA:0,by:0,Z:null,templateId:null,bo:[],aR:[],backgroundColor:null,borderColor:'transparent',borderColorId:null,templateNo: -1,aj:3,initialize:function(id,maxWidth,maxHeight,d){eJ(this.templates,'Montage');this.Z=[];this.D=d.D;this.id=id;this.maxWidth=maxWidth;this.maxHeight=maxHeight;this.aR=[];this.bo=[];this.fc();if(!O){this.eB();}},eB:function(){this.fh(fN('MontageData_'+this.id));},be:function(){fL('MontageData_'+this.id,this.cE());},bJ:function(templateNo,d){var i;if(this.templateId!=null){$A(this.bo).each(function(el){Droppables.remove(el);});this.bo=[];}this.templateNo=templateNo;this.m=C.bx(templateNo);this.templateId=this.m.name;this.aS();this.dP();this.eX(d);ah.dF(this.id,templateNo);this.be();},fc:function(){if(this.templateId==null){$(this.D).update(this.templates.frame.evaluate({id:this.id,top:this.bA,left:this.by,width:this.maxWidth,height:this.maxHeight,content:this.templates.defaultTemplate.evaluate()}));return;}},eX:function(d){var i=0;var B='';if(!gi(this.m.picture)){this.m.picture=[this.m.picture];}for(i=0;i<this.m.picture.length;i++){var P=this.m.picture[i];B+=this.templates.box.evaluate({idMontage:this.id,idBox:i,top:(this.v*P.top),left:(this.v*P.left),width:(this.v*P.width),height:(this.v*P.height),content:i+1});}$(this.D).update(this.templates.frame.evaluate({id:this.id,top:this.bA,left:this.by,width:(this.v*this.m.width)+(2*this.aj)+2,height:(this.v*this.m.height)+(2*this.aj)+2,content:B}));for(i=this.m.picture.length-1;i>=0;i--){this.bo[i]=this.aT(i);Droppables.add(this.aT(i),{hoverclass:'Bar_extendedArea_montageBox-hover',onDrop:function(element,drop,e){Event.stop(e);var M=L.ed(drop.id);if(element.hasClassName('pictureInMontage')){var pos=element.id.replace('pictureSwappingFrom_'+M.id+"_",'');var cB=M.bp(drop.id);if(pos==cB)return;if(M.ft(pos,cB)){M.aV(pos);}M.aV(M.bp(drop.id));}else{var F=new Y(element.id.replace('Montage_draggable_',''),'id');M.aZ(F.al(),M.bp(drop.id));M.aV(M.bp(drop.id));}M.be();}});}$A(this.aR).each(function(el){el.destroy();});this.aR=[];if(this.Z.length>0){for(i=0;i<this.m.picture.length;i++){if(this.Z[i]!=null){this.aZ(this.Z[i],i);this.aV(i);}}while(this.Z.length>this.m.picture.length){this.Z.splice(this.m.picture.length,1);}}},aS:function(){var ab,ac;ab=this.maxWidth/(this.m.width);ac=this.maxHeight/(this.m.height);if(ab>ac){this.v=ac;}else{this.v=ab;}},aZ:function(aY,pos){var F=new Y(aY,'id');var aP=this.v*(this.m.picture[pos].width-(2*this.m.border));var aO=this.v*(this.m.picture[pos].height-(2*this.m.border));var bd=F.bX(aP,aO);var B=this.templates.pictureWrapper.evaluate({MaxWidth:aP+(2*this.aj),MaxHeight:aO+(2*this.aj),Width:bd.width,Height:bd.height,TemplateId:this.id,BoxId:pos,PictureName:F.bs()});$(this.aT(pos)).update(B);this.Z[pos]=aY;this.eV();},aT:function(pos){return 'Bar_extendedArea_montageBox_'+this.id+'_'+pos;},bp:function(bN){return bN.replace('Bar_extendedArea_montageBox_'+this.id+'_','');},ft:function(bC,cl){if(bC==cl)return true;var bG=this.Z[cl];this.aZ(this.Z[bC],cl);if(bG!=null){this.aZ(bG,bC);return true;}else{this.dW(bC);return false;}},dW:function(pos){this.Z[pos]=null;$(this.aT(pos)).update(parseInt(pos)+1);},aV:function(pos){function fP(element){var el=element.cloneNode(true);el.id=el.id.replace('pictureInMontage_','pictureSwappingFrom_');$('Bar_visibleArea').appendChild(el);new Effect.Opacity(el.id,{duration:0.2,from:1.0,to:0.3});return el;};this.aR[this.aR.length]=new SubsDraggable('pictureInMontage_'+this.id+"_"+pos,{dragelement:fP.bindAsEventListener(this),zindex:2000},{offsetLeft:0,offsetTop:0});},bO:function(key){var value=C.eh(key);if(this.templateId!=null){$('Bar_extendedArea_montageFrame_'+this.id).setStyle({backgroundColor:value});this.backgroundColor=value;this.backgroundColorId=key;this.be();}},ee:function(){return this.backgroundColor;},cE:function(ep){var content={};if(this.templateId==null){return null;}content.templateId=this.templateId;content.templateNo=this.templateNo;content.pictureList=this.Z;content.backgroundColor=this.backgroundColor;content.backgroundColorId=this.backgroundColorId;content.borderColor=this.borderColor;content.borderColorId=this.borderColorId;if(ep)content.templateInfo=this.m;return content;},fh:function(content){if(content==null)return;if(fK(content.templateId))return;this.templateId=content.templateId;this.bJ(content.templateNo);this.bO(content.backgroundColorId);var am='montageTab_selectBackColor_'+this.id;$(am).value=content.backgroundColorId;var am='montageTab_selectBorder_'+this.id;$(am).value=content.borderColorId;this.cx(content.borderColorId);var i=0;$A(content.pictureList).each(function(el){if(!fK(el)){this.aZ(el,i);this.aV(i);}i++;}.bindAsEventListener(this));this.be();},fs:function(dL){if(dL){document.getElementsByClassName('Bar_extendedArea_montageBox','montageTab'+this.id+'_canvasArea').each(function(el){el.addClassName('Bar_extendedArea_montageBoxWithBorders');el.removeClassName('Bar_extendedArea_montageBoxNoBorder');}.bindAsEventListener(this));}else{document.getElementsByClassName('Bar_extendedArea_montageBox','montageTab'+this.id+'_canvasArea').each(function(el){el.addClassName('Bar_extendedArea_montageBoxNoBorder');el.removeClassName('Bar_extendedArea_montageBoxWithBorders');}.bindAsEventListener(this));}},cx:function(key){var value=C.ea(key);this.borderColor=value;this.borderColorId=key;if(this.templateId!=null){document.getElementsByClassName('pictureInMontage','Bar_extendedArea_montageFrame_'+this.id).each(function(el){if(value=='transparent'&&fY('msie','6.0')){el.setStyle({borderColor:value,borderStyle:'none',borderWidth:this.aj+'px'});}else{el.setStyle({borderColor:value,borderStyle:'solid',borderWidth:this.aj+'px'});}}.bindAsEventListener(this));this.be();}},eV:function(){if(this.templateId!=null){document.getElementsByClassName('pictureInMontage','Bar_extendedArea_montageFrame_'+this.id).each(function(el){if(this.borderColor=='transparent'&&fY('msie','6.0')){el.setStyle({borderColor:this.borderColor,borderStyle:'none',borderWidth:this.aj+'px'});}else{el.setStyle({borderColor:this.borderColor,borderStyle:'solid',borderWidth:this.aj+'px'});}}.bindAsEventListener(this));}},dP:function(){this.aj=this.m.border*this.v;if(this.aj<1)this.aj=1;}}; 
 var ce=Class.create();ce.prototype={m:{},D:'',maxWidth:175,maxHeight:175,v:1,templates:{frame:'',box:'',selectTemplateHeader:'',templateListWrapper:'',filterOptionItem:''},bA:0,by:0,templateId:null,aG:[],initialize:function(d){eJ(this.templates,'MontageList');for(i=0;i<C.count();i++){var fv=this.bY(i,C.bW(i),{D:'TemplatesArea_template_'+i});new Insertion.Bottom('TemplatesArea_templateList',this.templates.templateListWrapper.evaluate({TemplateNo:i,Content:fv,PictureNo:C.bq(i)}));if(this.aG[C.bq(i)]==null)this.aG[C.bq(i)]=0;this.aG[C.bq(i)]++;}new Insertion.Bottom('TemplatesArea_templateList',"<div style='clear: both;'></div>");this.fJ();var du='';for(i=0;i<this.aG.length;i++){if(this.aG[i]){du+=this.templates.filterOptionItem.evaluate({FilterOptionItemId:i,NumLayouts:this.aG[i]});}}$('TemplatesArea_header').update(this.templates.selectTemplateHeader.evaluate({Content:du,MontageNo:C.count()}));new Autocompleter.SelectBox('MontageList_layoutsCombo',{afterUpdate:this.dG.bindAsEventListener(this)});},fJ:function(){document.getElementsByClassName('TemplatesArea_template','ScreenTemplates').each(function(el){Event.observe(el,'click',function(ev){L.dQ(el.id.replace("TemplatesArea_template_",""));Effect.Fade('ScreenTemplates');Event.stop(ev);}.bindAsEventListener(this));Event.observe(el,'mouseover',function(ev){Element.addClassName(el,'TemplatesArea_template-hover');Event.stop(ev);}.bindAsEventListener(this));Event.observe(el,'mouseout',function(ev){Element.removeClassName(el,'TemplatesArea_template-hover');}.bindAsEventListener(this));}.bindAsEventListener(this));},dG:function(){var cz=$F('MontageList_layoutsCombo');document.getElementsByClassName('TemplatesArea_template','ScreenTemplates').each(function(el){if(Element.hasClassName(el,'TemplatesArea_template_picNo_'+cz)||cz==0){Element.show(el);}else{Element.hide(el);}});},bY:function(templateNo,templateId,d){var i;this.m=C.get(templateId);this.aS();var B='';if(!gi(this.m.picture)){this.m.picture=[this.m.picture];}for(i=0;i<this.m.picture.length;i++){var P=this.m.picture[i];B+=this.templates.box.evaluate({idMontage:templateNo,idBox:i,top:(this.v*P.top),left:(this.v*P.left),width:(this.v*P.width),height:(this.v*P.height),content:i+1,zindex:1000+i});}return this.templates.frame.evaluate({id:templateNo,width:this.v*this.m.width,height:this.v*this.m.height,content:B});},aS:function(){var ab,ac;ab=this.maxWidth/this.m.width;ac=this.v=this.maxHeight/this.m.height;if(ab>ac){this.v=ac;}else{this.v=ab;}}}; 
 var dc=Class.create();dc.prototype={at:{},cO:false,bH:false,D:'',templates:{montageImageDragItem:'',tab:'',tabContent:'',colorOption:''},bm:'',bk:'',J:0,eI:520,cW:400,G:0,K:[],ap:[],cY:{},initialize:function(d){if(O){this.at={};this.dn();}this.eD();this.eE();eJ(this.templates,'MontageStudio');this.D=d.D;},dm:function(pictureId){this.at[pictureId]="1";this.dn();var eO=new Y(pictureId,'id');var ey=new Image();ey.src=eO.bs();},eR:function(pictureId){var list=$H(this.at);list.remove(pictureId);this.at=list;this.dn();},cP:function(pictureId){return this.at[pictureId]!=null;},fy:function(pictureId){if(this.cP(pictureId)){this.eR(pictureId);return false;}else{this.dm(pictureId);return true;}return true;},eD:function(){this.at=fN('PicturesForMontage');},dn:function(){fL('PicturesForMontage',this.at);},cM:function(){if(this.cO)return;this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);this.af(null);var fl={"start":0,"return":false,click:function(id){this.bV(id.replace("montageTab",''));}.bindAsEventListener(this)};jQuery("#MontagePicturesArea_tabsArea ul").idTabs(fl,true);this.cO=true;},show:function(d){X.show({type:'loading',caption:'Loading...',text:'Montages are being loaded.'});this.cM();X.hide();if(aI)new Effect.Fade('Bar_visibleArea_btnMontage');$(this.D).show();aW.eq();if(d.G!=null){this.fi(d.G);}else{this.bV(this.G);}var B='';$H(this.at).each(function(el){if(el.value!=null){var F=new Y(el.key,'id');B+=this.templates.montageImageDragItem.evaluate({pictureId:el.key,pictureThumb:F.bv(),picWidth:'120px',picHeight:'120px'});}}.bindAsEventListener(this));$('MontagePicturesArea').update(B);$('MontagePicturesArea').show();document.getElementsByClassName('Montage_imageArea','MontagePicturesArea').each(function(el){function fP(element){var el=element.cloneNode(true);el.id=element.id.replace('Montage_imageArea_','Montage_draggable_');$('Bar_visibleArea').appendChild(el);new Effect.Opacity(el.id,{duration:0.1,from:1.0,to:0.3});return el;}new SubsDraggable(el.id,{dragelement:fP.bindAsEventListener(this),zindex:2000},{offsetLeft: -30,offsetTop: -30});}.bindAsEventListener(this));},hide:function(){$('MontagePicturesArea').hide();aW.fo();},ed:function(bN){var bG=bN.replace('Bar_extendedArea_montageBox_','');return this.K[bG.replace('pictureSwappingFrom_','').split('_')[0]];},getCurrentMontage:function(){return this.K[this.J];},dA:function(){if(this.bm!='')return this.bm;var aD=C.aD;var j=0;$H(aD).each(function(el){this.bm+=this.templates.colorOption.evaluate({ColorLabelId:el.key,selectedText:(j==0)?'selected':''});j++;}.bindAsEventListener(this));return this.bm;},dz:function(){if(this.bk!='')return this.bk;var aE=C.aE;var j=0;$H(aE).each(function(el){this.bk+=this.templates.colorOption.evaluate({ColorLabelId:el.key,selectedText:''});j++;}.bindAsEventListener(this));return this.bk;},af:function(templateId){var fx=this.templates.tab.evaluate({MontageTabId:this.J,TabName:this.J+1});var tabContentHTML=this.templates.tabContent.evaluate({MontageTabId:this.J,ColorOptions:this.dA(),BorderOptions:this.dz(),Height:this.cW+40});new Insertion.Bottom('MontagePicturesArea_tabs',fx);new Insertion.Bottom('MontagePicturesArea_tabsArea',tabContentHTML);this.K[this.J]=new db(this.J,this.eI,this.cW,{D:'montageTab'+this.J+'_canvasArea',templateId:templateId});var am='montageTab_selectBackColor_'+this.J;var dY=new Autocompleter.SelectBox(am,{afterUpdate:this.K[this.J].bO.bindAsEventListener(this.K[this.J])});var am='montageTab_selectBorder_'+this.J;var dY=new Autocompleter.SelectBox(am,{afterUpdate:this.K[this.J].cx.bindAsEventListener(this.K[this.J])});Event.observe('montageTab'+this.J+'_btnTemplate','click',this.fq.bindAsEventListener(this));var el=$('montageTab_chkShowGuide_'+this.J);Event.observe(el,'click',function(ev){this.K[this.G].fs(el.checked);}.bindAsEventListener(this));this.J++;},hasPicturesSelected:function(){return(this.at.size()!=0);},bV:function(dv){this.G=dv;if(this.K[this.G].templateId==null){Element.hide('Bar_visibleArea_pricesArea');}else{ah.fn(this.G);Element.show('Bar_visibleArea_pricesArea');ah.bg({l:dv});}},fq:function(ev){if(ai.es(this.G)){X.show({type:'yesno',yesText:'Continue',noText:'Cancel',caption:'Change...',text:'If you choose a different layout, items in basket related to this montage will be cleared.',as:function(){if(!this.bH){this.cY=new ce();this.bH=true;}Effect.Appear('ScreenTemplates');}.bindAsEventListener(this),ar:function(){}});}else{if(!this.bH){this.cY=new ce();this.bH=true;}Effect.Appear('ScreenTemplates');}},dQ:function(templateNo){if(this.K[this.G].templateNo==templateNo)return;this.K[this.G].bJ(templateNo);var am='montageTab_selectBackColor_'+this.G;this.K[this.G].bO($F(am));$('montageTab_chkShowGuide_'+this.G).checked=true;this.ap[this.G]=templateNo;this.fe();ah.bg({l:this.G,value:0});this.bV(this.G);},cF:function(){return this.ap[this.G];},bU:function(l){return this.ap[l];},fe:function(){var data={};data.ap=this.ap;fL('MontageStudioData',data);},eE:function(){var data=fN('MontageStudioData');if(data==null||$H(data).size()==0){this.ap=[];}else{this.ap=data.ap;}},ei:function(l){return this.K[l].Z;},getCurrentMontageColor:function(){return this.cI(this.ap[this.G]);},cI:function(l){return this.K[l].ee();},fi:function(l){new Effect.Event({afterFinish:function(){jQuery("a.tab#tab_"+l,null).click();},queue:'end'});},dZ:function(){var i=0;var curMon;var bP;var data=[];for(i=0;i<this.K.length;i++){bP=this.K[i].cE(true);if(bP!=null){data[i]=bP;}}return data;}}; 
 bT=['Albums','Gallery','Basket'];ag=0;r=true;currentEnlargedPicture='';var cK={'attribute':'hovertip','showDelay':300,'hideDelay':0};var clicktipConfig={'attribute':'clicktip'};aI=false;O=false;moData={};xSmartLoadScript(url({Q:'data',item:'printPrices'}));xSmartLoadScript(url({Q:'data',item:'montages'}));xSmartLoadScript(url({Q:'data',item:'montagePrices'}));moConfigData={};xSmartLoadScript(url({Q:'data',item:'config'}));an={};Event.observe(window,'load',fX);function w(){return bT[ag];};function fJ(){Event.observe(document.body,'contextmenu',function(ev){Event.stop(ev);alert("Right click is not permitted.");});document.getElementsByClassName('Albums_imgFrame','AlbumsArea').each(function(el){Event.observe(el,'click',function(ev){Event.stop(ev);gb({dU:el.id});});});window.onbeforeunload=function(){if(cv){return "If you continue you will EXIT the gallery.";}}};function fX(ev){Event.stop(ev);X=new cC();jQuery.extend(jQuery.blockUI.defaults.overlayCSS,{backgroundColor:'#000'});jQuery.extend(jQuery.blockUI.defaults.pageMessageCSS,{border:'none'});jQuery('.iniMessage').hide();H=new cy(moConfigData);fW();aI=H.get('Montage','montagesEnabled')=='true';cv=true;C=new cZ(moData);aW=new cD({D:'GalleryArea'});L=new dc({D:'Bar_montageArea'});ai=new cu({D:'BasketArea'});ah=new ct();fJ();fV();X.hide();if(H.get('Extras','pswEnabled')=='true'){gc('');}else{aB();};};function aB(){if(xGetURLArguments()['payment_status']=='Completed'){ai.clear();X.show({type:'yes',yesText:'OK',caption:'Order Processed',text:'A mail has been sent to you with the order information. Thanks for your purchase.',as:function(){},ar:function(){}});}};function gc(eZ){if(H.get('Extras','pswText')!=eZ){X.dq('1');X.show({type:'secretInput',yesText:'OK',noText:'Cancel',ew:1,caption:'Password protection',text:'This gallery is password protected. Please insert password:',as:function(){gc($F('dialogTextBox'));},ar:function(){},cS:['dialogTextBox']});}else{X.hide();X.fd();aB();}};function fW(){an.urlBase=fS();an.orderId=H.get('General','galleryIdPrefix');var bQ=new Date();an.orderId+="-"+bQ.getDate()+(bQ.getMonth()+1)+bQ.getYear();an.orderId+="-"+Math.floor(Math.random()*100001);an.galleryHost=location.host;};function fV(){new Effect.Appear('ScreenAlbums',{queue:'end'});};function gb(d){Element.show('ScreenGallery');Element.show('ScreenBasket');Element.show('ScreenBar');aW.fg(d);fT();};function ga(d){Element.hide('ScreenGallery');Element.hide('ScreenBasket');Element.hide('ScreenBar');};function fT(){if(!r)return;r=false;if(w()=='Albums'){new Effect.SlideUp('ScreenAlbums',{queue:'end'});}if(w()=='Gallery'){X.show({type:'loading',caption:'Loading...',text:''});ai.cb();X.hide();ah.hide();new Effect.SlideUp('ScreenGallery',{queue:'end'});aW.cp();new Effect.Fade('Bar_visibleArea_btnNextStep');new Effect.Appear('Bar_visibleArea_gallery');if(aI)new Effect.Appear('Bar_visibleArea_btnMontage');}if(w()=='Basket'){}if(ag<2)ag++;setTimeout(function(){r=true;},500);};function fM(bi){if(!r)return;if(bi!=null&&bi==ag)return;r=false;if(w()=='Albums'){}if(w()=='Gallery'){ah.hide();new Effect.SlideDown('ScreenAlbums',{queue:'end'});new Effect.Event({afterFinish:ga,queue:'end'});}if(w()=='Basket'){new Effect.SlideDown('ScreenGallery',{queue:'end'});if(aI)new Effect.Appear('Bar_visibleArea_btnMontage');new Effect.Appear('Bar_visibleArea_btnNextStep');new Effect.Fade('Bar_visibleArea_gallery');}if(ag>0)ag--;if(bi!=null&&ag>bi){r=true;fM(bi);}else{setTimeout(function(){r=true;},500);}};function fQ(ay,cc){if(!r)return;r=false;new Effect.SlideDown('ScreenGallery',{queue:'end'});new Effect.Fade('Bar_visibleArea_gallery');new Effect.Appear('Bar_visibleArea_btnNextStep');if(cc=='picture'||cc==null||fK(cc)){new Effect.Event({afterFinish:function(){ah.show(ay);},queue:'end'});}else{new Effect.Event({afterFinish:function(){ah.dr(ay-1);},queue:'end'});}ag--;setTimeout(function(){r=true;},500);};function fZ(){fM(0);};function ge(){return bT[ag+1];};function gd(){return bT[ag-1];}
