if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){var a=this.length;var c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a;
}for(;c<a;c++){if(c in this&&this[c]===b){return c;}}return -1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b){var a=this.length;var c=Number(arguments[1]);
if(isNaN(c)){c=a-1;}else{c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a;}else{if(c>=a){c=a-1;}}}for(;c>-1;c--){if(c in this&&this[c]===b){return c;}}return -1;};
}if(!Array.prototype.some){Array.prototype.some=function(b){var a=this.length;if(typeof b!=="function"){throw new TypeError();}var d=arguments[1];for(var c=0;c<a;
c++){if(c in this&&b.call(d,this[c],c,this)){return true;}}return false;};}if(!Array.prototype.every){Array.prototype.every=function(b){var a=this.length;if(typeof b!=="function"){throw new TypeError();
}var d=arguments[1];for(var c=0;c<a;c++){if(c in this&&!b.call(d,this[c],c,this)){return false;}}return true;};}if(!Array.prototype.forEach){Array.prototype.forEach=function(b){var a=this.length;
if(typeof b!=="function"){throw new TypeError();}var d=arguments[1];for(var c=0;c<a;c++){if(c in this){b.call(d,this[c],c,this);}}};}if(!Array.prototype.filter){Array.prototype.filter=function(b){var a=this.length;
if(typeof b!=="function"){throw new TypeError();}var e=[];var d=arguments[1];for(var c=0;c<a;c++){if(c in this){var f=this[c];if(b.call(d,f,c,this)){e.push(f);}}}return e;
};}if(!Array.prototype.map){Array.prototype.map=function(b){var a=this.length;if(typeof b!=="function"){throw new TypeError();}var e=[];var d=arguments[1];for(var c=0;
c<a;c++){if(c in this){e[c]=b.call(d,this[c],c,this);}}return e;};}if(!Array.prototype.reduce){Array.prototype.reduce=function(b){var a=this.length;if(typeof b!=="function"){throw new TypeError();
}if(a===0&&arguments.length===1){throw new TypeError();}var d,c=0;if(arguments.length>=2){d=arguments[1];}else{do{if(c in this){d=this[c++];break;}if(++c>=a){throw new TypeError();
}}while(true);}for(;c<a;c++){if(c in this){d=b.call(null,d,this[c],c,this);}}return d;};}if(!Array.prototype.reduceRight){Array.prototype.reduceRight=function(b){var a=this.length;
if(typeof b!=="function"){throw new TypeError();}if(a===0&&arguments.length===1){throw new TypeError();}var d,c=a-1;if(arguments.length>=2){d=arguments[1];}else{do{if(c in this){d=this[c--];
break;}if(--c<0){throw new TypeError();}}while(true);}for(;c>=0;c--){if(c in this){d=b.call(null,d,this[c],c,this);}}return d;};}PB={toString:function(){return"Photobooks, Inc.";
},JumpSelect:function(a){if(a.value&&a.value!==""){document.location.href=a.value;}},CloseChild:function(a){a.close();},ContentClass:"layout_eWEP",FormFill:{toString:function(){return"Photobooks Form Repopulation Manager";
},Load:function(e,d,g){if(g===null){return;}var c,a;var f=$(e);var b;if(f){b=f[d];}if(b){switch(b.type){case"select-one":c=b.options.length;while(c--){if((b[c].value===g)||(b[c].text===g)){b.selectedIndex=c;
}}break;case"select-multiple":c=b.options.length;while(c--){for(a=0;a<g.split(", ").length;a++){if((b[c].value===g.split(", ")[a])||(b[c].text===g.split(", ")[a])){b.options[c].selected=true;
}}}break;case"radio":case"checkbox":if(b.value===g){b.checked=true;}break;case"file":break;case undefined:if(b.length&&b.length>0){switch(b[0].type){case"radio":c=b.length;
while(c--){if(b[c].value===g){b[c].checked=true;}}break;case"checkbox":c=b.length;g=g.split(", ");while(c--){a=g.length;while(a--){if(b[c].value===g[a]){b[c].checked=true;
}}}break;}}break;default:b.value=g;break;}}}},MouseOvers:{toString:function(){return"Photobooks Mouseover Manager";},elements:[],waiting:false,add:function(b,a){this.elements.push({el:b,src:null,hoverEl:null,hoverSrc:a,applied:false});
},apply:function(){if(this.waiting===true){return;}this.waiting=true;Event.onDOMReady(function(){this.waiting=false;var c=this.elements;var a,e,d,b=[];for(a=0;a<c.length;
a++){if(c[a].applied===true){continue;}d=$(c[a].el);if(d===null||d.nodeName.toLowerCase()!=="img"){continue;}e=c.length;while(e--){if(c[e].el===d&&c[e].applied===true){c[a].applied=true;
continue;}}c[a].el=d;c[a].src=d.src;c[a].hoverEl=new Image(d.width,d.height);c[a].hoverEl.alt=d.alt;c[a].hoverEl.src=c[a].hoverSrc;c[a].hoverSrc=c[a].hoverEl.src;
Event.addListener(d,"mouseover",this.doHover,c[a]);Event.addListener(d,"mouseout",this.doHover,c[a]);c[a].applied=true;}},this,true);},doHover:function(b,c){var a=Event.getTarget(b);
a.src=(b.type==="mouseover")?c.hoverSrc:c.src;}},FontResizer:{data:{content:"layout_Content",sizes:{size1:"text_size_1",size2:"text_size_2",size3:"text_size_3",size4:"text_size_4"},methods:{increment:"text_size_increment",decrement:"text_size_decrement"},cssSizes:{size1:"10px",size2:"13px",size3:"16px",size4:"19px"}},init:function(){var a;
function b(d){for(var c in d){if(Lang.hasOwnProperty(d,c)){d[c]=$(d[c]);}}}b(this.data);b(this.data.sizes);if(!this.data.methods.increment){return;}Event.addListener(this.data.methods.increment,"click",this.increment,this,true);
Event.addListener(this.data.methods.decrement,"click",this.decrement,this,true);this.findActiveState();if(this.currentState!=="size2"){this.setState(this.currentState);
}},findActiveState:function(){var b,c,a,d=document.cookie.split("; "),e=null;for(a=0;a<d.length;a++){b=d[a].indexOf("=");c=d[a].substr(0,b);if(c!=="FontSize"){continue;
}e=d[a].substring(b+1);break;}if(e===null){e="size2";}if(Lang.hasOwnProperty(this.data.sizes,e)===false){e="size2";}this.currentState=e;document.cookie="FontSize="+e;
},doClick:function(d){var c=Event.getTarget(d),a,b=null;for(a in this.data.sizes){if(Lang.hasOwnProperty(this.data.sizes,a)&&this.data.sizes[a]===c){b=a;}}if(b===this.currentState||b===null){return;
}this.setState(b);},setState:function(b){var a=this.data.cssSizes[b];if(!a){return;}Dom.setStyle(this.data.content,"fontSize",a);this.currentState=b;document.cookie="FontSize="+b;
switch(this.currentState){case"size1":Dom.get("text_size_decrement").src="/images/Layout/minus_btn_disabled.gif";break;case"size4":Dom.get("text_size_increment").src="/images/Layout/plus_btn_disabled.gif";
break;default:Dom.get("text_size_increment").src="/images/Layout/plus_btn.gif";Dom.get("text_size_decrement").src="/images/Layout/minus_btn.gif";}},increment:function(){this.findActiveState();
switch(this.currentState){case"size1":this.setState("size2");break;case"size2":this.setState("size3");break;case"size3":this.setState("size4");break;default:return;
}},decrement:function(){this.findActiveState();switch(this.currentState){case"size2":this.setState("size1");break;case"size3":this.setState("size2");break;case"size4":this.setState("size3");
break;default:return;}}},FontResizerX:{toString:function(){return"Photobooks Font Resizer";},Icon:"/images/Icons/font_resize_btn.gif",ContentID:"layout_eWEP",Content:null,ContainerID:"FontResizer",Container:null,ActiveState:null,DefaultState:"Size1",Icons:[],FindActiveState:function(){var d="";
var b=document.cookie;var e=b.split("; ");var c,a;for(a=0;a<e.length;a++){c=e[a].substr(0,e[a].indexOf("="));if(c!=="FontSize"){continue;}d=e[a].substring(e[a].indexOf("=")+1);
break;}switch(d.toLowerCase()){case"size1":d="Size1";break;case"size2":d="Size2";break;case"size3":d="Size3";break;case"size4":d="Size4";break;default:d=this.DefaultState;
break;}this.ActiveState=d;document.cookie="FontSize="+d;},Render:function(){var b;var a;for(a=4;a>0;a--){b=document.createElement("a");b.href="#null";b.id=this.ContainerID+a;
Dom.addClass(b,"Icon");Dom.addClass(b,"Size"+a);if(this.ActiveState==="Size"+a){Dom.addClass(b,"Active");Dom.addClass(b,"S"+a+"Active");}this.Icons.push(b);this.Container.appendChild(b);
}Dom.setStyle(this.Container,"display","block");Event.addListener(this.Container,"click",this.onClick,this,true);},Init:function(){this.Container=$(this.ContainerID);
if(!this.Container){return;}this.Content=$(this.ContentID);this.FindActiveState();this.Render();if(this.ActiveState!==this.DefaultState){this.ChangeSize(this.ActiveState);
}},onClick:function(f,h){var b=f.target||f.srcElement;if(!b.nodeName||b.nodeName.toLowerCase()!=="a"){return;}if(Dom.hasClass(b,"Active")===true){return;}var a=b.id;
var d=a.substring(this.ContainerID.length);var g="Size"+d;var c;Dom.removeClass(this.Icons,"Active");for(c=1;c<=4;c++){Dom.removeClass(this.Icons,"S"+c+"Active");
}Dom.addClass(b,"Active");Dom.addClass(b,"S"+d+"Active");this.ChangeSize(g);},ChangeSize:function(b){var a;switch(b){case"Size1":a="small";break;case"Size2":a="medium";
break;case"Size3":a="large";break;case"Size4":a="x-large";break;default:return;}Dom.setStyle(this.Content,"fontSize",a);this.ActiveState=b;document.cookie="FontSize="+b;
}}};Event.onDOMReady(PB.FontResizer.init,PB.FontResizer,true);
