﻿/*

    Copyright © 1998-2009 ITGoldenBrigde Inc. All Rights Reserved.
    
*/

var $=function(A){if("string"===typeof A||A instanceof String){return document.getElementById(A)}return A};var itgoldenbrigde={behavior:{},controller:{},cookie:{},data:{},fn:{},fx:{},io:{json:{}},lang:{script:{}},metrics:{},quicktime:{},util:{},widget:{}};if("undefined"!==typeof dojo){dojo.__require=dojo.require;dojo.__provide=dojo.provide;dojo.require=function(A){if(A.indexOf("itgoldenbrigde")===0){return }else{dojo.__require(A)}};dojo.provide=function(A){if(A.indexOf("itgoldenbrigde")===0){return }else{dojo.__provide(A)}};dojo.byId=$}Math.clamp=function(C,B,A){return Math.min(Math.max(B,C),A)};itgoldenbrigde.util.makeSubclass=function(A,C){function B(){}B.prototype=C.prototype;A.prototype=new B();A.prototype.constructor=A;A.superclass=C;if(C.prototype.constructor!=C){C.prototype.constructor=C}A.prototype.base=function(F){var D=this;var E=C.prototype[F];if("function"!=typeof (E)){return E}return function(){return E.apply(D,arguments)}}};itgoldenbrigde.util.TEMPLATE_REGEX=/\$\{(\w+)\}/g;itgoldenbrigde.util.expandTemplate=function(B,D,A){function C(G,E){var F=D[E];if(null===F||"undefined"===typeof (F)){return A}return F}return B.replace(this.TEMPLATE_REGEX,C)};itgoldenbrigde.util.assignId=Element.assignId;itgoldenbrigde.util.applyDefaults=Object.applyDefaults;itgoldenbrigde.util.merge=Object.merge;Object.extend(Element,{hide:function(A){if(typeof A.cssDisplayCache=="undefined"){var B=A.style.display;if(B!="none"){A.cssDisplayCache=B}}A.style.display="none"},show:function(A){A.style.display=A.cssDisplayCache||"";A.cssDisplayCache=undefined},getDimensions:function(C){C=$(C);var G=Element.getStyle(C,"display");if(G&&G!="none"){return{left:C.offsetLeft,top:C.offsetTop,width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var E={width:C.offsetWidth,height:C.offsetHeight,left:C.offsetLeft,top:C.offsetTop};B.display=A;B.position=D;B.visibility=F;return E},getMarginBox:function(D){var C=Element.getStyles(D,["marginTop","marginBottom","marginRight","marginLeft"]);for(var B in C){C[B]=parseInt(C[B],10)||0}var A=C.marginLeft+C.marginRight;var E=C.marginTop+C.marginBottom;return{width:D.offsetWidth+A,height:D.offsetHeight+E}},setMarginBox:function(F,B){var E=Element.getStyles(F,["marginTop","marginBottom","marginRight","marginLeft","paddingTop","paddingBottom","paddingRight","paddingLeft","borderTopWidth","borderBottomWidth","borderRightWidth","borderLeftWidth"]);for(var D in E){E[D]=parseInt(E[D],10)||0}var C=E.marginLeft+E.marginRight+E.borderLeftWidth+E.borderRightWidth+E.paddingLeft+E.paddingRight;var A=E.marginTop+E.marginBottom+E.borderTopWidth+E.borderBottomWidth+E.paddingTop+E.paddingBottom;F.style.width=(B.width-C)+"px";F.style.height=(B.height-A)+"px"},makeClipping:function(A){A=$(A);if(!A){return A}A._originalOverflow=A.style.overflow||A.style.overflowY||A.style.overflowX;A.style.overflow="hidden";return A},undoClipping:function(A){A=$(A);if(!A||!("_originalOverflow" in A)){return A}A.style.overflow=A._originalOverflow||"";A._originalOverflow=null;return A},makePositioned:function(C,A){C=$(C);if(!C){return C}A=A||"relative";var B=Element.getStyle(C,"position");if("relative"==B||"absolute"==B||A==B){return C}C._originalPosition=B;C.style.position=A||"relative";if(window.opera){C.style.top=C.style.left="0"}return C},undoPositioned:function(A){A=$(A);if(!A||!("_originalPosition" in A)){return A}A.style.position=A._originalPosition||"";A._originalPosition=null;return A},getPositionedOffset:function(B){B=$(B);var A=0;var D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break}var C=Element.getStyle(B,"position");if(C=="relative"||C=="absolute"){break}}}while(B);return{left:D,top:A}},makeAbsolute:function(B){B=$(B);if(B.style.position=="absolute"){return }var F=Element.getPositionedOffset(B);var E=F.top-parseFloat(Element.getStyle(B,"margin-top")||0);var D=F.left-parseFloat(Element.getStyle(B,"margin-left")||0);var C=B.clientWidth-parseFloat(Element.getStyle(B,"padding-left")||0)-parseFloat(Element.getStyle(B,"padding-right")||0);var A=B.clientHeight-parseFloat(Element.getStyle(B,"padding-top")||0)-parseFloat(Element.getStyle(B,"padding-bottom")||0);B._originalLeft=B.style.left;B._originalTop=B.style.top;B._originalWidth=B.style.width;B._originalHeight=B.style.height;B._originalPosition=B.style.position;B.style.position="absolute";B.style.top=E+"px";B.style.left=D+"px";B.style.width=C+"px";B.style.height=A+"px"},undoMakeAbsolute:function(A){A=$(A);if(A.style.position!="absolute"){return }A.style.position=A._originalPosition;A.style.left=A._originalLeft;A.style.top=A._originalTop;A.style.width=A._originalWidth;A.style.height=A._originalHeight},getElementsByClassName:function(B,A){return Element.queryAll(A,"."+B)},getOpacity:function(A){return Element.getStyles(A,"opacity")},setOpacity:function(A,B){A=$(A);if(B==1||B===""){A.style.opacity=""}else{if(B<0.00001){A.style.opacity=0}else{A.style.opacity=B}}return A},getPadding:function(C){var A=document.defaultView;var B=A.getComputedStyle(C,null);return{left:parseFloat(B.paddingLeft)||0,top:parseFloat(B.paddingTop)||0,right:parseFloat(B.paddingRight)||0,bottom:parseFloat(B.paddingBottom)||0}},setStyles:function(B,A){for(var C in A){if(C!="opacity"){B.style[C]=A[C]}else{Element.setOpacity(B,A[C])}}},setStyle:function(B,D,C){var A={};A[D]=C;Element.setStyles(B,A)}});if(coherent.Browser.IE){Object.extend(Element,{setOpacity:function(A,D){A=$(A);var C=Element.getStyle(A,"filter");var B=A.style;if(D==1||D===""){B.filter=C.replace(/alpha\([^\)]*\)/gi,"");return A}if(D<0.00001){D=0}B.filter=C.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(D*100)+")";return A},getPadding:function(B){var A=B.currentStyle;return{left:parseFloat(A.paddingLeft)||0,top:parseFloat(A.paddingTop)||0,right:parseFloat(A.paddingRight)||0,bottom:parseFloat(A.paddingBottom)||0}}})}Object.extend(Event,{sendMouseEvent:(function(){if(!coherent.Browser.IE){return function(E,C,A,B){var D=document.createEvent("MouseEvents");if(D.initMouseEvent){D.initMouseEvent(C,A,B,window,0,0,0,0,0,false,false,false,false,0,null)}else{D=document.createEvent("UIEvents");D.initEvent(C,A,B);D.view=window;D.detail=0;D.screenX=0;D.screenY=0;D.clientX=0;D.clientY=0;D.ctrlKey=false;D.altKey=false;D.metaKey=false;D.shiftKey=false;D.button=0;D.relatedTarget=null}return E.dispatchEvent(D)}}else{return function(E,C,A,B){var D=document.createEventObject("MouseEvents");D.bubbles=A;D.cancelable=B;D.view=window;D.detail=0;D.screenX=0;D.screenY=0;D.clientX=0;D.clientY=0;D.ctrlKey=false;D.altKey=false;D.metaKey=false;D.shiftKey=false;D.button=1;return E.fireEvent("on"+C,D)}}})(),isNumpadNumKey:function(A){return A>=96&&A<=111},isAlphaNumKey:function(A){if(!this._reverseKeys){this._reverseKeys=(function(){var D={};var C=Event.KEYS;for(var B in C){D[C[B]]=B}return D})()}return this.isNumpadNumKey(A)||!this._reverseKeys[A]},mousePosition:function(B){var C={x:0,y:0};if(B.pageX||B.pageY){C.x=B.pageX;C.y=B.pageY}else{var A=document.documentElement||document.body;C.x=B.clientX+A.scrollLeft-A.clientLeft;C.y=B.clientY+A.scrollTop-A.clientTop}return C},isMouseOverElement:function(E,D){var B=Event.mousePosition(E);var H=Element.position(D);var G=H.top;var A=G+D.offsetHeight;var F=H.left;var C=F+D.offsetWidth;return(B.x>=F&&B.x<=C&&B.y>=G&&B.y<=A)},onUnload:function(A){if(!arguments.callee.__fn){arguments.callee.__fn=function(){var B=arguments.callee.__handlers;while(B.length){(B.pop())()}delete arguments.callee.__handlers};Event.observe(window,"unload",arguments.callee.__fn);arguments.callee.__fn.__handlers=[]}arguments.callee.__fn.__handlers.push(A)},fixEvent:function(B){if(!B){if(window.event){B=window.event}}if(coherent.Browser.IE){if(!B.target){B.target=B.srcElement}if(!B.currentTarget){B.currentTarget=B.srcElement}if(!B.layerX){B.layerX=B.offsetX}if(!B.layerY){B.layerY=B.offsetY}var C=(B.srcElement&&B.srcElement.ownerDocument)?B.srcElement.ownerDocument:document;var A=(C.compatMode=="BackCompat")?C.body:C.documentElement;if(!B.pageX){B.pageX=B.clientX+(A.scrollLeft||0)}if(!B.pageY){B.pageY=B.clientY+(A.scrollTop||0)}if(B.type=="mouseover"){B.relatedTarget=B.fromElement}if(B.type=="mouseout"){B.relatedTarget=B.toElement}}return B},KEYS:{KEY_BACKSPACE:8,KEY_TAB:9,KEY_CLEAR:12,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_HELP:47,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_NUMPAD_MULTIPLY:106,KEY_NUMPAD_PLUS:107,KEY_NUMPAD_ENTER:108,KEY_NUMPAD_MINUS:109,KEY_NUMPAD_PERIOD:110,KEY_NUMPAD_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_F13:124,KEY_F14:125,KEY_F15:126,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145}});if("undefined"===typeof (window.LivePerson)){window.LivePerson={}}Object.extend(window.LivePerson,{chatButtonId:"lpChatButton",inviteId:"inviteBadge",chatInvitation:"Chat now!",animator:null,init:function(){var A=$("aos_header");if(!A){return }this.isPancakeMode=Element.hasClassName(A,"collapsed")},createInvitation:function(){var B=$(this.chatButtonId);if(!B){return null}var A=$(this.inviteId);if(A!==null){return null}A=document.createElement("button");A.id=this.inviteId;A.appendChild(document.createTextNode(this.chatInvitation));B.parentNode.insertBefore(A,B);if(this.isPancakeMode){var C=Element.getPositionedOffset(B);A.style.left=C.left+"px";A.style.top=C.top+"px"}else{this.originalWidth=Element.getDimensions(A).width;A.style.width="0"}A.onclick=this.inviteButtonClicked.bindAsEventListener(this);return A},showInviteButton:function(){this.animator.play(this.getInviteAnimation(),this.onShowInviteComplete.bind(this))},hideInviteButton:function(){this.animator.reverse(this.onHideInviteComplete.bind(this))},removeInviteButton:function(){var A=$(this.inviteId);A.parentNode.removeChild(A)},onShowInviteComplete:function(){window.setTimeout(this.hideInviteButton.bind(this),2500)},onHideInviteComplete:function(){if(this.inviteTimedOut===true){this.removeInviteButton()}else{window.setTimeout(this.showInviteButton.bind(this),2500)}},getInviteAnimation:function(){var B=itgoldenbrigde.fx.easeOutSine;var A=this.originalWidth;var C=$(this.inviteId);return function(D){D=B(D);C.style.width=D*A+"px"}},oninvite:function(){var A=this.createInvitation();if(!A){return }if(this.isPancakeMode){return }this.animator=new itgoldenbrigde.fx.Animator({duration:250});this.animator.play(this.getInviteAnimation(),this.onShowInviteComplete.bind(this))},ontimeout:function(){if(this.isPancakeMode){this.removeInviteButton();return }this.inviteTimedOut=true},inviteButtonClicked:function(A){this.invitationAccepted()}});Event.onDomReady(window.LivePerson.init.bind(window.LivePerson));itgoldenbrigde.cookie=function(A,H,G){var F=document.cookie;if(arguments.length==1){if(A){var I=F.lastIndexOf(A+"=");if(I==-1){return null}var B=I+A.length+1;var D=F.indexOf(";",I+A.length+1);if(D==-1){D=F.length}return decodeURIComponent(F.substring(B,D))}else{return null}}else{if(A&&H){G=G||{};H=encodeURIComponent(H);var C=G.expires;if(typeof (C)=="number"){var E=new Date();E.setTime(E.getTime()+(C*24*60*60*1000));C=E}document.cookie=A+"="+H+(C?"; expires="+C.toUTCString():"")+(G.path?"; path="+G.path:"")+(G.domain?"; domain="+G.domain:"")+(G.secure?"; secure":"")}return null}};itgoldenbrigde.cookie.deleteCookie=function(A){if(A){itgoldenbrigde.cookie(A,null,{expires:0})}};itgoldenbrigde.cookie.objectCookie=function(A,E,C){if(arguments.length==1){var B=itgoldenbrigde.cookie(A);return itgoldenbrigde.cookie.decodeObject(B)}var D=itgoldenbrigde.cookie.encodeObject(E);itgoldenbrigde.cookie(A,D,C);return null};itgoldenbrigde.cookie.encodeObject=function(A){if(!A){return null}return escape(itgoldenbrigde.data.json.stringify(A))};itgoldenbrigde.cookie.decodeObject=function(A){if(!A){return null}try{return itgoldenbrigde.data.json.parse(unescape(A))}catch(B){return null}};itgoldenbrigde.quicktime._initialised=false;itgoldenbrigde.quicktime._version=undefined;itgoldenbrigde.quicktime.DEFAULTS={activeXClassId:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",activeXCodebase:"../qtactivex/qtplugin.cab#version=6,0,2,0",mimeType:"video/quicktime",autoplay:true,cache:true,controller:false,enablejavascript:true,showlogo:false,saveembedtags:true,scale:"aspect"};itgoldenbrigde.quicktime.mobileSafari=!!navigator.userAgent.match(/Mobile.*Safari/);itgoldenbrigde.quicktime.isInstalled=function(){return(this.mobileSafari||this._version||this.getVersion())?true:false};itgoldenbrigde.quicktime.getVersion=function(){if(this._version||this._initialised){return this._version}this._initialised=true;var B=window.navigator.plugins;var A=B?B.length:0;if(B&&A){var E;for(E=0;E<A;++E){var F=B[E];var C=F.name.match(/quicktime\D*([\.\d]*)/i);if(C&&C[1]){return(this._version=C[1])}}}else{try{var D=new window.ActiveXObject("QuickTimeCheckObject.QuickTimeCheck");this._version=Number(D.QuickTimeVersion.toString(16).charAt(0))}catch(G){}return this._version}return this._version};itgoldenbrigde.quicktime.isVersionCompatible=function(B){function A(F,H){var E=parseInt(F[0],10);if(isNaN(E)){E=0}var G=parseInt(H[0],10);if(isNaN(G)){G=0}if(E<G){return true}if(E>G){return false}return A(F.slice(1),H.slice(1))}var C=String(B).split(/\./);var D=String(this.getVersion()).split(/\./);return A(C,D)};itgoldenbrigde.quicktime.createMovie=function(B,A){var D=document.createElement("OBJECT");B=Object.applyDefaults(Object.clone(B),this.DEFAULTS);function C(F){if(!(F in B)){return }D.setAttribute(F,B[F])}function E(F){var G=document.createElement("PARAM");if(!(F in B)){return }G.setAttribute("name",F);G.setAttribute("value",B[F]);D.appendChild(G)}["width","height","name","id","class","title","bgcolor"].forEach(C);["src","autoplay","cache","controller","enablejavascript","showlogo","saveembedtags","loop"].forEach(E);if(window.ActiveXObject){D.setAttribute("classid",B.activeXClassId);D.setAttribute("codebase",B.activeXCodebase)}else{D.setAttribute("data",B.src);D.setAttribute("type",B.mimeType)}A.appendChild(D);return D};itgoldenbrigde.quicktime.logProperties=function(A){function B(E){try{return[E,A["Get"+E]()].join(": ")}catch(D){return D.message}}var C;C=["PluginStatus","AutoPlay","ControllerVisible","Rate","Time","Volume","Mute","MovieName","MovieID","StartTime","EndTime","BgColor","IsLooping","LoopIsPalindrome","PlayEveryFrame","HREF","Target","QTNEXTUrl","URL","KioskMode","Duration","MaxTimeLoaded","TimeScale","MovieSize","MaxBytesLoaded","TrackCount","Matrix","Rectangle","Language"].map(B);console.log(C.join("\n"))};itgoldenbrigde.behavior.Striper=function(){var B=null;var D=["odd","even"];var A=5;function C(H){var F=H.getElementsByTagName("tbody");for(var E=0;E<F.length;E++){var I=F[E].getElementsByTagName("tr");for(var G=0;G<I.length;G++){var J=I[G].className.split(" ");for(var K=0;K<D.length;K++){if(J.indexOf(D[K])!=-1){J.splice(J.indexOf(D[K]),1)}}J.push(D[G%D.length]);I[G].className=J.join(" ")}}}return function(H){var G;var F;if("undefined"===typeof H){var E=document.getElementsByTagName("table");if(null!==B&&"string"===typeof B){for(F=0;F<E.length;F++){if(E[F].className.indexOf(B)!=-1){G.push(E[F])}}}else{G=E}}else{if("string"===typeof H){G=[document.getElementById(H)]}else{G=[H]}}for(F=0;F<Math.min(A,G.length);F++){C(G[F])}for(var I=10;F<G.length;F++){window.setTimeout(function(){var J=G[F];return function(){C(J)}}(),I);I+=10}}}();Event.onDomReady(itgoldenbrigde.behavior.Striper);itgoldenbrigde.data.json=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}";default:return"null"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}();itgoldenbrigde.fx.Animator=function(A){this._direction=1;this.t=0;this.config=Object.applyDefaults(A,arguments.callee.DEFAULTS)};itgoldenbrigde.fx.Animator.DEFAULTS={actions:[],duration:250,frameRate:60,callback:null};itgoldenbrigde.fx.Animator.prototype.setDuration=function(A){this.config.duration=A};itgoldenbrigde.fx.Animator.prototype.finishNow=function(){function A(B){B(1);if("finish" in B){B.finish(1)}}this.config.actions.forEach(A)};itgoldenbrigde.fx.Animator.prototype.stop=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=0};itgoldenbrigde.fx.Animator.prototype.play=function(A,B){this.stop();if("function"==typeof (A)){A=[A]}if(A&&this.config.actions!=A){if(0<this.t&&1>this.t){this.finishNow()}this.config.actions=A.filter(function(C){return null!==C&&"undefined"!=typeof (C)});this.t=0}if(1==this.t){this.t=0}this._direction=1;this._run(this.config.actions,this._direction,this.t,B||this.config.callback)};itgoldenbrigde.fx.Animator.prototype.reverse=function(A){this.stop();this._direction=(this._direction>0)?-1:1;this._run(this.config.actions,this._direction,this.t,A||this.config.callback)};itgoldenbrigde.fx.Animator.prototype._run=function(G,M,H,N){var O=this;var B;var E=this.config.duration;var J=G.length;var I;var F=Math.round(1000/this.config.frameRate);for(I=0;I<J;++I){if("setup" in G[I]){G[I].setup()}}function L(){O._timer=0;for(I=0;I<J;++I){if("finish" in G[I]){G[I].finish(O.t)}}if(N){N(O.t)}}function D(){var P=(new Date()).getTime()-B;if(P>E){P=E}O.t=Math.round(P/E*1000)/1000;for(I=0;I<J;++I){G[I](O.t)}if(P==E){L();return }O._timer=window.setTimeout(A,F)}function K(){var P=(new Date()).getTime()-B;if(P>E){P=E}O.t=1-P/E;for(I=0;I<J;++I){G[I](O.t)}if(P==E){L();return }O._timer=window.setTimeout(A,F)}var A=D;if(M<0){A=K;H=1-H}function C(){B=(new Date()).getTime()-E*H;A()}this._timer=window.setTimeout(C,0)};itgoldenbrigde.fx.ContentSwapper=function(A){A=Object.applyDefaults(A,arguments.callee.DEFAULTS);this.base("constructor")(A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.fx.ContentSwapper,itgoldenbrigde.fx.Animator);itgoldenbrigde.fx.ContentSwapper.DEFAULTS={duration:1000,transition:"crossfade"};Class.extend(itgoldenbrigde.fx.ContentSwapper,{fixElementDimensions:function(C){var B=$(this._measureDiv);if(!B){B=document.createElement("div");this._measureDiv=Element.assignId(B);B.style.position="relative";var A=$(this.config.id);A.appendChild(B)}C._originalWidth=C.style.width;C._originalHeight=C.style.height;if(C.style.width&&C.style.height){return }var G=Element.getStyle(C,"display");var D=("none"==G);var F=C.parentNode;if(D){F.removeChild(C);B.appendChild(C);var H=C.style.display;C.style.display="block"}var J=Element.getStyles(C,["width","height","paddingTop","paddingRight","paddingBottom","paddingLeft"]);var I=parseInt(J.width||0,10)-parseFloat(J.paddingLeft||0,10)-parseFloat(J.paddingRight||0,10);var E=parseInt(J.height||0,10)-parseFloat(J.paddingTop||0,10)-parseFloat(J.paddingBottom||0,10);C.style.width=I+"px";C.style.height=E+"px";if(D){C.style.display=H;B.removeChild(C);F.appendChild(C)}},undoFixElementDimensions:function(A){A.style.width=A._originalWidth||"";A.style.height=A._originalHeight||""},swap:function(G,E,D,H,B){E=$(E);D=$(D);this.fixElementDimensions(E);this.fixElementDimensions(D);var F=[].concat(this._setup(G,E,D));if(B){F=F.concat(B)}var A=$(this.config.id);Element.makeClipping(A);Element.makePositioned(A);Element.makePositioned(E,"absolute");Element.makePositioned(D,"absolute");function C(){Element.undoPositioned(D);Element.undoPositioned(E);Element.undoClipping(A);Element.undoPositioned(A);this.undoFixElementDimensions(D);this.undoFixElementDimensions(E);A.style.height="";A.style.width="";if(H){H()}}this.play(F,C.bind(this))},_setup:function(G,E,B){var A=$(this.config.id);var D=A.offsetHeight-parseFloat(Element.getStyle(A,"padding-top")||0)-parseFloat(Element.getStyle(A,"padding-bottom")||0);var C=itgoldenbrigde.fx;G=G||"crossfade";A.style.height=D+"px";var F=[];switch(G){case"fadein":F.push(new C.FadeIn(itgoldenbrigde.fx.linearTween,B));F.push(new C.Hide(null,E));break;case"swapfade":if(E&&B){F.push(new C.FadeOutIn(itgoldenbrigde.fx.linearTween,E,B))}else{if(E){F.push(new C.FadeOut(itgoldenbrigde.fx.linearTween,E))}else{if(B){F.push(new C.FadeIn(itgoldenbrigde.fx.linearTween,B))}}}break;case"left":case"right":F.push(new C.Pan(itgoldenbrigde.fx.easeInOutSine,E,B,G=="left"?-1:1));break;case"up":case"down":F.push(new C.Scroll(itgoldenbrigde.fx.easeInOutSine,E,B,G=="up"?-1:1));break;case"crossfade":default:if(E&&B){F.push(new C.CrossFade2(itgoldenbrigde.fx.linearTween,E,B))}else{if(E){F.push(new C.FadeOut(itgoldenbrigde.fx.linearTween,E))}else{if(B){F.push(new C.FadeIn(itgoldenbrigde.fx.linearTween,B))}}}break}if(E&&B){E.style.zIndex=1;B.style.zIndex=2;F.push(new C.Resize(itgoldenbrigde.fx.easeInOutSine,A,Element.getDimensions(B),Element.getDimensions(E)))}return new itgoldenbrigde.fx.Chain(F)}});itgoldenbrigde.fx.CrossFade=function(A,B){if(!A||A<10){A=this.getDefaultSpeed()}if(!B){B=this.getDefaultIncrement()}this.fadeSpeed=A;this.fadeInc=B;this.fadeStep=0};itgoldenbrigde.fx.CrossFade.DEFAULT_SPEED=8;itgoldenbrigde.fx.CrossFade.DEFAULT_INCREMENT=0.05;itgoldenbrigde.fx.CrossFade.prototype.getDefaultSpeed=function(){return itgoldenbrigde.fx.CrossFade.DEFAULT_SPEED};itgoldenbrigde.fx.CrossFade.prototype.getDefaultIncrement=function(){return itgoldenbrigde.fx.CrossFade.DEFAULT_INCREMENT};itgoldenbrigde.fx.CrossFade.prototype.fade=function(A,C,E){A=[].concat(A);C=[].concat(C);if(this.lastFromObjects){this.stopAnimation();this.lastFromObjects.forEach(Element.hide)}this.lastFromObject=A;this.fadeStep=0;function B(F){Element.setStyles(F,{top:"0px",left:"0px",opacity:1});Element.show(F)}function D(F){Element.setStyles(F,{top:"0px",left:"0px",opacity:0});Element.show(F)}A.forEach(B);C.forEach(D);this._fade(A,C,E)};itgoldenbrigde.fx.CrossFade.prototype.swap=itgoldenbrigde.fx.CrossFade.prototype.fade;function roundToPlaces(C,B){if(!B){return Math.round(C)}var A=Math.pow(10,B);return Math.round(C*A)/A}itgoldenbrigde.fx.CrossFade.prototype._fade=function(B,D,G){this.stopAnimation();this.fadeStep=roundToPlaces(this.fadeStep+this.fadeInc,6);if(this.fadeStep<1){function F(H){return function(I){Element.setOpacity(I,H)}}var A=F(this.fadeStep);var E=F(roundToPlaces(1-this.fadeStep,6));(D||[]).forEach(A);(B||[]).forEach(E);var C=this;this.timer=window.setTimeout(function(){C._fade(B,D,G)},this.fadeSpeed)}else{this._finishFade(B,D,G)}};itgoldenbrigde.fx.CrossFade.prototype._finishFade=function(A,B,D){function C(E){Element.setOpacity(E,1)}this.lastFromObject=null;this.stopAnimation();(A||[]).forEach(Element.hide);(B||[]).forEach(C);if(D){D()}};itgoldenbrigde.fx.CrossFade.prototype.stopAnimation=function(){if(this.timer){window.clearTimeout(this.timer)}};itgoldenbrigde.fx.fadeShow=function(B,E,G,F){B=$(B);var A=Element.getStyle(B,"opacity");if(A<1){E=(1-A)*E}else{Element.setStyle(B,"opacity",0)}Element.show(B);var D=new itgoldenbrigde.fx.Animator({duration:E});var C=new itgoldenbrigde.fx.Fade(B,G,A,1);return{play:function(){D.play(C,F)}}};itgoldenbrigde.fx.fadeHide=function(B,E,H,G){B=$(B);var A=Element.getStyle(B,"opacity");E=A*E;function F(){Element.hide(B);Element.setStyle(B,"opacity",1);if(G){G(B,D)}}var D=new itgoldenbrigde.fx.Animator({duration:E});var C=new itgoldenbrigde.fx.Fade(B,H,A,0);return{play:function(){D.play(C,F)}}};var halfPI=Math.PI/2;var PI=Math.PI;itgoldenbrigde.fx.linearTween=function(A){return A};itgoldenbrigde.fx.easeInSine=function(A){return 1-Math.cos(A*halfPI)};itgoldenbrigde.fx.easeOutSine=function(A){return Math.sin(A*halfPI)};itgoldenbrigde.fx.easeInOutSine=function(A){return(1-Math.cos(A*PI))/2};itgoldenbrigde.fx.easeInBack=function(A,B){if(B==undefined){B=1.70158}return A*A*((B+1)*A-B)};itgoldenbrigde.fx.easeOutBack=function(A,B){if(B==undefined){B=1.70158}A=A-1;return(A*A*((B+1)*A+B)+1)};itgoldenbrigde.fx.easeOutBackStrong=function(A,B){if(B==undefined){B=1.70158*1.5}A=A-1;return(A*A*((B+1)*A+B)+1)};itgoldenbrigde.fx.Chain=function(){var C;if(1==arguments.length&&"function"==typeof (arguments[0])){return arguments[0]}if(1==arguments.length&&arguments[0] instanceof Array){C=arguments[0]}else{C=Array.from(arguments)}C=C.filter(function(J){return null!==J&&"undefined"!=typeof (J)});var F=C.length;var E=0;var B=0;var H=0;var I=[];var G=[];for(var D=0;D<F;++D){G[D]=B;if(!("duration" in C[D])){C[D].duration=1}B+=C[D].duration;I[D]=B}function A(K){if(E==F){return }var J=((K*B)-G[E])/C[E].duration;if(J>1){J=1}C[E](J);if(J<1){return }if("finish" in C[E]){C[E].finish(J)}E++;if(E==F){return }if("setup" in C[E]){C[E].setup()}A(K)}A.setup=function(){E=0;if("setup" in C[E]){C[E].setup()}};A.finish=function(J){};return A};itgoldenbrigde.fx.Blend=function(){var D;if(1==arguments.length&&"function"==typeof (arguments[0])){return arguments[0]}if(1==arguments.length&&arguments[0] instanceof Array){D=arguments[0]}else{D=Array.from(arguments)}D=D.filter(function(E){return null!==E&&"undefined"!=typeof (E)});var A=D.length;var C;function B(E){for(C=0;C<A;++C){D[C](E)}}B.setup=function(){for(C=0;C<A;++C){if("setup" in D[C]){D[C].setup()}}};B.finish=function(E){for(C=0;C<A;++C){if("finish" in D[C]){D[C].finish(E)}}};return B};itgoldenbrigde.fx.AdjustCurve=function(B,A,E){A=A||0;E=E||1;if(0===A&&1===E){return B}var C=E-A;var D=A/C;return function(F){return B(Math.min(1,F/C-D))}};itgoldenbrigde.fx.Fade=function(C,B,G,F){var E=F-G;var D=(0===F)?["","none"]:["none",""];function A(H){Element.setOpacity(B,G+E*C(H))}A.setup=function(){Element.setOpacity(B,G);B.style.display=""};A.finish=function(H){H=H?1:0;B.style.display=D[H];Element.setOpacity(B,H?F:G)};return A};itgoldenbrigde.fx.FadeIn=function(B,A){return itgoldenbrigde.fx.Fade(B,A,0,1)};itgoldenbrigde.fx.FadeOut=function(B,A){return itgoldenbrigde.fx.Fade(B,A,1,0)};itgoldenbrigde.fx.CrossFade2=function(F,D,C){var B;var E;function A(G){Element.setOpacity(D,F(1-G));Element.setOpacity(C,F(G))}A.setup=function(){B=Element.getStyle(D,"position");E=Element.getStyle(C,"position");D.style.display="";Element.setOpacity(D,1);D.style.position="absolute";Element.setOpacity(C,0);C.style.display="";C.style.position="absolute"};A.finish=function(G){C.style.display=(G?"":"none");Element.setOpacity(C,1);D.style.display=(G?"none":"");Element.setOpacity(D,1);C.style.position=E;D.style.position=B};return A};itgoldenbrigde.fx.FadeOutIn=function(D,C,B){function A(E){E*=2;if(E<=1){Element.setOpacity(C,D(1-E));Element.setOpacity(B,0)}else{Element.setOpacity(C,0);Element.setOpacity(B,D(E-1))}}A.setup=function(){C.style.display="";Element.setOpacity(C,1);Element.setOpacity(B,0);B.style.display=""};A.finish=function(E){B.style.display=(E?"":"none");Element.setOpacity(B,1);C.style.display=(E?"none":"");Element.setOpacity(C,1)};return A};itgoldenbrigde.fx.Pan=function(H,F,E,G){var D=F.offsetWidth;G=G||1;var C=((G>0)?-D:D);var B=G*D;function A(I){var J=Math.round(B*H(I));F.style.left=J+"px";E.style.left=C+J+"px"}A.setup=function(){F.style.display="";E.style.left=C+"px";E.style.display=""};A.finish=function(I){if(1==I){F.style.display="none";F.style.left="0"}};return A};itgoldenbrigde.fx.Scroll=function(H,F,D,G){var A=F.offsetHeight;G=G||1;var C=((G>0)?-A:A);var E=G*A;function B(I){var J=Math.round(E*H(I));F.style.top=J+"px";D.style.top=C+J+"px"}B.setup=function(){F.style.display="";D.style.top=C+"px";D.style.display=""};B.finish=function(I){if(1==I){F.style.display="none";F.style.top="0"}};return B};itgoldenbrigde.fx.MoveBy=function(F,D,H){var C=H.x||H.left||0;var A=H.y||H.top||0;var E;var G;function B(I){var J=F(I);D.style.left=E+Math.round(C*J)+"px";D.style.top=G+Math.round(A*J)+"px"}B.setup=function(){E=parseFloat(Element.getStyle(D,"left")||0);G=parseFloat(Element.getStyle(D,"top")||0)};return B};itgoldenbrigde.fx.MoveTo=function(F,D,H){var C;var A;var E;var G;function B(I){var J=F(I);D.style.left=E+Math.round(C*J)+"px";D.style.top=G+Math.round(A*J)+"px"}B.setup=function(){E=parseFloat(Element.getStyle(D,"left")||0);G=parseFloat(Element.getStyle(D,"top")||0);if("x" in H||"left" in H){C=(H.x||H.left)-E}else{C=0}if("y" in H||"top" in H){A=(H.y||H.top)-G}else{A=0}};return B};itgoldenbrigde.fx.Move=function(B,C,H,I){var F;var D;var G;var E;function A(J){var K=B(J);C.style.left=G+Math.round(F*K)+"px";C.style.top=E+Math.round(D*K)+"px"}A.setup=function(){if("x" in H||"left" in H){G=(H.x||H.left)}else{G=parseFloat(Element.getStyle(C,"left")||0)}if("y" in H||"top" in H){G=(H.y||H.top)}else{E=parseFloat(Element.getStyle(C,"top")||0)}if("x" in I||"left" in I){F=(I.x||I.left)-G}else{F=0}if("y" in I||"top" in I){D=(I.y||I.top)-E}else{D=0}};return A};itgoldenbrigde.fx.FadeInBackgroundImage=function(F,B,E){var D=Element.assignId(B);var C=document.getElementById(D+"_fadingBackgroundImage");if("url("!=E.substr(0,4).toLowerCase()){E="url("+E+")"}if(!C){C=document.createElement("div");C.id=D+"_fadingBackgroundImage";C.style.display="none";C.style.position="absolute";C.style.top="0";C.style.left="0";C.style.zIndex="0";B.insertBefore(C,B.firstChild)}C.style.backgroundImage=E;function A(G){Element.setOpacity(C,F(G))}A.setup=function(){Element.makePositioned(B);Element.makeClipping(B);C.style.backgroundPosition=Element.getStyle(B,"backgroundPosition");C.style.backgroundRepeat=Element.getStyle(B,"backgroundRepeat");C.style.width=B.offsetWidth+"px";C.style.height=B.offsetHeight+"px";Element.setOpacity(C,0);C.style.display=""};A.finish=function(H){function G(){C.style.display="none";Element.setOpacity(C,1);Element.undoPositioned(B);Element.undoClipping(B)}window.setTimeout(G,10)};return A};itgoldenbrigde.fx.SetClassName=function(D,C,B){function A(E){C.className=B}A.duration=0;return A};itgoldenbrigde.fx.SetInnerHTML=function(C,B,D){function A(E){B.innerHTML=D}A.duration=0;return A};itgoldenbrigde.fx.SetInnerText=function(D,B,C){function A(E){var F=document.createTextNode(C);B.innerHTML="";B.appendChild(F)}A.duration=0;return A};itgoldenbrigde.fx.Resize=function(D,C,B,F){var E=null;function A(G){var H=C.style;G=D(G);H.height=Math.round(G*E.height+F.height)+"px";H.width=Math.round(G*E.width+F.width)+"px"}A.setup=function(){Element.makeClipping(C);if(!F){F=Element.getDimensions(C)}E={width:B.width-F.width,height:B.height-F.height}};A.finish=function(H){var G=C.style;if(H){G.height=Math.round(B.height)+"px";G.width=Math.round(B.width)+"px"}else{G.height=Math.round(F.height)+"px";G.width=Math.round(F.width)+"px"}Element.undoClipping(C)};return A};itgoldenbrigde.fx.Morph=function(F,E,D,H){var G=null;var A=true;var C=true;function B(I){var J=E.style;I=F(I);if(A){J.left=Math.round(I*G.left+H.left)+"px";J.top=Math.round(I*G.top+H.top)+"px"}if(C){J.height=Math.round(I*G.height+H.height)+"px";J.width=Math.round(I*G.width+H.width)+"px"}}B.setup=function(){if(!H){H=Element.getDimensions(E)}var I=Element.getPadding(E);A=("left" in D&&"left" in H&&"top" in D&&"top" in H);C=("width" in D&&"width" in H&&"height" in D&&"height" in H);G={left:D.left-H.left-I.left,top:D.top-H.top-I.top,width:D.width-H.width-I.left-I.right,height:D.height-H.height-I.top-I.bottom}};B.finish=function(J){var I=E.style;if(J){if(A){I.top=Math.round(D.top)+"px";I.left=Math.round(D.left)+"px"}if(C){I.height=Math.round(D.height)+"px";I.width=Math.round(D.width)+"px"}}else{if(A){I.top=Math.round(H.top)+"px";I.left=Math.round(H.left)+"px"}if(C){I.height=Math.round(H.height)+"px";I.width=Math.round(H.width)+"px"}}};return B};itgoldenbrigde.fx.Hide=function(C,B){function A(D){}A.finish=function(D){B.style.display=D?"none":""};return A};itgoldenbrigde.fx.ResizeImage=function(D,C,B,F){var E=null;function A(H){var J=C.style;var I;var G;H=D(H);J.height=(I=Math.round(H*E.height+F.height))+"px";J.width=(G=Math.round(H*E.width+F.width))+"px";C.width=G;C.height=I}A.setup=function(){if(!F){F=Element.getDimensions(C)}E={width:B.width-F.width-(parseFloat(Element.getStyle(C,"padding-left"))||0)-(parseFloat(Element.getStyle(C,"padding-right"))||0),height:B.height-F.height-(parseFloat(Element.getStyle(C,"padding-top"))||0)-(parseFloat(Element.getStyle(C,"padding-bottom"))||0)}};A.finish=function(K){var G;var I;var H=C.style;var J=K?B:F;H.height=(I=Math.round(J.height))+"px";H.width=(G=Math.round(J.width))+"px";C.height=I;C.width=G};return A};itgoldenbrigde.fx.ColourRgbRegex=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;itgoldenbrigde.fx.ColourHexRegex=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;itgoldenbrigde.fx.ChangeColour=function(E,F,C,H,B){var I;function D(K){var L=K.match(itgoldenbrigde.fx.ColourRgbRegex);if(L){return[Math.clamp(parseInt(L[1],10),0,255),Math.clamp(parseInt(L[2],10),0,255),Math.clamp(parseInt(L[3],10),0,255)]}L=K.match(itgoldenbrigde.fx.ColourHexRegex);if(L){var O=L[1];var N;var M;var J;if(3==O.length){N=O.charAt(0)+O.charAt(0);M=O.charAt(1)+O.charAt(1);J=O.charAt(2)+O.charAt(2)}else{N=O.slice(0,2);M=O.slice(2,4);J=O.slice(4,6)}return[Math.clamp(parseInt(N,16),0,255),Math.clamp(parseInt(M,16),0,255),Math.clamp(parseInt(J,16),0,255)]}throw new Error("Invalid colour string: "+K)}function G(J){J=Math.round(Math.clamp(J,0,255));if(J<16){return"0"+J.toString(16)}else{return J.toString(16)}}function A(J){J=E(J);var K=["#",G(B[0]+I[0]*J),G(B[1]+I[1]*J),G(B[2]+I[2]*J)].join("");F.style[C]=K}A.setup=function(){B=D(B||Element.getStyle(F,C));H=D(H);I=[H[0]-B[0],H[1]-B[1],H[2]-B[2]]};return A};itgoldenbrigde.fx.ChangeColor=itgoldenbrigde.fx.ChangeColour;itgoldenbrigde.fx.Morph=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS)};itgoldenbrigde.fx.Morph.prototype.DEFAULTS={duration:500,frameDelay:25,callback:function(){},style:{},easing:function(A){return 0.5+Math.sin((A+1.5)*Math.PI)/2}};itgoldenbrigde.fx.Morph.prototype.start=function(A){if(this._timer){return }var B=$(this.config.element);if(!B){return }if(A){this.config=Object.applyDefaults(A,this.DEFAULTS)}this._animator=this.animate.bind(this);this._now=0;this._start=Object.applyDefaults(Element.position(B,true),Element.getDimensions(B));this._start.opacity=Element.getStyle(B,"opacity");var C=Element.position(B.parentNode,true);this._start.top-=C.top;this._start.left-=C.left;this._delta={};for(var D in this.config.style){this._delta[D]=this.config.style[D]-this._start[D];if(!this._delta[D]){delete this._delta[D]}}this._timer=window.setTimeout(this._animator,this.config.frameDelay)};itgoldenbrigde.fx.Morph.prototype.stop=function(){if(!this._timer){return }window.clearTimeout(this._timer);this._timer=0;this._animator=null};itgoldenbrigde.fx.Morph.prototype.animate=function(){var A;var B=$(this.config.element);if(!B){return }this._now+=this.config.frameDelay;for(var C in this._delta){A=this.config.easing(this._now/this.config.duration)*this._delta[C]+this._start[C];if("opacity"==C){Element.setStyle(B,"opacity",A)}else{B.style[C]=A+"px"}}if(this._now>=this.config.duration){if(this.config.callback){this.config.callback()}return }this._timer=window.setTimeout(this._animator,this.config.frameDelay)};itgoldenbrigde.fx.SwapFade=function(A){this.duration=A||200;this._timer=null};itgoldenbrigde.fx.SwapFade.prototype._stopAnimation=function(){window.clearTimeout(this._timer);this._timer=null};itgoldenbrigde.fx.SwapFade.prototype.swap=function(F,L,M){this._stopAnimation();var E=10;var C=0;var H=this.duration;var D=H/2;var B=false;function K(N){Element.setStyle(N,"top","0px");Element.setStyle(N,"left","0px");Element.setOpacity(N,1);Element.show(N)}function A(N){Element.setStyle(N,"top","0px");Element.setStyle(N,"left","0px");Element.setOpacity(N,0);Element.show(N)}function J(N){Element.hide(N);Element.setOpacity(N,1)}F.forEach(K);L.forEach(A);function I(){C+=E;function N(O){if(O<0){O=0}else{if(O>1){O=1}}O=Math.round(O*100)/100;return function(P){Element.setOpacity(P,O)}}if(C<D){F.forEach(N(1-C/D))}else{if(!B){B=true;F.forEach(J)}L.forEach(N((C-D)/D))}if(C>H){L.forEach(N(1));this._timer=null;if(M){M()}return }this._timer=window.setTimeout(G,E)}var G=I.bind(this);this._timer=window.setTimeout(G,E)};itgoldenbrigde.fx.Swoosh=function(C,B,A){this.viewerId=C;if(!B){B=itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_SPEED}if(!A){A=itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_INCREMENT}this.panSpeed=B;this.panIncrement=A};itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_SPEED=20;itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_INCREMENT=40;itgoldenbrigde.fx.Swoosh.prototype.getDefaultSpeed=function(){return itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_SPEED};itgoldenbrigde.fx.Swoosh.prototype.getDefaultIncrement=function(){return itgoldenbrigde.fx.Swoosh.DEFAULT_PAN_INCREMENT};itgoldenbrigde.fx.Swoosh.prototype.getViewer=function(){return $(this.viewerId)};itgoldenbrigde.fx.Swoosh.prototype.pan=function(A,D,C,E){if(this.lastFromObject){this.stopAnimation();Element.hide(this.lastFromObject)}this.lastFromObject=D;var B=this.getViewWidth();Element.setStyles(D,{top:"0px",left:"0px"});Element.setStyles(C,{top:"0px",left:(A?B:-B)+"px"});Element.show(D);Element.show(C);this._pan(Math.PI,B,A,D,C,E)};itgoldenbrigde.fx.Swoosh.prototype.getViewWidth=function(){return parseInt(Element.getStyle(this.getViewer(),"width"),10)};itgoldenbrigde.fx.Swoosh.prototype._pan=function(G,D,C,F,E,H){this.stopAnimation();G+=Math.PI/this.panIncrement;if(G<=(2*Math.PI)){var A=Math.floor((D/2)*(1+Math.cos(G)));if(C){A=-A}Element.setStyle(F,"left",A+"px");Element.setStyle(E,"left",(A+(C?D:-D))+"px");var B=this;this.timer=window.setTimeout(function(){B._pan(G,D,C,F,E,H)},this.panSpeed)}else{this._finishPan(F,E,H)}};itgoldenbrigde.fx.Swoosh.prototype._finishPan=function(B,A,C){this.lastFromObject=null;this.stopAnimation();Element.hide(B);if(C){C()}};itgoldenbrigde.fx.Swoosh.prototype.stopAnimation=function(){if(this.timer){window.clearTimeout(this.timer);this.timer=null}};itgoldenbrigde.metrics.Metrics=function(A){this.config=A;this.cookieProps=Object.applyDefaults({},itgoldenbrigde.metrics.Metrics.CONSTANTS.cookieDefaults);this.metrics=this.getObjectCookie()||{};this.initStore()};itgoldenbrigde.metrics.Metrics.CONSTANTS={cookieDefaults:{name:"asmetrics",path:"/",domain:window.location.host,expires:0.0208333333,secure:false}};itgoldenbrigde.metrics.Metrics.prototype.setObjectCookie=function(A){itgoldenbrigde.cookie.objectCookie(this.cookieProps.name,A,this.cookieProps)};itgoldenbrigde.metrics.Metrics.prototype.getObjectCookie=function(){return itgoldenbrigde.cookie.objectCookie(this.cookieProps.name)};itgoldenbrigde.metrics.Metrics.prototype.pageName=function(A){return A+(this.pageSuffix()||"")};itgoldenbrigde.metrics.Metrics.prototype.mark=function(){if(this.config.isHome){this.getStore().vh=true}this.setObjectCookie(this.metrics)};itgoldenbrigde.metrics.Metrics.prototype.hasReturnedHome=function(){return this.getStore().vh};itgoldenbrigde.metrics.Metrics.prototype.pageSuffix=function(){if(this.config.isHome){return" - "+(this.hasReturnedHome()?"Return":"First")}else{return null}};itgoldenbrigde.metrics.Metrics.prototype.getStore=function(){if(!this.metrics.store){this.initStore()}return this.metrics.store};itgoldenbrigde.metrics.Metrics.prototype.initStore=function(){var A=this.metrics.store;if(A&&A.sid!=this.config.storeId){A=null}if(!A){A={sid:this.config.storeId};this.metrics.store=A}return A};itgoldenbrigde.metrics.Metrics.reportCustomLink=function(F,E){var C=window.s;if(!C){return }try{var D=C.linkTrackVars;var B=C.linkTrackEvents;var A=C.eVar5;C.linkTrackVars="eVar5";C.linkTrackEvents="None";C.eVar5=E;C.tl(F,"o",itgoldenbrigde.metrics.Metrics.getCustomLinkName(E))}finally{C.linkTrackVars=D;C.linkTrackEvents=B;C.eVar5=A}};itgoldenbrigde.metrics.Metrics.getCustomLinkName=function(B){var A=B.split("|");if(A.length<=4){return B}return B.substring(B.indexOf(A[2]))};itgoldenbrigde.metrics.Metrics.fireEvent=function(A){var D=window.s||null;var C={};var B;if(!D){return }for(B in A){C[B]=D[B];D[B]=A[B]}D.t();for(B in A){D[B]=C[B]}};itgoldenbrigde.io.json.invoke=function(C){var A=null;var E=C.preventCache||false;var F=C.sync||false;var B=C.method||"get";function G(J){var L;if(J.head&&J.head.data&&J.head.data.metrics){L=J.head.data.metrics}else{if(J.body&&J.body.metrics){L=J.body.metrics;delete J.body.metrics}}if(!L&&!C.metrics){return }var K=Object.extend(C.metrics||{},L);itgoldenbrigde.metrics.Metrics.fireEvent(K)}function I(J){if(itgoldenbrigde.io.json.isRedirect(J)){if(C.redirect){C.redirect(J)}itgoldenbrigde.io.json.redirect(J);return }if(itgoldenbrigde.io.json.hasErrors(J)){if(C.error){C.error(J)}return }G(J);if(J.preScript){coherent.Scripts.install(J.preScript)}if(C.success){C.success(J)}if(J.postScript){coherent.Scripts.install(J.postScript)}itgoldenbrigde.io.json.evaluateScriptKeys(J.body,C.scriptKeys)}function H(J){if(C.error){C.error(J)}}try{A=XHR.request(B,C.url,C.urlArgs,{sync:F,responseContentType:"application/json"});A.addMethods(I,H)}catch(D){if(C.error){C.error(D)}}return A};itgoldenbrigde.io.json.redirect=function(B){var A=B.head.data;if(A&&A.url){if("post"==A.method){itgoldenbrigde.io.json.issuePostRedirect(A.url,A.args)}else{itgoldenbrigde.io.json.issueGetRedirect(A.url,A.args)}}};itgoldenbrigde.io.json.issuePostRedirect=function(C,B){if(C){var E=document.createElement("form");E.action=C;E.method="post";var F;var A;var G={};function D(J,I,K){var H=document.createElement("input");J.appendChild(H);H.type="hidden";H.name=I;H.value=K}for(F in B){A=B[F];if(B[F]===G[F]){continue}if(A instanceof Array){A.forEach(function(H){D(E,F,H)})}else{D(E,F,A)}}E.style.position="absolute";E.style.visibility="hidden";E.style.height="0px";E.style.width="0px";document.body.appendChild(E);E.submit()}};itgoldenbrigde.io.json.issueGetRedirect=function(B,A){if(B){var C=null;if(A){C=Object.toQueryString(A)}if(C){if(B.indexOf("?")<0){B+="?"+C}else{B+=C}}window.open(B,"_top")}};itgoldenbrigde.io.json.isRedirect=function(D){var A=false;try{if(D){var B=parseInt(D.head.status,10);switch(B){case 301:case 302:case 303:case 304:case 305:case 306:case 307:A=true;break;default:break}}}catch(C){}return A};itgoldenbrigde.io.json.hasErrors=function(D){var A=false;try{if(D){var B=parseInt(D.head.status,10);if(B==200){A=false}else{if(B>=400&&B<600){A=true}}}else{A=true}}catch(C){}return A};itgoldenbrigde.io.json.evaluateScriptKeys=function(D,C){if(D&&C){for(var B=0;B<C.length;B++){var E=D[C[B]];if(E){var A=coherent.Scripts.extract(E).scripts;coherent.Scripts.install(A)}}}};itgoldenbrigde.io.json.createSimpleJsonMsg=function(A){var B={head:{status:"200"},body:{content:A}};return B};itgoldenbrigde.widget.AlternateProductsUpdater=function(A){this.config=A||{};Object.applyDefaults(this.config,itgoldenbrigde.widget.AlternateProductsUpdater.DEFAULTS);Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.AlternateProductsUpdater.DEFAULTS={priceId:"price",shippingId:"shipping",priceClass:"price",shippingClass:"availability",labelSuffix:"-label"};itgoldenbrigde.widget.AlternateProductsUpdater.prototype.init=function(){var B=document.getElementById(this.config.elementId);if(!B){return }var C=B.getElementsByTagName("label");if(!C){return }var D=this.selectProduct.bindAsEventListener(this);function A(G){var E=G.htmlFor;G.id=E+this.config.labelSuffix;var F=document.getElementById(E);Event.observe(F,"click",D)}Array.forEach(C,A,this)};itgoldenbrigde.widget.AlternateProductsUpdater.prototype.selectProduct=function(A){var B=(A.srcElement||A.target);this.updateSelectedProduct(B)};itgoldenbrigde.widget.AlternateProductsUpdater.prototype.updateSelectedProduct=function(F){var B=document.getElementById(F.id+this.config.labelSuffix);if(!B){return }var E=document.getElementById(this.config.priceId);var A=document.getElementById(this.config.shippingId);var C=Element.getElementsByClassName(this.config.priceClass,B);var D=Element.getElementsByClassName(this.config.shippingClass,B);if(E&&C&&C.length>0){E.innerHTML=C[0].innerHTML}if(A&&D&&D.length>0){A.innerHTML=D[0].innerHTML}};itgoldenbrigde.widget.AnimatedTextWidget=Class.create(coherent.View,{__viewClassName__:"itgoldenbrigde.AnimatedText",animated:true,init:function(){this._animated=("true"==(String(this.attributeOrProperty("animated"))||"").toLowerCase());this.base()},observeVisibleChange:function(H,J,C){var G=this.viewElement();var A={width:G.scrollWidth,height:G.scrollHeight};var F;var I;var E=("none"!==Element.getStyle(G,"display"));var B=!!H.newValue;var D=(parseFloat(Element.getStyle(G,"padding-top"))||0)+(parseFloat(Element.getStyle(G,"padding-bottom"))||0);if(B===E){return }Element.makeClipping(G);if(H.newValue){G.style.height="0px";G.style.display="";coherent.Animator.setStyles(G,{height:G.scrollHeight-D},{duration:300,curve:coherent.easing.inOutSine,callback:function(){G.style.height="";Element.undoClipping(G)}})}else{G.style.height=(G.scrollHeight-D)+"px";coherent.Animator.setStyles(G,{height:0},{duration:300,curve:coherent.easing.inOutSine,callback:function(){G.style.display="none";G.style.height="";Element.undoClipping(G)}})}},observeTextChange:function(F,E,B){var A=this.viewElement();var C=this.translateValue(F.newValue);if(!this._animated||"none"===Element.getStyle(A,"display")){var D=document.createTextNode(C);A.innerHTML="";A.appendChild(D);return }if(C===A.innerText){return }coherent.Animator.innerText(A,C,300)},observeHtmlChange:function(F,E,B){var A=this.viewElement();var C=this.translateValue(F.newValue);if(!this._animated||"none"===Element.getStyle(A,"display")){if(C!==F.newValue){var D=document.createTextNode(C);A.innerHTML="";A.appendChild(D);return }A.innerHTML=C;return }if(C!=F.newValue){this.observeTextChange(F,E,B);return }if(C.trim()===String(A.innerHTML).trim()){return }coherent.Animator.innerHTML(A,C,300)}});itgoldenbrigde.widget.AutoCompleter=function(A,C,B){this.country=C;this.field=B;this.cur=-1;this.layer=null;this.textbox=A;this.init()};Object.extend(itgoldenbrigde.widget.AutoCompleter.prototype,{init:function(){var A=this;this.textbox.onkeyup=function(B){if(!B){B=window.event}A.handleKeyUp(B)};this.textbox.onkeydown=function(B){if(!B){B=window.event}A.handleKeyDown(B)};this.textbox.onblur=function(){A.hideSuggestions()};this.createDropDown()},autosuggest:function(B,A){if(B.length>0){if(A){this.typeAhead(B[0])}this.showSuggestions(B)}else{this.hideSuggestions()}},createDropDown:function(){var C=this;this.layer=document.createElement("div");this.layer.className="AutoCompleterResults";if(coherent.Browser.Safari){var A=/WebKit\/(\d+(?:\.\d+)?)/;var B=A.exec(navigator.userAgent);if(B&&parseInt(B[1],10)>=523){this.layer.className+=" capable"}}this.layer.style.visibility="hidden";this.layer.style.left="-5000px";this.layer.style.top="0px";this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(E){E=E||window.event;var D=E.target||E.srcElement;if(E.type=="mousedown"){var F=D.firstChild.nodeValue;if(F!==null){C.textbox.value=D.firstChild.nodeValue;C.hideSuggestions()}}else{if(E.type=="mouseover"){C.highlightSuggestion(D)}else{C.textbox.focus()}}};document.body.appendChild(this.layer)},handleKeyDown:function(A){switch(A.keyCode){case 38:this.previousSuggestion();return ;case 40:this.nextSuggestion();return ;case 13:this.cancelEvent(A);this.hideSuggestions();return ;case 27:this.hideSuggestions();return ;default:return }},cancelEvent:function(A){A.cancelBubble=true;A.returnValue=false;if(A.stopPropagation){A.stopPropagation();A.preventDefault()}},handleKeyUp:function(A){var C=A.keyCode;var B;if(C==8||C==46){this.autosuggest(this.search(this.textbox.value),false)}else{if(C<32||(C>=33&&C<46)||(C>=112&&C<=123)){return }else{this.autosuggest(this.search(this.textbox.value),true)}}},showSuggestions:function(G){var A=Element.position(this.textbox);this.layer.style.top=(A.top+this.textbox.offsetHeight)+"px";this.layer.style.left=(A.left+this.textbox.offsetWidth/2)+"px";this.layer.style.width="";var F=null;this.layer.innerHTML="";var H=document.createElement("div");H.className="top";H.innerHTML='<span class="left"></span><span class="right"></span>';var D=document.createElement("div");D.className="middle";var C=document.createElement("div");C.className="bottom";C.innerHTML='<span class="left"></span><span class="right"></span>';var B=document.createElement("ul");for(var E=0;E<G.length;E++){F=document.createElement("li");F.appendChild(document.createTextNode(G[E]));B.appendChild(F)}D.appendChild(B);this.layer.appendChild(H);this.layer.appendChild(D);this.layer.appendChild(C);this.layer.style.visibility="visible";this.layer.style.width=D.offsetWidth+"px";this.layer.style.marginLeft=-0.5*this.layer.offsetWidth+"px"},hideSuggestions:function(){this.layer.style.visibility="hidden"},highlightSuggestion:function(B){var A=this.layer.getElementsByTagName("li");for(var C=0;C<A.length;C++){A[C].className=A[C]==B?"selected":""}},nextSuggestion:function(){var B=this.layer.getElementsByTagName("li");if(B.length>0&&this.cur<B.length-1){var A=B[++this.cur];this.highlightSuggestion(A);this.textbox.value=A.firstChild.nodeValue}},previousSuggestion:function(){var B=this.layer.getElementsByTagName("li");if(B.length>0&&this.cur>0){var A=B[--this.cur];this.highlightSuggestion(A);this.textbox.value=A.firstChild.nodeValue}},selectRange:function(A,B){if(this.textbox.createTextRange){var C=this.textbox.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-this.textbox.value.length);C.select()}else{if(this.textbox.setSelectionRange){this.textbox.setSelectionRange(A,B)}}},search:function(E){var D=[];var A=itgoldenbrigde.widget.AutoCompleter.data[this.country][this.field];if(E.length>0){E=E.toUpperCase()+" ";while(E.length>1&&D.length===0){E=E.substring(0,E.length-1);var B=A[E.substring(0,1)];if(B){for(var C=0;C<B.length;C++){if(B[C].indexOf(E)===0){D.push(B[C])}}}}}return D},typeAhead:function(B){if(this.textbox.createTextRange||this.textbox.setSelectionRange){if(B&&this.textbox.value&&B.indexOf(this.textbox.value)===0){var A=this.textbox.value.length;this.textbox.value=B;this.selectRange(A,B.length)}}}});itgoldenbrigde.widget.AutoCompleter.requestURL="";itgoldenbrigde.widget.AutoCompleter.requestParams={};itgoldenbrigde.widget.AutoCompleter.willRequest=false;itgoldenbrigde.widget.AutoCompleter.requestTimer=null;itgoldenbrigde.widget.AutoCompleter.requestCallback=null;itgoldenbrigde.widget.AutoCompleter.data=null;itgoldenbrigde.widget.AutoCompleter.registerInput=function(A,D,C){itgoldenbrigde.widget.AutoCompleter.willRequest=true;var B=itgoldenbrigde.widget.AutoCompleter.requestParams;if(!(D in B)){B[D]={}}if(!(C in B[D])){B[D][C]=[]}B[D][C].push(A)};itgoldenbrigde.widget.AutoCompleter.requestData=function(){if(itgoldenbrigde.widget.AutoCompleter.willRequest===false){return }var C={p:"itgoldenbrigde.widget.AutoCompleter.processData"};for(var G in itgoldenbrigde.widget.AutoCompleter.requestParams){if(!(G in C)){C[G]=[]}for(var E in itgoldenbrigde.widget.AutoCompleter.requestParams[G]){C[G].push(E)}}var B=itgoldenbrigde.widget.AutoCompleter.requestURL;var F=(B.indexOf("?")!=-1)?"&":"?";B+=F+Object.toQueryString(C);var A=document.createElement("script");A.src=B;function D(){itgoldenbrigde.widget.AutoCompleter.requestCallback=function(){}}itgoldenbrigde.widget.AutoCompleter.requestCallback=function(H){window.clearTimeout(itgoldenbrigde.widget.AutoCompleter.requestTimer);itgoldenbrigde.widget.AutoCompleter.requestTimer=null;itgoldenbrigde.widget.AutoCompleter.processData(H)};itgoldenbrigde.widget.AutoCompleter.requestTimer=window.setTimeout(D,10000);document.getElementsByTagName("HEAD")[0].appendChild(A)};itgoldenbrigde.widget.AutoCompleter.processData=function(C){itgoldenbrigde.widget.AutoCompleter.data=C;var D=itgoldenbrigde.widget.AutoCompleter.requestParams;for(var E in D){for(var B in D[E]){for(var A=0;A<D[E][B].length;A++){itgoldenbrigde.widget.AutoCompleter.create(D[E][B][A],E,B)}}}};itgoldenbrigde.widget.AutoCompleter.create=function(E,D,C){var B=itgoldenbrigde.widget.AutoCompleter.data;var A=document.getElementById(E);if(A){if(A.setAttribute){A.setAttribute("AUTOCOMPLETE","off")}new itgoldenbrigde.widget.AutoCompleter(A,D,C)}};Event.onDomReady(itgoldenbrigde.widget.AutoCompleter.requestData);function _makePartFinder(F){var A=F.length;if(1==A){var E=F[0];function G(){return[document.getElementById(E)]}G.single=function(I){return document.getElementById(E)};G.isPart=function(I){return I.id==E};return G}var C=undefined;function B(){C={};for(var I=0;I<A;++I){C[F[I]]=true}}function H(I){return I.id in C}function D(){var I=[];for(var J=0;J<A;++J){I.push(document.getElementById(F[J]))}return I}D.single=function(I){return document.getElementById(F[I])};D.isPart=function(I){B();this.isPart=H;return H(I)};return D}itgoldenbrigde.widget.BaseWidget=function(B,A){if(1==arguments.length){A=B||{}}else{A=A||{};if("string"!=typeof (B)){A.id=Element.assignId(B)}else{A.id=B||A.id}}this._partCache={};this._widgetId=A.id;this.setConfig(A);Event.onDomReady(this.init.bind(this))};Class.extend(itgoldenbrigde.widget.BaseWidget,{setConfig:function(B){for(var A=this.constructor;A&&Object!==A;A=A.superclass){Object.applyDefaults(B,A.DEFAULTS||{})}this.config=B},init:function(){},widget:function(){return document.getElementById(this._widgetId)},observeParts:function(B,E,D){var F=this.parts(B);var A=F.length;var C;for(C=0;C<A;++C){Event.observe(F[C],E,D)}},observePart:function(A,D,C){var B=this.part(A);Event.observe(B,D,C)},stopObservingParts:function(B,E,D){var F=this.parts(B);var A=F.length;var C;for(C=0;C<A;++C){Event.stopObserving(F[C],E,D)}},isPart:function(A,B){if(!(A in this._partCache)){this.parts(A)}return this._partCache[A].isPart(B)},part:function(A,B){B=B||0;if(A in this._partCache){return this._partCache[A].single(B)}return this.parts(A)[B]},parts:function(I){if(I in this._partCache){return this._partCache[I]()}var F=this.widget();var K=I.split(".");var B;var H;var A=[];var E;if(0===K.length||2<K.length){return[]}if(1==K.length){B=F.getElementsByTagName(K[0]);H=A.length=B.length;for(E=0;E<H;++E){A[E]=Element.assignId(B[E])}}else{var J=[];var G=0;var C=new RegExp("(?:^|\\s+)"+K[1]+"(?:\\s+|$)");B=F.getElementsByTagName(K[0]||"*");H=J.length=A.length=B.length;for(E=0;E<H;++E){var D=B[E];if(!C.test(D.className)){continue}A[G]=Element.assignId(D);J[G]=D;++G}A.length=G;J.length=G;B=J}this._partCache[I]=_makePartFinder(A);return Array.from(B)}});itgoldenbrigde.widget.ContentSwitcher=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS);this._activateTimer=null;Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.ContentSwitcher.STYLE={switchOnClick:0,switchOnHover:1};itgoldenbrigde.widget.ContentSwitcher.prototype.nodesById=function(A){switch(typeof (A)){case"string":return[$(A)];case"undefined":return[];default:if(A instanceof Array){return A.map($)}if(!A){return[]}return[A]}};itgoldenbrigde.widget.ContentSwitcher.prototype.DEFAULTS={hoverDelay:200,activeContentClass:"active",inactiveContentClass:"inactive",activeButtonClass:"active",inactiveButtonClass:"inactive",style:itgoldenbrigde.widget.ContentSwitcher.STYLE.switchOnClick,transition:{swap:function(D,B,E){D=[].concat(D);B=[].concat(B);function C(F){F.style.display="none"}function A(F){F.style.display=""}D.forEach(C);B.forEach(A);if(E){E()}}}};itgoldenbrigde.widget.ContentSwitcher.prototype.init=function(){var H=itgoldenbrigde.widget.ContentSwitcher.STYLE;var F=H.switchOnHover==(this.config.style&H.switchOnHover);var C=this.mouseOverButton.bindAsEventListener(this);var I=this.mouseOutButton.bindAsEventListener(this);var G=this.buttonClicked.bindAsEventListener(this);for(var B in this.config.buttons){var D=$(B);var E=this.config.buttons[B];if("string"==typeof (E)){this.config.buttons[B]=E.split(/\s*,\s*/g)}if(!D){continue}if(F){Event.observe(D,"mouseover",C);Event.observe(D,"mouseover",C);Event.observe(D,"mouseout",I);Event.observe(D,"click",Event.stop)}else{Event.observe(D,"click",G)}}this._activeButtonId=this.findInitialActiveButton();this._activeContentIds=this.config.buttons[this._activeButtonId]||[this.overviewId];this._initialActiveButton=this._activeButtonId;this._initialActiveContentIds=this._activeContentIds;if(!this.config.containerId){return }var A=$(this.config.containerId);Event.observe(A,"mouseout",this.mouseOutContainer.bindAsEventListener(this));Event.observe(A,"mouseover",this.mouseOverContainer.bindAsEventListener(this))};itgoldenbrigde.widget.ContentSwitcher.prototype.findInitialActiveButton=function(){if(this.config.overviewId){return undefined}for(var E in this.config.buttons){var B=$(E);var D=this.config.buttons[E];if(!B||!D){continue}var A=Element.regexForClassName(this.config.activeContentClass);if(A.test(B.className)){return E}function C(G){var F=$(G);return A.test(B.className)}if(this.nodesById(D).some(C,this)){return E}}return undefined};itgoldenbrigde.widget.ContentSwitcher.prototype.reset=function(){if(this._activeButtonId==this._initialActiveButton){return }this.activateButton(this._initialActiveButton);this.activateContent(this._initialActiveContentIds)};itgoldenbrigde.widget.ContentSwitcher.prototype.activateButton=function(B){var A;if(this._activeButtonId){A=$(this._activeButtonId);Element.addClassName(A,this.config.inactiveButtonClass);Element.removeClassName(A,this.config.activeButtonClass)}this._activeButtonId=B;if(!B){return }A=$(B);Element.removeClassName(A,this.config.inactiveButtonClass);Element.addClassName(A,this.config.activeButtonClass)};itgoldenbrigde.widget.ContentSwitcher.prototype.activateContent=function(A){var C=this._activeContentIds||[];var F=A||[];var E=this.nodesById(C);var B=this.nodesById(F);function D(H){this.beforeHideContent(H.id);Element.removeClassName(H,this.config.activeContentClass);Element.addClassName(H,this.config.inactiveContentClass)}function G(H){this.beforeShowContent(H.id);Element.removeClassName(H,this.config.inactiveContentClass);Element.addClassName(H,this.config.activeContentClass)}E.forEach(D,this);B.forEach(G,this);this._activeContentIds=(A||[]);this.config.transition.swap(E,B);C.forEach(this.afterHideContent,this);F.forEach(this.afterShowContent,this)};itgoldenbrigde.widget.ContentSwitcher.prototype.findTarget=function(A){if(!A){return A}while(!A.id&&"body"!=A.nodeName){A=A.parentNode}if(!A.id){return null}return A};itgoldenbrigde.widget.ContentSwitcher.prototype.mouseOverButton=function(B){var D=this.findTarget(Event.fixEvent(B).target);if(!D){return }var E=this.config.buttons[D.id];var A;if(!E||E==this._activeContentId){return }function C(){this.activateButton(D.id);this.activateContent(E)}if(this._activateTimer){window.clearTimeout(this._activateTimer)}this._activateTimer=window.setTimeout(C.bind(this),this.config.hoverDelay)};itgoldenbrigde.widget.ContentSwitcher.prototype.mouseOutButton=function(B){B=Event.fixEvent(B);var C=this.findTarget(B.currentTarget);if(!C){return }var A=B.relatedTarget;while(A&&A!=C&&A.nodeName!="body"){A=A.parentNode}if(A==C){return }if(this._activateTimer){window.clearTimeout(this._activateTimer)}this._activateTimer=null};itgoldenbrigde.widget.ContentSwitcher.prototype.mouseOverContainer=function(A){var B=Event.fixEvent(A).target};itgoldenbrigde.widget.ContentSwitcher.prototype.mouseOutContainer=function(B){B=Event.fixEvent(B);var C=B.currentTarget;if(!C){return }if(!this.config.overviewId){return }var A=B.relatedTarget;while(A&&A!=C&&A.nodeName!="body"){A=A.parentNode}if(A==C){return }this.activateContent([this.config.overviewId]);this.activateButton(null)};itgoldenbrigde.widget.ContentSwitcher.prototype.buttonClicked=function(C){var D=this.findTarget(Event.fixEvent(C).target);if(!D){return }var A=this.config.buttons[D.id];var B;if(!A||D.id==this._activeButtonId){return }if(this._activateTimer){window.clearTimeout(this._activateTimer)}this.activateButton(D.id);this.activateContent(A);Event.stop(C)};itgoldenbrigde.widget.ContentSwitcher.prototype.beforeShowContent=function(A){};itgoldenbrigde.widget.ContentSwitcher.prototype.beforeHideContent=function(A){};itgoldenbrigde.widget.ContentSwitcher.prototype.afterShowContent=function(A){};itgoldenbrigde.widget.ContentSwitcher.prototype.afterHideContent=function(A){};itgoldenbrigde.widget.CrossFader=Class.create(coherent.View,{exposedBindings:["locked"],paused:false,timer:null,selectedIndex:null,items:PartList("div.slide"),indicator:coherent.ListView("div.indicator",{contentBinding:"indicatorContent",selectedIndexBinding:"selectedIndex",enabledBinding:"locked(NOT)",innerHTML:'<span><img src="/rs/img/block1px.gif" alt=""></span>'}),previousButton:coherent.Anchor("a.previous",{action:"showPreviousItem"}),nextButton:coherent.Anchor("a.next",{action:"showNextItem"}),init:function(){var C=this.items();var A=C.length;var B=this.viewElement();this.setValueForKey(false,"locked");this.setValueForKey(0,"selectedIndex");Element.addClassName(C[0],"faded_in");if(A<2){if(Element.query(B,"div.pagination")){Element.query(B,"div.pagination").style.display="none"}return }for(var D=1;D<A;D++){Element.addClassName(C[D],"faded_out")}if(this.indicator){var E=this.items().map(function(G,F){return{value:"Item "+(F+1)}});this.setValueForKey(coherent.KVO.adapt(E),"indicatorContent");this.addObserverForKeyPath(this,this.observeSelectedIndexChange,"selectedIndex")}Event.observe(B,"mouseover",this.pause.bindAsEventListener(this));Event.observe(B,"mouseout",this.resume.bindAsEventListener(this));this.resume()},observeSelectedIndexChange:function(A){if(this.locked){return }this.switchItems(A.oldValue,A.newValue,250)},showPreviousItem:function(D){if((typeof (D)==="undefined"&&this.paused)||this.locked){return }var C;if(typeof (D)!=="undefined"){C=250}var B=this.selectedIndex;var A;if(B===0){A=this.items().length-1}else{A=B-1}this.switchItems(B,A,C)},showNextItem:function(D){if((typeof (D)==="undefined"&&this.paused)||this.locked){return }var C;if(typeof (D)!=="undefined"){C=250}var B=this.selectedIndex;var A;if(B==this.items().length-1){A=0}else{A=B+1}this.switchItems(B,A,C)},switchItems:function(E,D,C){C=C||itgoldenbrigde.widget.CrossFader.FADE_DURATION;if(this.timer){window.clearTimeout(this.timer);this.timer=null}var A=this;function B(){A.setValueForKey(D,"selectedIndex");A.setValueForKey(false,"locked");A.resume()}this.setValueForKey(true,"locked");Element.replaceClassName(this.items(E),"faded_in","fading_out");coherent.Animator.replaceClassName(this.items(E),"fading_out","faded_out",{duration:C,only:["opacity"],discreteTransitionPoint:1});Element.replaceClassName(this.items(D),"faded_out","fading_in");coherent.Animator.replaceClassName(this.items(D),"fading_in","faded_in",{duration:C,only:["opacity"],discreteTransitionPoint:1,callback:B})},pause:function(A){this.paused=true;if(this.timer){window.clearTimeout(this.timer)}this.timer=null},resume:function(A){if(A){this.paused=false}if(this.timer){window.clearTimeout(this.timer)}this.timer=window.setTimeout(this.showNextItem.bind(this),itgoldenbrigde.widget.CrossFader.SLIDE_DELAY)}});itgoldenbrigde.widget.CrossFader.SLIDE_DELAY=6000;itgoldenbrigde.widget.CrossFader.FADE_DURATION=750;itgoldenbrigde.widget.EmailSubscription=function(B,A){this.base("constructor")(B,A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.EmailSubscription,itgoldenbrigde.widget.BaseWidget);var ServerStatus={good:"SUCCESS",bad:"ERROR",busy:"BUSY",off:"OFF",on:"ON",format:"FORMAT"};itgoldenbrigde.widget.EmailSubscription.DEFAULTS={emailPlaceholder:"example: steve@mac.com",submitUrl:"email-server-reply.txt",statusUrl:"email-server-status.txt",urlArgs:{},argName:"emailAddress",emailFieldSpec:"input.notify_email",submitButtonSpec:".notify_submit",formSpec:"form",fadeDuration:350,showForm:{SUCCESS:false,ERROR:false,BUSY:false,ON:true,OFF:false,FORMAT:true},loadingClass:"loading",rpcTimeout:10000,emailRegex:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i};itgoldenbrigde.widget.EmailSubscription.prototype.init=function(){var F={duration:this.config.fadeDuration};this._animator=new itgoldenbrigde.fx.Animator(F);this.setStatus("OFF");this.checkStatus();var B=this.part(this.config.formSpec);var E=this.part(this.config.emailFieldSpec);var A={placeholder:this.config.emailPlaceholder};this._field=new itgoldenbrigde.widget.TextField(E.id,A);var D=this.part(this.config.submitButtonSpec);var C=this.submitHandler.bindAsEventListener(this);Event.observe(D,"click",C);Event.observe(B,"submit",C)};itgoldenbrigde.widget.EmailSubscription.prototype.partSpecForStatus=function(A){return"div.notify_"+(A||"").toLowerCase()};itgoldenbrigde.widget.EmailSubscription.prototype.setStatus=function(G,J,L){G=G||"ERROR";if(G==this._status){return }var F=this.widget();var A=this.part(this.config.formSpec);var B=this.config.showForm[this._status];var K=this.config.showForm[G];var H=this.part(this.partSpecForStatus(this._status));var I=this.part(this.partSpecForStatus(G));if(!this._status){A.style.display=K?"block":"none";I.style.display="block";this._status=G;return }if(L){A.style.display=K?"block":"none";I.style.display="block";H.style.display="none";this._status=G;return }var C=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,H,1,0);var E=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,I,0,1);var M;var D=[C,E];if(B!=K){if(K){M=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,A,0,1);D=[C,new itgoldenbrigde.fx.Blend(E,M)]}else{M=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,A,1,0);D=[new itgoldenbrigde.fx.Blend(C,M),E]}}this._status=G;this._animator.play(new itgoldenbrigde.fx.Chain(D),J)};itgoldenbrigde.widget.EmailSubscription.prototype.rpc=function(D,G,C){if(-1!=D.indexOf("?")){D=D+"&"}else{D=D+"?"}D+="bustCache="+(new Date()).getTime().toString(16)+":"+Math.random();var F;var B=document.createElement("script");B.src=D;function A(){window.clearTimeout(F);F=null;if(G){G.apply(window,arguments)}}function E(){window.signalStatus=function(){};if(C){C()}}window.signalStatus=A;F=window.setTimeout(E,this.config.rpcTimeout);document.getElementsByTagName("HEAD")[0].appendChild(B)};itgoldenbrigde.widget.EmailSubscription.prototype.checkStatus=function(){function A(B){this.setStatus(ServerStatus[B],null,true)}this.rpc(this.config.statusUrl,A.bind(this))};itgoldenbrigde.widget.EmailSubscription.prototype.submitHandler=function(E){(E.target||E.srcElement).blur();Event.stop(E);var G=this.widget();var H=this.part(this.config.emailFieldSpec);if(!H||!this.config.submitUrl){return }var F=H.value||"";if(!F.match(this.config.emailRegex)){this.setStatus("FORMAT");H.focus();H.select();return }Element.addClassName(G,this.config.loadingClass);function D(){Element.removeClassName(G,this.config.loadingClass)}function A(J){J=J.replace(/^\s*/,"").replace(/\s*$/,"").toLowerCase();var I=ServerStatus[J];this.setStatus(I,D.bind(this))}var C=Object.applyDefaults({},this.config.urlArgs);C[this.config.argName]=F;var B=[this.config.submitUrl,Object.toQueryString(C)].join("?");this.rpc(B,A.bind(this),A.bind(this,"busy"))};itgoldenbrigde.widget.Engraver=function(A){this.config=A;this.timer=null};itgoldenbrigde.widget.Engraver.DEFAULT_DELAY=1000;itgoldenbrigde.widget.Engraver.prototype.validateConfig=function(){if(!this.config){return false}var A=this.getTextFields();if(!A){return false}for(var B=0;B<A.length;B++){if(!A[B]){return false}}if(!this.getEngraveImage()){return false}return true};itgoldenbrigde.widget.Engraver.prototype.connectEvents=function(){if(!this.attachedEvents){if(!this.validateConfig()){return }function A(C){var B=this.getTextFields();for(var D=0;D<B.length;D++){var E=$(B[D]);E.setAttribute("autocomplete","off");Event.observe(E,"onkeyup",(function(F){this.valueChanged(F)}).bind(this));Event.observe(E,"onchange",(function(F){this.valueChanged(F)}).bind(this))}}Event.onDomReady(A.bind(this));this.attachedEvents=true}};itgoldenbrigde.widget.Engraver.prototype.valueChanged=function(A){if(this.timer){window.clearTimeout(this.timer)}this.timer=window.setTimeout(this.engrave.bind(this),this.getDelay())};itgoldenbrigde.widget.Engraver.prototype.getTextFields=function(){return this.config.textFields};itgoldenbrigde.widget.Engraver.prototype.getEngraveImage=function(){return this.config.engraveImageId};itgoldenbrigde.widget.Engraver.prototype.getBaseUrl=function(){return this.config.baseUrl};itgoldenbrigde.widget.Engraver.prototype.getDelay=function(){if(this.config.delay){return parseInt(this.config.delay,10)}return itgoldenbrigde.widget.Engraver.DEFAULT_DELAY};itgoldenbrigde.widget.Engraver.prototype.engrave=function(){var E=$(this.getEngraveImage());var C=this.getBaseUrl();var A=this.getTextFields();for(var B=0;B<A.length;B++){var D=$(A[B]);C+=this.getLineArgument(D.value,B)}if(E){E.setAttribute("src",C)}};itgoldenbrigde.widget.Engraver.prototype.getLineArgument=function(C,B){C=this.encode(C);var A="th";if(B%2==1){A="tl"}return"&"+A+"="+C};itgoldenbrigde.widget.Engraver.prototype.encode=function(B){try{return encodeURIComponent(B)}catch(A){return escape(B)}};itgoldenbrigde.widget.FormSubmitter=function(A){this.config=A;Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.FormSubmitter.prototype.init=function(){if(this._initialized){return }Event.observe(this.getForm(),"onsubmit",(function(A){this.formHandler(A)}).bind(this));Event.observe(this.getSubmit(),"onclick",(function(A){this.submitHandler(A)}).bind(this));this._initialized=true};itgoldenbrigde.widget.FormSubmitter.prototype.getForm=function(){return $(this.config.formId)?$(this.config.formId):document.forms[this.config.formId]};itgoldenbrigde.widget.FormSubmitter.prototype.getSubmit=function(){return $(this.config.submitId)};itgoldenbrigde.widget.FormSubmitter.prototype.formHandler=function(A){return true};itgoldenbrigde.widget.FormSubmitter.prototype.submitHandler=function(A){return true};itgoldenbrigde.widget.SelectLinkFormSubmitter=itgoldenbrigde.widget.FormSubmitter;itgoldenbrigde.widget.SelectLinkFormSubmitter.prototype.getSelect=function(){return $(this.config.selectId)};itgoldenbrigde.widget.SelectLinkFormSubmitter.prototype.formHandler=function(B){var C=this.getForm();var A=this.getSelect();if(C&&A&&A.options&&A.options[A.selectedIndex].value){C.action=A.options[A.selectedIndex].value}return true};itgoldenbrigde.widget.Gallery=function(A){this.config=A;this.index=0;if(!this.config.initial){this.config.initial=this.getTypeImage()}this.setMediaType(this.config.initial);this.setShowingAlt(false);this.setupImages();this.setupMovies();this.setupFX()};itgoldenbrigde.widget.Gallery.FX_NONE=0;itgoldenbrigde.widget.Gallery.FX_PAN=1;itgoldenbrigde.widget.Gallery.FX_FADE=2;itgoldenbrigde.widget.Gallery.TYPE_IMAGE=100;itgoldenbrigde.widget.Gallery.TYPE_MOVIE=101;itgoldenbrigde.widget.Gallery.prototype.getFxNone=function(){return itgoldenbrigde.widget.Gallery.FX_NONE};itgoldenbrigde.widget.Gallery.prototype.getFxPan=function(){return itgoldenbrigde.widget.Gallery.FX_PAN};itgoldenbrigde.widget.Gallery.prototype.getFxFade=function(){return itgoldenbrigde.widget.Gallery.FX_FADE};itgoldenbrigde.widget.Gallery.prototype.getTypeImage=function(){return itgoldenbrigde.widget.Gallery.TYPE_IMAGE};itgoldenbrigde.widget.Gallery.prototype.getTypeMovie=function(){return itgoldenbrigde.widget.Gallery.TYPE_MOVIE};itgoldenbrigde.widget.Gallery.prototype.setupImages=function(){if(!this.hasImages()){return }function D(F){C[F]++;window.setTimeout(E.bind(null,F),10)}function E(I){function H(){B[G][I+"Image"]=J;if(!L){return }window.clearTimeout(L);D(I)}function F(){L=0;window.clearTimeout(L);D(I)}var L=0;var G=C[I];if(G>=A){return }var K=B[G][I];if(!K){D(I);return }var J=new Image();J.onload=H;J.src=K;L=window.setTimeout(F,2000)}var C={thumb:0,full:0};var B=this.config.images;var A=B.length;E("thumb");E("full")};itgoldenbrigde.widget.Gallery.prototype.setupMovies=function(){if(this.hasMovies()){if(!this.config.movie.full){this.config.movie.full={}}if(!this.config.movie.full.elementId){this.config.movie.full.elementId=Element.uniqueId()}for(var C=0;C<this.config.movies.length;C++){if(this.config.movies[C].thumb){var D=new Image();D.src=this.config.movies[C].thumb;this.config.movies[C].thumbImage=D}if(this.config.movies[C].full){var A=this.config.movies[C];var B=this.findIdName(A.full);if(!B){B=this.config.movie.full.elementId+C;A.full.push("id");A.full.push(B)}A.elementId=B;A.full.push("enablejavascript");A.full.push("true");var E=new itgoldenbrigde.quicktime.QuickTime(A.full);A.xml=E.generateOBJECTTextXHTML()}}}};itgoldenbrigde.widget.Gallery.prototype.setupFX=function(){if(this.config.fade){this.fader=new itgoldenbrigde.fx.CrossFade(this.config.fade.speed,this.config.fade.increment)}if(this.config.swoosh){this.swoosher=new itgoldenbrigde.fx.Swoosh(this.config.viewer.elementId,this.config.swoosh.speed,this.config.swoosh.increment)}};itgoldenbrigde.widget.Gallery.prototype.next=function(){if(this.isShowingImage()){this._showImage(this.index+1,this.getFxPan())}else{this._showMovie(this.index+1,this.getFxNone())}};itgoldenbrigde.widget.Gallery.prototype.previous=function(){if(this.isShowingImage()){this._showImage(this.index-1,this.getFxPan())}else{this._showMovie(this.index-1,this.getFxNone())}};itgoldenbrigde.widget.Gallery.prototype.image=function(A){if(!this.isShowingImage()){this.swapMedia()}this._showImage(A,this.getFxFade())};itgoldenbrigde.widget.Gallery.prototype.movie=function(A){if(!this.isShowingMovie()){this.swapMedia()}this._showMovie(A,this.getFxNone())};itgoldenbrigde.widget.Gallery.prototype.hasImages=function(){return this.config.images&&this.config.images.length};itgoldenbrigde.widget.Gallery.prototype.hasMovies=function(){return this.config.movies&&this.config.movies.length};itgoldenbrigde.widget.Gallery.prototype.isShowingImage=function(){return(this.mediaType==this.getTypeImage())};itgoldenbrigde.widget.Gallery.prototype.isShowingMovie=function(){return(this.mediaType==this.getTypeMovie())};itgoldenbrigde.widget.Gallery.prototype.setMediaType=function(A){this.mediaType=A};itgoldenbrigde.widget.Gallery.prototype.swapMedia=function(){this.stopAnimations();var A=this.getMovieElement();var B=this.getActiveImage();if(this.isShowingImage()){Element.hide(B);A.innerHTML="";Element.show(A);this.changeThumbImageState(this.getTypeImage(),this.index,-1);this.setMediaType(this.getTypeMovie())}else{Element.show(B);A.innerHTML="";Element.hide(A);this.changeThumbImageState(this.getTypeMovie(),this.index,-1);this.setMediaType(this.getTypeImage())}this.index=-1};itgoldenbrigde.widget.Gallery.prototype._showMovie=function(A,D){if(A==this.index){return }if(!this.hasMovies()){return }var F=this.index;if(A>=this.config.movies.length){A=0}else{if(A<0){A=this.config.movies.length-1}}this.changeThumbImageState(this.getTypeMovie(),F,A);this.stopAnimations();var B=this.getMovieElement();Element.hide(B);try{var E=null;if(F>=0){E=$(this.config.movies[F].elementId)}if(E){E.Stop();Element.hide(E);while(B.hasChildNodes()){B.removeChild(B.firstChild)}B.innerHTML=""}}catch(C){B.innerHTML=""}B.innerHTML=this.config.movies[A].xml;Element.show(B);this.index=A};itgoldenbrigde.widget.Gallery.prototype._showImage=function(A,C){if(A==this.index){return }if(!this.hasImages()){return }var D=this.index;var B=(A>=D);if(A>=this.config.images.length){A=0}else{if(A<0){A=this.config.images.length-1}}this.changeThumbImageState(this.getTypeImage(),this.index,A);this.stopAnimations();if(C==this.getFxFade()){if(this.fader){this.fadeImage(this.config.images[A].fullImage.src)}else{this.getActiveImage().src=this.config.images[A].fullImage.src}}else{if(C==this.getFxPan()){if(this.swoosher){this.panImage(B,this.config.images[A].fullImage.src)}else{this.getActiveImage().src=this.config.images[A].fullImage.src}}}this.index=A};itgoldenbrigde.widget.Gallery.prototype.getActiveImage=function(){if(this.isShowingAlt()){return this.getAltFullImage()}else{return this.getFullImage()}};itgoldenbrigde.widget.Gallery.prototype.stopAnimations=function(){if(this.fader){this.fader.stopAnimation()}if(this.swoosher){this.swoosher.stopAnimation()}};itgoldenbrigde.widget.Gallery.prototype.isShowingAlt=function(){return this.showingAlt};itgoldenbrigde.widget.Gallery.prototype.setShowingAlt=function(A){return this.showingAlt=A};itgoldenbrigde.widget.Gallery.prototype._resetImages=function(B,A){Element.setOpacity(B,1);Element.setOpacity(A,1)};itgoldenbrigde.widget.Gallery.prototype.fadeImage=function(C){var B=!this.isShowingAlt();this.setShowingAlt(B);var D=null;var A=null;if(B){D=this.getFullImage();A=this.getAltFullImage()}else{D=this.getAltFullImage();A=this.getFullImage()}A.src=C;this._resetImages(D,A);this.fader.fade(D,A)};itgoldenbrigde.widget.Gallery.prototype.panImage=function(B,D){var C=!this.isShowingAlt();this.setShowingAlt(C);var E=null;var A=null;if(C){E=this.getFullImage();A=this.getAltFullImage()}else{E=this.getAltFullImage();A=this.getFullImage()}A.src=D;this._resetImages(E,A);this.swoosher.pan(B,E,A)};itgoldenbrigde.widget.Gallery.prototype.changeThumbImageState=function(D,C,A){var B=this.getThumbAnchor(D,C);var E=this.getThumbAnchor(D,A);if(B){B.className=this.config.image.thumb.cssClass}if(E){E.className=this.config.image.thumb.cssActiveClass}};itgoldenbrigde.widget.Gallery.prototype.getFullImage=function(){return $(this.config.image.full.elementId)};itgoldenbrigde.widget.Gallery.prototype.getAltFullImage=function(){var A=this.config.image.full.elementId+"Alt";var B=$(A);if(!B){var C=this.getFullImage();B=C.cloneNode(false);B.id=A;var D=this.getViewer();D.appendChild(B)}return B};itgoldenbrigde.widget.Gallery.prototype.getMovieElement=function(){var A=this.config.movie.full.elementId;var B=$(A);if(!B){B=document.createElement("div");B.id=A;Element.setStyle(B,"position","absolute");Element.setStyle(B,"display","block");Element.setStyle(B,"left","0px");Element.setStyle(B,"top","0px");var C=this.getViewer();C.appendChild(B)}return B};itgoldenbrigde.widget.Gallery.prototype.getViewer=function(){return $(this.config.viewer.elementId)};itgoldenbrigde.widget.Gallery.prototype.getThumbAnchorId=function(B,A){var C=null;if(B==this.getTypeImage()){C=this.config.image.thumb.elementId+A}else{C=this.config.movie.thumb.elementId+A}return C};itgoldenbrigde.widget.Gallery.prototype.getThumbAnchor=function(B,A){return $(this.getThumbAnchorId(B,A))};itgoldenbrigde.widget.Gallery.prototype.getThumbImage=function(B,A){var C=null;if(B==this.getTypeImage()){C=this.config.images[A].thumbImage}else{C=this.config.movies[A].thumbImage}return C};itgoldenbrigde.widget.Gallery.prototype.outputImageThumbs=function(){if(this.hasImages()){var B=null;B=$(this.config.image.thumb.elementId);for(var A=0;A<this.config.images.length;A++){var C=new itgoldenbrigde.widget.Gallery.ClickWrapper(this,A,this.getTypeImage());this.createThumb(B,this.getThumbAnchorId(this.getTypeImage(),A),this.config.images[A].thumbImage.src,false,this.config.image.thumb,C)}if(this.isShowingImage()){this.index=-1;this._showImage(0,this.getFxNone())}}};itgoldenbrigde.widget.Gallery.prototype.outputMovieThumbs=function(){if(this.hasMovies()){var B=null;B=$(this.config.movie.thumb.elementId);for(var A=0;A<this.config.movies.length;A++){var C=new itgoldenbrigde.widget.Gallery.ClickWrapper(this,A,this.getTypeMovie());this.createThumb(B,this.getThumbAnchorId(this.getTypeMovie(),A),this.config.movies[A].thumbImage.src,false,this.config.movie.thumb,C)}if(this.isShowingMovie()){this.index=-1;this._showMovie(0,this.getFxNone())}}};itgoldenbrigde.widget.Gallery.prototype.createThumb=function(D,H,G,C,B,E){var A=this.createAnchorNode(H,C,B.cssActiveClass,B.cssClass);A.onclick=function(){E.onClick()};var F=this.createImageNode(G,B.width,B.height);A.appendChild(F);D.appendChild(A)};itgoldenbrigde.widget.Gallery.prototype.createImageNode=function(D,B,A){var C=document.createElement("img");Element.setStyle(C,"height",A+"px");Element.setStyle(C,"width",B+"px");C.src=D;return C};itgoldenbrigde.widget.Gallery.prototype.createAnchorNode=function(E,C,B,D){var A=document.createElement("a");A.id=E;if(C){if(B){A.className=B}}else{if(D){A.className=D}}return A};itgoldenbrigde.widget.Gallery.prototype.findIdName=function(B){for(var A=0;A<B.length;A+=2){var C=B[A].toLowerCase();var D=B[A+1];if("name"==C||"id"==C){return D}}return null};itgoldenbrigde.widget.Gallery.ClickWrapper=function(A,B,C){this.gallery=A;this.index=B;this.type=C};itgoldenbrigde.widget.Gallery.ClickWrapper.prototype.onClick=function(){if(this.type==this.gallery.getTypeImage()){this.gallery.image(this.index)}else{this.gallery.movie(this.index)}};itgoldenbrigde.widget.Gallery2=function(A){this.base("constructor")(A);this._groupThumbs={};this._activeGroup=0;this._imageId=[];this._activeImageIndex=0;this._quicktimeInstalled=false;this._loadedImages={};this._mediaClass=null;this._mediaType=null};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.Gallery2,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.Gallery2.DEFAULTS={activeClass:"active",disabledClass:"disabled",imageClass:"image",mediaClass:"media",movieClass:"movie",thumbGroupClass:"thumbnails",allowWrapping:true,movieFirstFrame:{pattern:/\.m[o|4]v$/,replace:"-first.jpg"},moviePosterFrame:{pattern:/\.m[o|4]v$/,replace:".jpg"}};itgoldenbrigde.widget.Gallery2.prototype.cssClassRegex=/css-class\((.*?)\)/;itgoldenbrigde.widget.Gallery2.prototype.movieRegex=/\.m[o|4]v$/;itgoldenbrigde.widget.Gallery2.RIGHT="right";itgoldenbrigde.widget.Gallery2.LEFT="left";itgoldenbrigde.widget.Gallery2.FADE="";itgoldenbrigde.widget.Gallery2.prototype.init=function(){var I=$(this.config.galleryId);if(!I){return }this._quicktimeInstalled=itgoldenbrigde.quicktime.isInstalled();this._mediaClass=this.config.imageClass;Element.addClassName(I,this.config.imageClass);Element.removeClassName(I,this.config.movieClass);var B=Element.queryAll(I,"."+this.config.mediaClass)[0];if(!B){return }this._mediaId=Element.assignId(B);var G={id:this._mediaId,duration:400};this._swapper=new itgoldenbrigde.fx.ContentSwapper(G);function A(){var J=document.createElement("div");var K=document.createElement("img");J.appendChild(K);K.style.position="absolute";K.style.left="50%";K.style.top="50%";J.style.position="absolute";J.style.left="0";J.style.top="0";J.style.width="100%";J.style.height="100%";J.style.display="none";J.style.zIndex="2";B.appendChild(J);return J}var E=B.getElementsByTagName("img")[0];var H=E.src;E.parentNode.removeChild(E);E=A();this._imageId[0]=Element.assignId(E);this._setImage(0,H,this.config.imageClass);E.style.display="";E=A();this._imageId[1]=Element.assignId(E);this._createNavigation(I);var F=this.thumbClicked.bindAsEventListener(this);function D(M,L){var K=M.getElementsByTagName("a");function J(O){var P=Element.assignId(O);var N=O.href;if(N==H){this._activeThumbId=P;this._activeGroup=L;Element.addClassName(O,this.config.activeClass)}else{Element.removeClassName(O,this.config.activeClass)}O._groupIndex=L;this._groupThumbs[L].push(P);if(!N.match(this.movieRegex)){return }if(!this._quicktimeInstalled){N=N.replace(this.config.moviePosterFrame.pattern,this.config.moviePosterFrame.replace);O.href=this._movieFrameSrc(O,this.config.moviePosterFrame)}}Event.observe(M,"click",F);this._groupThumbs[L]=[];Array.forEach(K,J,this)}var C=Element.queryAll(I,"."+this.config.thumbGroupClass);Array.forEach(C,D,this);Event.observe(I,"mousedown",this.mouseDown.bindAsEventListener(this));this._updateNavigation()};itgoldenbrigde.widget.Gallery2.prototype._setImage=function(A,G,D,H){function C(){this._mediaSize={width:F.width,height:F.height};E.width=F.width;E.height=F.height;E.src=G;E.style.marginTop=-(F.height/2)+"px";E.style.marginLeft=-(F.width/2)+"px";if(H){H.call(this)}}var B=$(this._imageId[A]);var E=B.firstChild;var F=new Image();B.className=D||"";F.onload=C.bind(this);F.src=G};itgoldenbrigde.widget.Gallery2.prototype._updateMediaClass=function(B){if(B==this._mediaClass){return }var A=$(this.config.galleryId);Element.addClassName(A,B);Element.removeClassName(A,this._mediaClass);this._mediaClass=B};itgoldenbrigde.widget.Gallery2.prototype._createNavigation=function(B){var A;A=document.createElement("a");A.className="prev";A.href="#";A.onclick=this.prevButtonClicked.bindAsEventListener(this);this._prevButtonId=Element.assignId(A);B.appendChild(A);A=document.createElement("a");A.className="next";A.href="#";A.onclick=this.nextButtonClicked.bindAsEventListener(this);this._nextButtonId=Element.assignId(A);B.appendChild(A)};itgoldenbrigde.widget.Gallery2.prototype._getMovie=function(){return $(this._movieId)};itgoldenbrigde.widget.Gallery2.prototype._hideMovie=function(){var A=this._getMovie();if(A&&!this._playingMovie&&itgoldenbrigde.quicktime.mobileSafari){A.parentNode.removeChild(A);return }if(!this._movieController){return }A.parentNode.style.backgroundImage="";this._movieController.hideMovie();var B=A.parentNode};itgoldenbrigde.widget.Gallery2.prototype._movieLoaded=function(B){var A=$(this.config.galleryId);this._updateMediaClass(this._mediaType);var C=$(this._imageId[this._activeImageIndex]);var D=B.parentNode;D.className=this._mediaType;B.parentNode.style.backgroundImage="url("+C.firstChild.src+")";this._movieController.showMovie(this._mediaSize.width,this._mediaSize.height);C.style.display="none";this._movieController.play()};itgoldenbrigde.widget.Gallery2.prototype._movieFrameSrc=function(C,D){D=D||this.config.movieFirstFrame;var B=$(C);if(!B){return""}var E=this._stripFolder(B.href);var G=B.getElementsByTagName("img")[0];if(!G){return""}var F=G.src;var A=F.lastIndexOf("/");if(-1==A){return""}F=[F.substr(0,A),E].join("/");return F.replace(D.pattern,D.replace)};itgoldenbrigde.widget.Gallery2.prototype._stripFolder=function(B){var A=B.lastIndexOf("/");if(-1==A){return B}return B.substr(A+1)};itgoldenbrigde.widget.Gallery2.prototype._playMovie=function(C,E){var B=itgoldenbrigde.quicktime.mobileSafari?this.config.moviePosterFrame:this.config.movieFirstFrame;var A=this._movieFrameSrc(this._activeThumbId,B);function D(){var F=this._getMovie();if(coherent.Browser.Safari||itgoldenbrigde.quicktime.mobileSafari||!F){this._createMovie(C);return }this._movieController.hideMovie();this._movieController.loadMovie(C)}this._swapImages(A,E,D.bind(this))};itgoldenbrigde.widget.Gallery2.prototype._createMovie=function(D){var F=$(this._mediaId);var E=document.createElement("div");var B;if(this._movieId){B=$(this._movieId);B.parentNode.removeChild(B)}F.appendChild(E);E.style.position="absolute";E.style.left="0";E.style.top="0";E.style.width="100%";E.style.height="100%";E.style.backgroundPosition="center center";E.style.backgroundRepeat="no-repeat";this._movieId=Element.uniqueId();var C={src:D,id:this._movieId,width:this.config.movieWidth,height:this.config.movieHeight,autoplay:false,bgcolor:this.config.movieBackground};B=itgoldenbrigde.quicktime.createMovie(C,E);B.style.position="absolute";B.style.left="50%";B.style.top="50%";B.style.marginLeft=(-this._mediaSize.width/2)+"px";B.style.marginTop=(-this._mediaSize.height/2)+"px";if(itgoldenbrigde.quicktime.mobileSafari){return $(this._movieId)}var A={movieId:this._movieId,onload:this._movieLoaded.bind(this)};this._movieController=new itgoldenbrigde.widget.MovieController(this.config.controllerId,A);this._movieController.hideMovie();return $(this._movieId)};itgoldenbrigde.widget.Gallery2.prototype._swapImages=function(C,F,H){var A=$(this.config.galleryId);var E=this._activeImageIndex?0:1;var D=$(this._imageId[this._activeImageIndex]);var G=$(this._imageId[E]);if(!D||!G){return }function B(){D.style.display="";this._activeImageIndex=E;this._hideMovie();if(!this._playingMovie){this._updateMediaClass(this._mediaType)}this._swapper.swap(F,D,G,H)}if(this._movieController){this._movieController.stop()}G.style.display="none";this._setImage(E,C,this._mediaType,B)};itgoldenbrigde.widget.Gallery2.prototype.showAsset=function(A,B){if(A.match(this.movieRegex)){this._playingMovie=true;this._playMovie(A,B)}else{this._playingMovie=false;this._swapImages(A,B)}};itgoldenbrigde.widget.Gallery2.prototype._updateNavigation=function(){var A=this._groupThumbs[this._activeGroup];var C=A.indexOf(this._activeThumbId);var B=$(this._prevButtonId);var D=$(this._nextButtonId);if(1==A.length){B.style.display="none";D.style.display="none";return }B.style.display="";D.style.display="";if(this.config.allowWrapping){return }if(!C){Element.addClassName(B,this.config.disabledClass)}else{Element.removeClassName(B,this.config.disabledClass)}if(A.length==C+1){Element.addClassName(D,this.config.disabledClass)}else{Element.removeClassName(D,this.config.disabledClass)}};itgoldenbrigde.widget.Gallery2.prototype._activateThumb=function(D){var B;if(this._activeThumbId){B=$(this._activeThumbId);Element.removeClassName(B,this.config.activeClass)}this._activeThumbId=D;B=$(this._activeThumbId);Element.addClassName(B,this.config.activeClass);var C;var A=(B.rel||"");C=A.match(this.cssClassRegex);if(C&&C[1]){this._mediaType=C[1]}else{if(B.href.match(this.movieRegex)){this._mediaType=this.config.movieClass}else{this._mediaType=this.config.imageClass}}this._updateNavigation()};itgoldenbrigde.widget.Gallery2.prototype.thumbClicked=function(C){var D=C.target||C.srcElement;var A=$(this.config.galleryId);Event.stop(C);while(D&&D!=A&&D.nodeName.toLowerCase()!="a"){D=D.parentNode}if(D==A){return }var B=D.href;if(!B){return }D.blur();if(this._activeThumbId==D.id){return }this._activeGroup=D._groupIndex;this._activateThumb(D.id);this.showAsset(B)};itgoldenbrigde.widget.Gallery2.prototype.nextButtonClicked=function(E){var B=this._groupThumbs[this._activeGroup];var D=B.indexOf(this._activeThumbId);Event.stop(E);D++;if(!this.config.allowWrapping&&D==B.length){return }if(D==B.length){D=0}var A=B[D];var C=$(A).href;this._activateThumb(A);this.showAsset(C,itgoldenbrigde.widget.Gallery2.LEFT)};itgoldenbrigde.widget.Gallery2.prototype.prevButtonClicked=function(E){var B=this._groupThumbs[this._activeGroup];var D=B.indexOf(this._activeThumbId);Event.stop(E);D--;if(!this.config.allowWrapping&&D<0){return }if(D<0){D=B.length-1}var A=B[D];var C=$(A).href;this._activateThumb(A);this.showAsset(C,itgoldenbrigde.widget.Gallery2.RIGHT)};itgoldenbrigde.widget.Gallery2.prototype.mouseDown=function(B){var C=B.srcElement||B.target;var A=this._getMovie();if(C==A){return }Event.stop(B)};itgoldenbrigde.widget.Gifting={};itgoldenbrigde.widget.Gifting.selectGiftCheckbox=function(A,D){var C=$(A);var B=$(D);if(C&&B){if(C.checked){Element.hide(B)}else{Element.show(B)}}};itgoldenbrigde.widget.Gifting.selectLearnMoreCheckboxes=function(){itgoldenbrigde.widget.Gifting.selectGiftCheckbox("giftmessage-checkbox","oneclick-button")};itgoldenbrigde.widget.Gifting.selectEngravingGiftCheckbox=function(){var A=itgoldenbrigde.cookie("itgoldenbrigdeconfig3");if(A===null){A=itgoldenbrigde.cookie("itgoldenbrigdeConfig3")}if(A!==null){itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox","oneclick-button-engrave");itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox","oneclick-button-skip")}};itgoldenbrigde.widget.Gifting.selectIPodEngravePlainCheckbox=function(){itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox-plain","oneclick-button-plain");itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox-plain","or-string-plain")};itgoldenbrigde.widget.Gifting.selectIPodEngraveEngravedCheckbox=function(){itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox-engraved","oneclick-button-engraved");itgoldenbrigde.widget.Gifting.selectGiftCheckbox("gift-checkbox-engraved","or-string-engraved")};itgoldenbrigde.widget.Gifting.selectIPodEngraveCheckboxes=function(){itgoldenbrigde.widget.Gifting.selectIPodEngravePlainCheckbox();itgoldenbrigde.widget.Gifting.selectIPodEngraveEngravedCheckbox()};Event.onDomReady(itgoldenbrigde.widget.Gifting.selectLearnMoreCheckboxes);Event.onDomReady(itgoldenbrigde.widget.Gifting.selectEngravingGiftCheckbox);Event.onDomReady(itgoldenbrigde.widget.Gifting.selectIPodEngraveCheckboxes);itgoldenbrigde.widget.HoverManager=function(B,A){if(itgoldenbrigde.widget.HoverManager.sharedManager){return itgoldenbrigde.widget.HoverManager.sharedManager}itgoldenbrigde.widget.HoverManager.sharedManager=this;A=Object.applyDefaults(A,arguments.callee.DEFAULTS);this.configs=B||[];this.hovers=[];this.activeHover=null;this._sourceClickedHandler=this.sourceClicked.bindAsEventListener(this);this._mouseOverHandler=this.mouseOver.bindAsEventListener(this);this._mouseOutHandler=this.mouseOut.bindAsEventListener(this);this._contentClicked=this.contentClicked.bindAsEventListener(this);this._behaviour=A.behaviour;this._showDelay=A.showDelay;this._hideDelay=A.hideDelay;Event.onDomReady(this.init.bind(this));return this};itgoldenbrigde.widget.HoverManager.sharedManager=null;itgoldenbrigde.widget.HoverManager.BEHAVIOUR={CLICK_OUTSIDE_TO_CLOSE:1,CLICK_INSIDE_TO_CLOSE:2,MOUSE_OVER_TO_OPEN:4,MOUSE_OUT_TO_CLOSE:8,CLICK_SOURCE_TO_OPEN:16};itgoldenbrigde.widget.HoverManager.DEFAULTS={showDelay:1000,hideDelay:1000,behaviour:(itgoldenbrigde.widget.HoverManager.BEHAVIOUR.CLICK_OUTSIDE_TO_CLOSE|itgoldenbrigde.widget.HoverManager.BEHAVIOUR.CLICK_SOURCE_TO_OPEN|itgoldenbrigde.widget.HoverManager.BEHAVIOUR.MOUSE_OVER_TO_OPEN|itgoldenbrigde.widget.HoverManager.BEHAVIOUR.MOUSE_OUT_TO_CLOSE)};itgoldenbrigde.widget.HoverManager.prototype.init=function(){function A(B,D){var C=new itgoldenbrigde.widget.Hover(B,this)}this.configs.forEach(A,this);if(this._behaviour&itgoldenbrigde.widget.HoverManager.BEHAVIOUR.CLICK_OUTSIDE_TO_CLOSE){this._bodyClickedHandler=this.bodyClicked.bindAsEventListener(this);Event.observe(document.body,"onclick",this._bodyClickedHandler)}Event.onUnload(this.cleanup.bind(this))};itgoldenbrigde.widget.HoverManager.prototype.manageHover=function(C){if(!C){return }var D=$(C.config.sourceId);var B=$(C.config.contentId);if(!D||!B){return }var A=this.hovers.length;this.hovers.push(C);D.hoverIndex=A;B.hoverIndex=A;if(this._behaviour&itgoldenbrigde.widget.HoverManager.BEHAVIOUR.CLICK_SOURCE_TO_OPEN){Event.observe(D,"click",this._sourceClickedHandler)}if(this._behaviour&itgoldenbrigde.widget.HoverManager.BEHAVIOUR.MOUSE_OVER_TO_OPEN){Event.observe(D,"mouseover",this._mouseOverHandler);Event.observe(B,"mouseover",this._mouseOverHandler);Event.observe(D,"mouseout",this._mouseOutHandler);Event.observe(B,"mouseout",this._mouseOutHandler)}if(this._behaviour&itgoldenbrigde.widget.HoverManager.BEHAVIOUR.CLICK_INSIDE_TO_CLOSE){Event.observe(B,"click",this._contentClickedHandler)}};itgoldenbrigde.widget.HoverManager.prototype.cleanup=function(){function A(B){var C=$(B.config.sourceId);B.cleanup()}this.hovers.forEach(A);this.hovers.length=0;if(this._bodyClickedHandler){Event.stopObserving(document.body,"onclick",this._bodyClickedHandler);this._bodyClickedHandler=null}this.cancelShowing();this.cancelHiding()};itgoldenbrigde.widget.HoverManager.prototype.findHoverNode=function(A){while(A&&A.nodeName!="BODY"){if("hoverIndex" in A){return A}A=A.parentNode}return null};itgoldenbrigde.widget.HoverManager.prototype.sourceClicked=function(A){var B=this.findHoverNode(A.target||A.srcElement);if(!B){return }this.showHover(B,true);Event.stop(A)};itgoldenbrigde.widget.HoverManager.prototype.bodyClicked=function(A){if(!this.activeHover){return }if(Event.isMouseOverElement(A,$(this.activeHover.config.contentId))){return }this.hideHover(null,true);Event.stop(A)};itgoldenbrigde.widget.HoverManager.prototype.mouseOver=function(A){var C=this.findHoverNode(A.srcElement||A.target);if(!C){return }var B=this.findHoverNode(A.relatedTarget||A.fromElement);if(B&&C==B){return }C.hasMouse=true;var D=C.sourceId||C.id;this.showHover(D)};itgoldenbrigde.widget.HoverManager.prototype.mouseOut=function(B){var C=this.findHoverNode(B.srcElement||B.target);if(!C){return }var A=this.findHoverNode(B.relatedTarget||B.toElement);if(A&&C==A){return }C.hasMouse=false;var D=C.sourceId||C.id;if(this._showingSourceId==D||this._behaviour&itgoldenbrigde.widget.HoverManager.BEHAVIOUR.MOUSE_OUT_TO_CLOSE){this.hideHover(D)}};itgoldenbrigde.widget.HoverManager.prototype.contentClicked=function(A){var B=this.findHoverNode(A.srcElement||A.target);if(!B){return }this.hideHover(B.sourceId,true);Event.stop(A)};itgoldenbrigde.widget.HoverManager.prototype.showHover=function(C,D){C=$(C);if(!C){return }if(C.id==this._hidingSourceId){this.cancelHiding()}if(D&&C.id==this._showingSourceId){this.cancelShowing();this.activeHover.show(true);return }var B=this.hovers[C.hoverIndex];if(B==this.activeHover){return }if(this._showing){this.cancelShowing()}if(this.activeHover){this.activeHover.hide();this.activeHover=B;B.show();this.cancelHiding();return }if(D){this.activeHover=B;B.show(true);return }function A(){this.cancelShowing();B.show(true)}this.activeHover=B;this._showingSourceId=C.id;this._showing=window.setTimeout(A.bind(this),this._showDelay)};itgoldenbrigde.widget.HoverManager.prototype.cancelShowing=function(){window.clearTimeout(this._showing);this._showing=this._showingSourceId=0};itgoldenbrigde.widget.HoverManager.prototype.cancelHiding=function(){window.clearTimeout(this._hiding);this._hiding=this._hidingSourceId=0};itgoldenbrigde.widget.HoverManager.prototype.hideHover=function(C,D){C=C||(this.activeHover?this.activeHover.config.sourceId:null);C=$(C);if(!C){return }var B=this.hovers[C.hoverIndex];if(C.id==this._showingSourceId){this.cancelShowing();this.activeHover=null;return }if(this.activeHover&&B!=this.activeHover){B.hide();return }if(D){B.hide(true);this.activeHover=null;return }function A(){this.cancelHiding();B.hide(true);this.activeHover=null}this._hidingSourceId=C.id;this._hiding=window.setTimeout(A.bind(this),this._hideDelay)};itgoldenbrigde.widget.HoverManager.prototype.beforeShowHover=function(A){};itgoldenbrigde.widget.HoverManager.prototype.beforeHideHover=function(A){};var STATES={hidden:0,showing:1,shown:2,hiding:3};itgoldenbrigde.widget.Hover=function(A,B){function D(G,F){var E=[];while(E.length<F){E=E.concat(G)}E.length=F;return E}function C(F){var E=[].concat(F);function G(H){if(!(typeof H==="string"||H instanceof String)){return H}return itgoldenbrigde.widget.Hover.LAYOUT_NAMES[H]}return E.map(G)}this.config=Object.applyDefaults(A,itgoldenbrigde.widget.Hover.DEFAULTS);this.config.sourcePadding=D(this.config.sourcePadding,4);this.config.contentOffset=D(this.config.contentOffset,4);this.config.pointerOffset=D(this.config.pointerOffset,4);this.config.allowedLayouts=C(this.config.allowedLayout||this.config.allowedLayouts);this.manager=B||new itgoldenbrigde.widget.HoverManager();Event.observe(window,"load",this.init.bind(this))};itgoldenbrigde.widget.Hover.prototype.init=function(){var G=this.close.bindAsEventListener(this);this.currentLayout=itgoldenbrigde.widget.Hover.NO_LAYOUT;var A=this._wrapContent();if(!A){return }var F=Element.getElementsByClassName("wdgt-mdl",A)[0];if(this.config.width){A.style.width=this.config.width;console.log(this.config.width);console.log(A.style.width)}if(F&&this.config.height>=parseInt(Element.getStyles(F,"height"),10)){F.style.height=this.config.height}function H(I){Event.observe(I,"onclick",G)}var D=Element.getElementsByClassName("close-link",A);Array.forEach(D,H);var E=Element.position(A,true);function B(J){var I=Element.getDimensions(J);var K=Element.position(J,true);I.left=K.left-E.left;I.top=K.top-E.top;return I}var C=Element.getElementsByClassName("triangle",A);this.pointerInfo=Array.map(C,B);if(A&&(Element.getStyle(A,"display")!="none")){this._state=STATES.visible}else{this._state=STATES.hidden}this.manager.manageHover(this)};itgoldenbrigde.widget.Hover.prototype.cleanup=function(){};itgoldenbrigde.widget.Hover.DEFAULT_SHOW_Z_INDEX=1000;itgoldenbrigde.widget.Hover.DEFAULT_HIDE_Z_INDEX=999;itgoldenbrigde.widget.Hover.NO_LAYOUT=null;itgoldenbrigde.widget.Hover.TOP_LAYOUT=0;itgoldenbrigde.widget.Hover.RIGHT_LAYOUT=1;itgoldenbrigde.widget.Hover.BOTTOM_LAYOUT=2;itgoldenbrigde.widget.Hover.LEFT_LAYOUT=3;itgoldenbrigde.widget.Hover.DEFAULTS={sourcePadding:[0,0,-2,-10],contentOffset:[20,40],pointerOffset:[8,10],fadeInDuration:300,fadeOutDuration:500,closeLink:"Close",allowedLayouts:[itgoldenbrigde.widget.Hover.TOP_LAYOUT,itgoldenbrigde.widget.Hover.RIGHT_LAYOUT,itgoldenbrigde.widget.Hover.BOTTOM_LAYOUT,itgoldenbrigde.widget.Hover.LEFT_LAYOUT]};itgoldenbrigde.widget.Hover.POINTER_INDEX=[3,2,0,1];itgoldenbrigde.widget.Hover.LAYOUT_NAMES={top:itgoldenbrigde.widget.Hover.TOP_LAYOUT,bottom:itgoldenbrigde.widget.Hover.BOTTOM_LAYOUT,left:itgoldenbrigde.widget.Hover.LEFT_LAYOUT,right:itgoldenbrigde.widget.Hover.RIGHT_LAYOUT};itgoldenbrigde.widget.Hover.prototype._wrapContent=function(){var A=$(this.config.contentId);if(!A){return null}var D=A.parentNode;A.parentNode.removeChild(A);A.id="";A.className="";var C=Element.uniqueId();var E=document.createElement("div");E.id=this.config.contentId;E.sourceId=this.config.sourceId;E.className=[A.className,"popup-wdgt"].join(" ");E.innerHTML=['<div class="wdgt-top"><div></div>','<span class="triangle"></span>',"</div>",'<div class="wdgt-mdl">','<div class="wdgt-right">','<span class="triangle"></span>',"</div>",'<div class="wdgt-left">','<a class="close-link" href="#">',this.config.closeLink,"</a>",'<div id="',C,'"></div>','<span class="triangle"></span>',"</div>","</div>",'<div class="wdgt-btm">',"<div></div>",'<span class="triangle"></span>',"</div>"].join("");document.body.appendChild(E);var B=$(C);B.parentNode.replaceChild(A,B);return E};itgoldenbrigde.widget.Hover.prototype.show=function(C){var A=$(this.config.contentId);if(!A){return }switch(this._state){case STATES.shown:return ;case STATES.showing:coherent.Animator.setStyles(A,{opacity:1},{duration:0,cleanup:true});this._state=STATES.shown;return ;default:break}A.style.visibility="hidden";A.style.display="block";this.position();this.manager.beforeShowHover(this);this.setContentZIndex(itgoldenbrigde.widget.Hover.DEFAULT_SHOW_Z_INDEX);function B(){this._state=STATES.shown}if(!C){A.style.display="block";B.call(this);return }this._state=STATES.showing;Element.setOpacity(A,0);A.style.visibility="visible";coherent.Animator.setStyles(A,{opacity:1},{duration:this.config.fadeInDuration,callback:B.bind(this),cleanup:true})};itgoldenbrigde.widget.Hover.prototype.hide=function(C){var B=$(this.config.contentId);if(!B){return }switch(this._state){case STATES.hidden:return ;case STATES.hiding:coherent.Animator.setStyles(B,{opacity:0},{duration:0,callback:A.bind(this),cleanup:true});this._state=STATES.hidden;return ;default:break}this.manager.beforeHideHover(this);this.setContentZIndex(itgoldenbrigde.widget.Hover.DEFAULT_HIDE_Z_INDEX);function A(){B.style.display="none";this._state=STATES.hidden}if(!C){A.call(this);return }this._state=STATES.hiding;coherent.Animator.setStyles(B,{opacity:0},{duration:this.config.fadeOutDuration,callback:A.bind(this),cleanup:true})};itgoldenbrigde.widget.Hover.prototype.toggle=function(){switch(this._state){case STATES.hidden:case STATES.hiding:this.show();return ;case STATES.shown:case STATES.showing:this.hide();return ;default:return }};itgoldenbrigde.widget.Hover.prototype.close=function(A){this.manager.hideHover(this.config.sourceId,true);Event.stop(A)};itgoldenbrigde.widget.Hover.prototype._getCurrentPointer=function(){var A=$(this.config.contentId);if(!A){return null}var B=Element.getElementsByClassName("triangle",A);if(!B){return null}return B[itgoldenbrigde.widget.Hover.POINTER_INDEX[this.currentLayout]]};itgoldenbrigde.widget.Hover.prototype._showPointer=function(){var A=this._getCurrentPointer();if(!A){return }A.style.display="block"};itgoldenbrigde.widget.Hover.prototype._hidePointer=function(){var A=this._getCurrentPointer();if(!A){return }A.style.display="none"};itgoldenbrigde.widget.Hover.prototype.setContentZIndex=function(B){var A=$(this.config.contentId);if(!A){return }A.style.zIndex=B};itgoldenbrigde.widget.Hover.prototype._createPositionContext=function(){var A={contentElem:$(this.config.contentId),sourceElem:$(this.config.sourceId),sourcePosition:{left:0,top:0},sourceBox:{height:0,width:0},contentBox:{height:0,width:0}};if(!A.contentElem||!A.sourceElem){return null}A.contentElem.style.left="0";A.contentElem.style.top="0";A.pageOffset=Element.position(A.contentElem);A.sourcePosition=Element.position(A.sourceElem);A.sourceBox=Element.getDimensions(A.sourceElem);A.contentBox=Element.getDimensions(A.contentElem);return A};itgoldenbrigde.widget.Hover.prototype._computeContentPosition=function(D,C){var A={left:0,top:0,pointerStyle:"",pointerOffset:0};C=C||this._createPositionContext();if(!C){return A}var B=this.pointerInfo[itgoldenbrigde.widget.Hover.POINTER_INDEX[D]];switch(D){case itgoldenbrigde.widget.Hover.TOP_LAYOUT:A.top=C.sourcePosition.top-C.contentBox.height-this.config.sourcePadding[D];A.left=C.sourcePosition.left-this.config.contentOffset[D];break;case itgoldenbrigde.widget.Hover.BOTTOM_LAYOUT:A.top=C.sourcePosition.top+C.sourceBox.height+this.config.sourcePadding[D];A.left=C.sourcePosition.left-this.config.contentOffset[D];break;case itgoldenbrigde.widget.Hover.LEFT_LAYOUT:A.left=C.sourcePosition.left-C.contentBox.width-this.config.sourcePadding[D]-B.width;A.top=C.sourcePosition.top-this.config.contentOffset[D];break;case itgoldenbrigde.widget.Hover.RIGHT_LAYOUT:A.left=C.sourcePosition.left+C.sourceBox.width+this.config.sourcePadding[D]-B.left;A.top=C.sourcePosition.top-this.config.contentOffset[D];break;default:break}return A};itgoldenbrigde.widget.Hover.prototype._findBestLayout=function(D){D=D||this._createPositionContext();if(!D){return null}var A=D.contentBox.width*D.contentBox.height;var B=Object.applyDefaults(Element.getScrollOffset(),Element.getViewport());B.bottom=B.top+B.height;B.right=B.left+B.width;var C=null;function G(L){var H=this._computeContentPosition(L,D);var O=Math.max(B.top,H.top);var J=Math.min(B.bottom,H.top+D.contentBox.height);var N=Math.max(B.left,H.left);var K=Math.min(B.right,H.left+D.contentBox.width);var I=(J-O)*(K-N);var M={layout:L,position:H,overlap:I,fits:(I>=A)};if(!C&&M.fits){C=M}return M}var E=this.config.allowedLayouts.map(G,this);if(1==E.length){return E[0]}if(C){return C}function F(H){if(!C||H.overlap>C.overlap){C=H}}E.forEach(F);return C};itgoldenbrigde.widget.Hover.prototype.position=function(){var C=this._createPositionContext();if(!C){return }var A=Element.getElementsByClassName("triangle",C.contentElem);Array.forEach(A,function(F){F.style.display="none"});var D=this._findBestLayout(C);if(!D){return }this.currentLayout=D.layout;C.contentElem.style.position="absolute";C.contentElem.style.top=(D.position.top)+"px";C.contentElem.style.left=(D.position.left)+"px";var E=this._getCurrentPointer();if(!E){return }var B=this.pointerInfo[itgoldenbrigde.widget.Hover.POINTER_INDEX[D.layout]];switch(D.layout){case itgoldenbrigde.widget.Hover.TOP_LAYOUT:case itgoldenbrigde.widget.Hover.BOTTOM_LAYOUT:E.style.left=(this.config.pointerOffset[D.layout]+this.config.contentOffset[D.layout]-B.width/2)+"px";break;case itgoldenbrigde.widget.Hover.LEFT_LAYOUT:case itgoldenbrigde.widget.Hover.RIGHT_LAYOUT:E.style.top=(this.config.pointerOffset[D.layout]+this.config.contentOffset[D.layout]-B.top-B.height/2)+"px";break;default:break}E.style.display="block"};itgoldenbrigde.widget.ImageButton=function(B,A){this.base("constructor")(B,A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.ImageButton,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.ImageButton.DEFAULTS={disabledClass:"disabled",activeClass:"active"};itgoldenbrigde.widget.ImageButton.prototype.init=function(){var A=this.widget();A._disabledClass=this.config.disabledClass;this._mousedownHandler=this.mousedown.bindAsEventListener(this);this._mouseupHandler=this.mouseup.bindAsEventListener(this);this._mouseoutHandler=this.mouseout.bindAsEventListener(this);this._mouseoverHandler=this.mouseover.bindAsEventListener(this);A.innerHTML="";Event.observe(A,"mousedown",this._mousedownHandler);itgoldenbrigde.widget.ImageButton._checkIds.push(A.id);itgoldenbrigde.widget.ImageButton.installDisabledChecker()};itgoldenbrigde.widget.ImageButton.prototype.disable=function(){var A=this.widget();A.disabled=true;if(A.disabled){Element.addClassName(A,this.config.disabledClass)}else{Element.removeClassName(A,this.config.disabledClass)}};itgoldenbrigde.widget.ImageButton.prototype.enable=function(){var A=this.widget();A.disabled=false};itgoldenbrigde.widget.ImageButton._checkIds=[];itgoldenbrigde.widget.ImageButton.removeDisabledChecker=function(){if(!itgoldenbrigde.widget.ImageButton._disabledCheckerTimer){return }window.clearInterval(itgoldenbrigde.widget.ImageButton._disabledCheckerTimer);itgoldenbrigde.widget.ImageButton._disabledCheckerTimer=0};itgoldenbrigde.widget.ImageButton.installDisabledChecker=function(){if(itgoldenbrigde.widget.ImageButton._disabledCheckerTimer){return }Event.onUnload(itgoldenbrigde.widget.ImageButton.removeDisabledChecker);itgoldenbrigde.widget.ImageButton._disabledCheckerTimer=window.setInterval(itgoldenbrigde.widget.ImageButton.disabledChecker,500)};itgoldenbrigde.widget.ImageButton.disabledChecker=function(){function A(C){var B=$(C);if(!B){return }if(B.disabled){Element.addClassName(B,B._disabledClass)}else{Element.removeClassName(B,B._disabledClass)}}itgoldenbrigde.widget.ImageButton._checkIds.forEach(A)};itgoldenbrigde.widget.ImageButton.prototype.mousedown=function(A){var B=this.widget();Element.addClassName(B,this.config.activeClass);Event.observe(B,"mouseout",this._mouseoutHandler);Event.observe(B,"mouseover",this._mouseoverHandler);Event.observe(document,"mouseup",this._mouseupHandler);this._active=true};itgoldenbrigde.widget.ImageButton.prototype.mouseup=function(A){var B=this.widget();Element.removeClassName(B,this.config.activeClass);Event.stopObserving(B,"mouseout",this._mouseoutHandler);Event.stopObserving(B,"mouseover",this._mouseoverHandler);Event.stopObserving(document,"mouseup",this._mouseupHandler);this._active=false};itgoldenbrigde.widget.ImageButton.prototype.mouseover=function(A){if(!this._active){Element.addClassName(this.widget(),this.config.activeClass)}this._active=true};itgoldenbrigde.widget.ImageButton.prototype.mouseout=function(A){if(this._active){Element.removeClassName(this.widget(),this.config.activeClass)}this._active=false};itgoldenbrigde.widget.ImageButtonLinks=function(A){this.config=A;Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.ImageButtonLinks.prototype.init=function(){if(this._initialized){return }this._initialized=true;if(this.config.buttonIds&&this.config.imageIds&&this.config.buttonIds.length==this.config.imageIds.length){for(var C=0;C<this.config.buttonIds.length&&C<this.config.imageIds.length;C++){var B=$(this.config.buttonIds[C]);var E=$(this.config.imageIds[C]);if(B&&E){var A=(function(){this.style.backgroundPosition="bottom left"}).bind(B);var D=(function(){this.style.backgroundPosition="top left"}).bind(B);Event.observe(B,"onmouseover",A);Event.observe(B,"onmouseout",D);Event.observe(E,"onmouseover",A);Event.observe(E,"onmouseout",D)}}}};itgoldenbrigde.widget.LinkManager=function(A){this.setConfig(A);if(coherent.Browser.IE){Event.observe(window,"load",this.init.bind(this))}Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.LinkManager.prototype.constructor=itgoldenbrigde.widget.LinkManager;itgoldenbrigde.widget.LinkManager.DEFAULTS={markerClass:"superlink",hoverClass:"superlink-hover",activeClass:"superlink-active",disclosureClass:"more",disclosureOpenClass:"open",disclosureRegex:/(?:^|\s)disclosure\(([^)]*)\)(?:$|\s)/,popupWidthRegex:(/w(\d+)(-|$)/i),popupHeightRegex:(/h(\d+)(-|$)/i),popupPrefix:"popup-"};itgoldenbrigde.widget.LinkManager.prototype.init=function(){window.setTimeout(this.rescanDocument.bind(this),10);Event.observe(document.body,"DOMNodeInserted",this.documentChanged.bindAsEventListener(this));if(coherent.Browser.IE){Event.observe(window,"resize",this.documentChanged.bindAsEventListener(this))}};itgoldenbrigde.widget.LinkManager.prototype.setConfig=function(B){B=B||{};for(var A=this.constructor;A&&Object!==A;A=A.superclass){Object.applyDefaults(B,A.DEFAULTS||{})}this.config=B};itgoldenbrigde.widget.LinkManager.prototype.rescanDocument=function(){this.manageLinks(document)};itgoldenbrigde.widget.LinkManager.prototype.documentChanged=function(A){if(this._rescanTimer){window.clearTimeout(this._rescanTimer)}this._rescanTimer=window.setTimeout(this.rescanDocument.bind(this),250)};itgoldenbrigde.widget.LinkManager.prototype.getPopupAttributes=function(E){var D={location:(E.indexOf("l")!=-1?"yes":"no"),menubar:(E.indexOf("m")!=-1?"yes":"no"),toolbar:(E.indexOf("t")!=-1?"yes":"no"),status:(E.indexOf("s")!=-1?"yes":"no"),scrollbars:(E.indexOf("!b")!=-1?"no":"yes"),resizable:(E.indexOf("!r")!=-1?"no":"yes")};var B=this.config.popupWidthRegex.exec(E);var F=this.config.popupHeightRegex.exec(E);if(B&&B[1]){D.width=B[1]}if(F&&F[1]){D.height=F[1]}var C=[];for(var A in D){C.push(A+"="+D[A])}return C.join(",")};itgoldenbrigde.widget.LinkManager.prototype.manageLinks=function(J){var O=document.getElementsByTagName("a");if(!O.length){return }var N=this.config.disclosureClass;var D=this.config.disclosureRegex;var L=this.config.disclosureOpenClass;var E=this.config.markerClass;var C=this.config.popupPrefix;var H=document.body;var I=this.mouseOverLink.bindAsEventListener(this);var G=this.mouseOutLink.bindAsEventListener(this);var F=this.mouseDownLink.bindAsEventListener(this);var B=this.parentClicked.bindAsEventListener(this);this.mouseUp=this.mouseUp.bindAsEventListener(this);var M=this.dragStarted.bindAsEventListener(this);function A(Q){var P=Q.parentNode;if(P==H){return null}while(P&&H!=P){if(Element.hasClassName(P,E)){return P}P=P.parentNode}return Q.parentNode}function K(V){var S;var X;var Q;if(V._managed){return }V._managed=true;if(V.target&&C==V.target.slice(0,C.length)){S=this.getPopupAttributes(V.target);V.target=V.target.replace(/[^\w]/g,"");X=this.popupLinkClicked.bindAsEventListener(this,S);Event.observe(V,"click",X)}if(Element.hasClassName(V,N)&&!!(Q=D.exec(V.rel))){var T=$(Q[1]);var U=document.createElement("div");var P=Element.assignId(U);var R=Element.hasClassName(V,L);T.parentNode.replaceChild(U,T);U.appendChild(T);X=this.disclosureLinkClicked.bindAsEventListener(this,P,T);Event.observe(V,"click",X);if(!R){Element.makeClipping(U);U.style.height="0";T.style.height="auto"}}if(!Element.hasClassName(V,E)){return }var W=A(V);if(!W){return }Element.assignId(W);Element.addClassName(W,E);W._linkId=Element.assignId(V);Event.observe(W,"mouseover",I);Event.observe(W,"mouseout",G);Event.observe(W,"mousedown",F);if(S){X=this.parentClicked.bindAsEventListener(this,S);Event.observe(W,"click",X)}else{Event.observe(W,"click",B)}if(coherent.Browser.IE){Event.observe(W,"dragstart",M);Event.observe(W,"selectstart",M)}}Array.forEach(O,K,this)};itgoldenbrigde.widget.LinkManager.prototype.findAnchor=function(B){var A=document.body;while(B&&A!=B){if("_linkId" in B){return null}if("a"==B.tagName.toLowerCase()){return B}B=B.parentNode}return null};itgoldenbrigde.widget.LinkManager.prototype.findLink=function(B){var A=document.body;while(B&&A!=B){if("_linkId" in B){return B}B=B.parentNode}return null};itgoldenbrigde.widget.LinkManager.prototype.mouseOverLink=function(A){var B=this.findLink(A.target||A.srcElement);if(!B){return }if(this._activeLinkId&&this._activeLinkId!=B.id){return }if(this._activeLinkId==B.id){Element.addClassName(B,this.config.activeClass)}else{Element.addClassName(B,this.config.hoverClass)}};itgoldenbrigde.widget.LinkManager.prototype.mouseOutLink=function(A){var B=this.findLink(A.target||A.srcElement);if(!B){return }if(this._activeLinkId&&this._activeLinkId!=B.id){return }if(this._activeLinkId==B.id){Element.removeClassName(B,this.config.activeClass);Element.addClassName(B,this.config.hoverClass)}else{Element.removeClassName(B,this.config.hoverClass)}};itgoldenbrigde.widget.LinkManager.prototype.mouseDownLink=function(A){var B=this.findLink(A.target||A.srcElement);if(!B){return }Event.observe(document,"mouseup",this.mouseUp);this._activeLinkId=B.id;Element.addClassName(B,this.config.activeClass);Element.removeClassName(B,this.config.hoverClass);Event.stop(A)};itgoldenbrigde.widget.LinkManager.prototype.mouseUp=function(A){Event.stopObserving(document,"mouseup",this.mouseUp);var C=$(this._activeLinkId);var B=this.findLink(A.target||A.srcElement);this._activeLinkId=undefined;if(C){Element.removeClassName(C,this.config.activeClass);Element.removeClassName(C,this.config.hoverClass)}this.mouseOverLink(A)};itgoldenbrigde.widget.LinkManager.prototype.popupLinkClicked=function(D,C){if(this._sendingClick){return }var B=this.findAnchor(D.target||D.srcElement);var A=window.open(B.href,B.target||"_blank",C||"");A.focus();Event.stop(D)};itgoldenbrigde.widget.LinkManager.prototype.parentClicked=function(F,E){if(this._sendingClick){return }var G=F.target||F.srcElement;var D=this.findLink(G);if(!D){return }var C=this.findAnchor(G);if(C&&C.id!=D._linkId){return }C=C||$(D._linkId);if(!C){return }Event.stop(F);try{this._sendingClick=true;var A=Event.sendMouseEvent(C,"click",true,true);if(!A){return }if(!coherent.Browser.Safari){var B=window.open(C.href,C.target||"_self",E||"");B.focus()}Event.stop(F)}finally{this._sendingClick=false}};itgoldenbrigde.widget.LinkManager.prototype.dragStarted=function(A){Event.stop(A);return false};itgoldenbrigde.widget.LinkManager.prototype.disclosureLinkClicked=function(B,I,G){function K(L){L=parseInt(L||0,10);if(isNaN(L)){return 0}return L}var E=K(Element.getStyle(G,"border-left-width"))+K(Element.getStyle(G,"border-right-width"));var J=K(Element.getStyle(G,"border-top-width"))+K(Element.getStyle(G,"border-bottom-width"));var A={width:G.scrollWidth+E,height:G.scrollHeight+J};var H=this.findAnchor(B.target||B.srcElement);var D=Element.hasClassName(H,this.config.disclosureOpenClass);var F=$(I);var C;if(this.disclosureAnimator){this.disclosureAnimator.stop()}this.disclosureAnimator=new itgoldenbrigde.fx.Animator();if(D){C=new itgoldenbrigde.fx.Resize(itgoldenbrigde.fx.easeInOutSine,F,{width:A.width,height:0},A);Element.removeClassName(H,this.config.disclosureOpenClass)}else{C=new itgoldenbrigde.fx.Resize(itgoldenbrigde.fx.easeInOutSine,F,A,{width:A.width,height:0});Element.addClassName(H,this.config.disclosureOpenClass)}this.disclosureAnimator.play(C);H.blur();Event.stop(B)};window.gLinkManager=new itgoldenbrigde.widget.LinkManager();itgoldenbrigde.widget.Movie=function(B,A){this.base("constructor")(B,A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.Movie,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.Movie.DEFAULTS={autoplay:true,loop:false,wrapperClass:"movieWrapper"};itgoldenbrigde.widget.Movie.prototype.init=function(){if(!itgoldenbrigde.quicktime.isInstalled()){return }var A;var F=this.widget();var D;if(!F){return }switch(F.tagName.toLowerCase()){case"a":this.config.src=F.href;A=F.parentNode;D=F.getElementsByTagName("img")[0];D=F.removeChild(D);A.replaceChild(D,F);break;case"img":D=F;A=D.parentNode;break;default:console.log("Movie cannot initialise from "+F.tagName+"#"+this.config.id);return }this._posterId=this.config.id+"_poster";this._movieId=this.config.id+"_movie";this.config=Object.applyDefaults(this.config,{width:D.width,height:D.height});var C=document.createElement("div");C.style.visibility="hidden";C.style.position="relative";C.className=this.config.wrapperClass;C.id=F.id;D=A.replaceChild(C,D);D.id=this._posterId;C.appendChild(D);var E={autoplay:false,id:this._movieId};E=Object.applyDefaults(E,this.config);itgoldenbrigde.quicktime.createMovie(E,C);var B={movieId:this._movieId,onload:this.movieLoaded.bind(this)};this.controller=new itgoldenbrigde.widget.MovieController(this.config.controllerId,B);this.controller.hideMovie();C.style.visibility="visible"};itgoldenbrigde.widget.Movie.prototype.movieLoaded=function(D){var F=document.getElementById(this._posterId);var G=this.config.width;var A=this.config.height;var H=this.config.autoplay;var C=this.controller;C.hideMovie();var E=this;function B(){F.style.display="none";C.showMovie(G,A);if(H){D.Play()}}coherent.Animator.setStyles(F,{opacity:0},{duration:500,callback:B,cleanup:true})};itgoldenbrigde.widget.MovieController=function(B,A){this.base("constructor")(B,A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.MovieController,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.MovieController.DEFAULTS={create:false,disabledClass:"disabled",activeClass:"active",loadingClass:"loading",errorClass:"error",playingClass:"playing",pausedClass:"paused",onload:function(){},monitorInterval:500,playButtonSpec:"button"};itgoldenbrigde.widget.MovieController.prototype.init=function(){this._duration=0;this._loading=true;this.monitorProgress();var A=this.widget();if(!A){return }A.style.display="none";Element.addClassName(A,this.config.pausedClass);Element.removeClassName(A,this.config.playingClass);var D=this.part(this.config.playButtonSpec);new itgoldenbrigde.widget.ImageButton(D);Event.observe(D,"click",this.playButtonClicked.bind(this));var C=A.getElementsByTagName("div")[0];this._meterId=Element.assignId(C);this._meterWidth=C.offsetWidth;Event.observe(C,"mousedown",this.meterMouseDown.bind(this));var B=C.getElementsByTagName("span")[0];this._barId=Element.assignId(B)};itgoldenbrigde.widget.MovieController.prototype._getMovie=function(){return $(this.config.movieId)};itgoldenbrigde.widget.MovieController.prototype._updateMeter=function(B){var A=this.widget();if(!A||this._vr){return }B=B||this._getMovie();if(!B){return }try{var C=B.GetRate()}catch(G){return }if(C&&!this._playing){this._playing=true;Element.addClassName(A,this.config.playingClass);Element.removeClassName(A,this.config.pausedClass)}else{if(!C&&this._playing){this._playing=false;Element.addClassName(A,this.config.pausedClass);Element.removeClassName(A,this.config.playingClass)}}if(!this._duration){this._duration=B.GetDuration()}if(!this._duration){return }var E=$(this._meterId);this._meterWidth=E.offsetWidth-4;var D=$(this._barId);if(!D||this._meterWidth<0){return }var F=(B.GetTime()*this._meterWidth/this._duration);if(this._lastLeft==F){return }this._lastLeft=F;D.style.left=F+"px";D.style.width=(this._meterWidth-F+2)+"px"};itgoldenbrigde.widget.MovieController.prototype.monitorProgress=function(){if(itgoldenbrigde.quicktime.mobileSafari){return }var B=this.widget();function C(){var D=this._getMovie();if(!D){return }this._duration=D.GetDuration();this.config.onload(D);this._vr=D.GetIsVRMovie();if(!B){return }if(this._vr){coherent.Animator.setStyles(B,{opacity:0},{duration:250,callback:function(){B.style.display="none"},cleanup:true})}else{Element.setOpacity(B,0);B.style.display="";coherent.Animator.setStyles(B,{opacity:1},{duration:250,cleanup:true})}}function A(){var E=this._getMovie();if(!E){return }try{var D=(E.GetPluginStatus()||"").split(":")[0].toLowerCase();this._updateMeter(E);switch(D){case"playable":case"complete":if(!this._loading){break}this._loading=false;if(B){Element.removeClassName(B,this.config.loadingClass)}window.setTimeout(C.bind(this),10);break;case"error":if(B){Element.removeClassName(B,this.config.loadingClass);Element.addClassName(B,this.config.errorClass)}break;default:break}}catch(F){}}this._monitor=window.setInterval(A.bind(this),this.config.monitorInterval)};itgoldenbrigde.widget.MovieController.prototype.playButtonClicked=function(B){this.part(this.config.playButtonSpec).blur();var A=this._getMovie();if(!A){return }if(A.GetRate()){A.Stop()}else{A.Play()}};itgoldenbrigde.widget.MovieController.prototype._updateTimeoutExpired=function(A){this._updateTimeFromPosition(this._lastPos)};itgoldenbrigde.widget.MovieController.prototype._updateTimeFromPosition=function(D){var A=this._getMovie();if(!A){return }D-=this._baseX;if(D<0){D=0}else{if(D>this._meterWidth){D=this._meterWidth}}var C=$(this._barId);if(C){C.style.left=D+"px";C.style.width=(this._meterWidth-D+2)+"px"}var B=A.GetDuration()*D/this._meterWidth;A.SetTime(B);this._moveTimeout=0};itgoldenbrigde.widget.MovieController.prototype.meterMouseUp=function(B){Event.stopObserving(document,"mouseup",this._mouseUpHandler);Event.stopObserving(document,"mousemove",this._mouseMoveHandler);this._updateTimeFromPosition((B||window.event).clientX);var A=this._getMovie();if(!A){return }if(this._previousRate){A.Play()}};itgoldenbrigde.widget.MovieController.prototype.meterMouseMoved=function(A){this._lastPos=(A||window.event).clientX;this._moveTimeout=this._moveTimeout||window.setTimeout(this._updateHandler,10)};itgoldenbrigde.widget.MovieController.prototype.meterMouseDown=function(B){B=B||window.event;var A=this._getMovie();var C=$(this._meterId);if(!A){return }this._previousRate=A.GetRate();A.Stop();this._baseX=Element.position(C,true).left-document.body.scrollLeft-document.documentElement.scrollLeft;this._updateHandler=this._updateTimeoutExpired.bind(this);this._mouseMoveHandler=this.meterMouseMoved.bind(this);this._mouseUpHandler=this.meterMouseUp.bind(this);Event.observe(document,"mousemove",this._mouseMoveHandler);Event.observe(document,"mouseup",this._mouseUpHandler);Event.stop(B);this._updateTimeFromPosition(B.clientX)};itgoldenbrigde.widget.MovieController.prototype.hideMovie=function(){var B=this._getMovie();if(!B){return }B.width=1;B.height=1;B.style.width="1px";B.style.height="1px";var A=this.widget();if(!A){return }A.style.display="none"};itgoldenbrigde.widget.MovieController.prototype.showMovie=function(C,D){var B=this._getMovie();if(!B){return }B.width=C;B.height=D;B.style.width=C+"px";B.style.height=D+"px";var A=this.widget();if(!A){return }A.style.display=""};itgoldenbrigde.widget.MovieController.prototype.stop=function(){var A=this._getMovie();if(!A){return }A.Stop()};itgoldenbrigde.widget.MovieController.prototype.play=function(){var A=this._getMovie();if(!A){return }A.Play()};itgoldenbrigde.widget.MovieController.prototype.loadMovie=function(D){var B=this._getMovie();if(!B){return }var A=this.widget();if(A){Element.addClassName(A,this.config.loadingClass)}this._loading=true;try{B.Stop();B.SetURL(D);B.SetAutoPlay(false);B.SetControllerVisible(false)}catch(C){console.log("SetURL: "+C.message)}};itgoldenbrigde.widget.PrettySearchField=function(A){this.config=A;if(this.getInput()){this.init()}else{Event.onDomReady(this.init.bind(this))}};itgoldenbrigde.widget.PrettySearchField.prototype.init=function(){if(this.initialized){return }this.initialized=true;if(coherent.Browser.Safari){this.setSafariSearchAttributes();return }var G=this.getInput();var D=this.getResetIconContainer();var E=this.focusHandler.bind(this);var C=this.blurHandler.bind(this);var A=this.keyDownHandler.bind(this);var B=this.keyUpHandler.bind(this);var I=this.mouseUpHandler.bind(this);var F=this.mouseDownHandler.bind(this);var H=this.mouseOutHandler.bind(this);Event.observe(G,"onfocus",E);Event.observe(G,"onblur",C);Event.observe(G,"onkeydown",A);Event.observe(G,"onkeyup",B);Event.observe(D,"onmousedown",F);Event.observe(D,"onmouseup",I);Event.observe(D,"onmouseout",H);this.setSearchAttributes()};itgoldenbrigde.widget.PrettySearchField.prototype.focusHandler=function(B){var A=this.getInput();Element.addClassName(this.getContainer(),"focused");if(A.value==this.getPlaceholder()){A.value=""}if(coherent.Browser.IE){A.setAttribute("maxLength",this.getMaxLength())}else{A.setAttribute("maxlength",this.getMaxLength())}};itgoldenbrigde.widget.PrettySearchField.prototype.blurHandler=function(B){var A=this.getInput();Element.removeClassName(this.getContainer(),"focused");if(coherent.Browser.IE){A.setAttribute("maxLength","")}else{A.setAttribute("maxlength","")}if(!A.value.length){A.value=this.getPlaceholder()}};itgoldenbrigde.widget.PrettySearchField.prototype.keyDownHandler=function(B){var A=this.getInput();if(Event.isAlphaNumKey(B.keyCode)){this.show(this.getResetIconContainer())}};itgoldenbrigde.widget.PrettySearchField.prototype.keyUpHandler=function(B){var A=this.getInput();if(B.keyCode==Event.KEY_ESC){A.value=""}if(!A.value.length){this.hide(this.getResetIconContainer())}};itgoldenbrigde.widget.PrettySearchField.prototype.mouseDownHandler=function(A){Element.addClassName(this.getResetIconContainer(),"down")};itgoldenbrigde.widget.PrettySearchField.prototype.mouseUpHandler=function(C){var B=this.getResetIconContainer();var A=this.getInput();this.hide(B);Element.removeClassName(B,"down");A.blur();A.value="";A.focus()};itgoldenbrigde.widget.PrettySearchField.prototype.mouseOutHandler=function(A){Element.removeClassName(this.getResetIconContainer(),"down")};itgoldenbrigde.widget.PrettySearchField.prototype.setSafariSearchAttributes=function(){var B=this.config.results;var A=this.getInput();var C=this.getPlaceholder();if(B){A.setAttribute("results",B)}A.setAttribute("maxlength",this.getMaxLength());A.setAttribute("type","search");A.setAttribute("placeholder",C);A.setAttribute("autosave",this.getAutosave());Element.addClassName(A,"safari");Element.addClassName(this.getContainer(),"safari");if(A.getAttribute("value")==C){A.setAttribute("value","");A.value=""}};itgoldenbrigde.widget.PrettySearchField.prototype.setSearchAttributes=function(){var A=this.getInput();A.setAttribute("maxlength","");A.value=this.getPlaceholder();if(A.value!=this.getPlaceholder()){this.show(this.getResetIconContainer())}Element.addClassName(A,"nonsafari");Element.addClassName(this.getContainer(),"nonsafari")};itgoldenbrigde.widget.PrettySearchField.prototype.getMaxLength=function(){return this.config.maxLength};itgoldenbrigde.widget.PrettySearchField.prototype.getPlaceholder=function(){return this.config.placeholder};itgoldenbrigde.widget.PrettySearchField.prototype.getAutosave=function(){return this.config.autosave};itgoldenbrigde.widget.PrettySearchField.prototype.getContainer=function(){return $(this.config.containerId)};itgoldenbrigde.widget.PrettySearchField.prototype.getInput=function(){return $(this.config.inputId)};itgoldenbrigde.widget.PrettySearchField.prototype.getResetIconContainer=function(){return $(this.config.resetIconId)};itgoldenbrigde.widget.PrettySearchField.prototype.hide=function(A){$(A).style.display="none"};itgoldenbrigde.widget.PrettySearchField.prototype.show=function(A){$(A).style.display="block"};itgoldenbrigde.widget.ProductCluster=function(A){this.config=A;this.resetPages();function B(){window.clearInterval(this._firefoxTimer)}function C(){Event.onUnload(B.bind(this));this._firefoxTimer=window.setInterval(this.checkScroll.bind(this),2000)}if(coherent.Browser.Mozilla){Event.onDomReady(C.bind(this))}Event.observe(window,"scroll",this.checkScroll.bind(this));Event.observe(window,"load",this.checkScroll.bind(this))};itgoldenbrigde.widget.ProductCluster.prototype.encodeURL=function(D,A){if(!A){A=this.config.baseURL}for(var B in D){var C=D[B];if(C&&C.length){if(A.indexOf("?")>0){A+="&"+B+"="+C}else{A+="?"+B+"="+C}}}return A};itgoldenbrigde.widget.ProductCluster.prototype.gotoPage=function(F,E,D,C){var B=this.encodeURL({p:F,f:E,s:D,n:C});var A=this;itgoldenbrigde.io.json.invoke({url:B,success:function(G){A.switchContent(A.config.contentId,G)}});return false};itgoldenbrigde.widget.ProductCluster.prototype.sort=function(E,D,C){var B=this.encodeURL({f:E,s:D,n:C});var F=$("product-loading-sort");if(F){F.style.display="inline"}var A=this;itgoldenbrigde.io.json.invoke({url:B,success:function(G){A.config.sort=D;A.switchContent(A.config.contentId,G);if(F){F.style.display="none"}}});return false};itgoldenbrigde.widget.ProductCluster.prototype.gotoNode=function(D,C){var B=this.encodeURL({n:D,s:C});var E=$("product-loading-filter");if(E){E.style.display="inline"}var A=this;itgoldenbrigde.io.json.invoke({url:B,success:function(F){A.config.childNode=D;A.config.sort=C;A.switchContent(A.config.contentId,F);if(E){E.style.display="none"}}});return false};itgoldenbrigde.widget.ProductCluster.prototype.gotoFilter=function(E,D,C){var B=this.encodeURL({f:E,s:C,n:D});var A=this;itgoldenbrigde.io.json.invoke({url:B,success:function(F){A.config.filter=E;A.config.sort=C;A.config.childNode=D;A.switchContent(A.config.contentId,F)}});return false};itgoldenbrigde.widget.ProductCluster.prototype.resetPages=function(){this.checkingScroll=false;this.pagePositions=new Array();this.loadedPages=new Array()};itgoldenbrigde.widget.ProductCluster.prototype.loadPage=function(C){if(this.loadedPages[C]){return }this.loadedPages[C]=1;var B=this.encodeURL({p:""+C,f:this.config.filter,s:this.config.sort,n:this.config.childNode},this.config.pageURL);var A=this;itgoldenbrigde.io.json.invoke({url:B,success:function(F){var D=A.config.pageIdPrefix+C+A.config.pageIdSuffix;var E=A.config.pageIdPrefix+C;A.switchContent(D,F);C=$(E);var H=$(D);var G=function(){if(Element.getMarginBox(C).height<Element.getMarginBox(H).height){var I=Element.getMarginBox(H);I.height++;Element.setMarginBox(C,I)}};Element.setOpacity(H,0);H.style.display="";coherent.Animator.setStyles(H,{opacity:1},{duration:600,cleanup:true,callback:G})}})};itgoldenbrigde.widget.ProductCluster.prototype.checkScroll=function(){if(this.checkingScroll){return }this.checkingScroll=true;var B=Element.getScrollOffset().top;var E=B+Element.getViewport().height;var D=E+this.config.scrollBuffer;var C=B-this.config.scrollBuffer;for(var F=this.config.pages-1;F>=1;F--){var A=this.config.pageIdPrefix+F;if(!this.pagePositions[F]){var H=$(A);if(H){this.pagePositions[F]=Element.position(H).top}}var G=Element.getMarginBox($(A));if(C<=this.pagePositions[F]+G.height&&D>=this.pagePositions[F]){this.loadPage(F)}}this.checkingScroll=false};itgoldenbrigde.widget.ProductCluster.prototype.setupEmptyPages=function(N,D,E,C,F,H){this.config.pages=D;this.resetPages();var G="";if(this.config.loadingIconUrl){G='<img class="product-loading-tile" src="'+this.config.loadingIconUrl+'">'}var K="";for(var B=1;B<this.config.pages;B++){K+='<div class="product-page" id="'+this.config.pageIdPrefix+B+'">\n';K+='<div class="product-page-grid hidden" id="'+this.config.pageIdPrefix+B+this.config.pageIdSuffix+'"></div>\n';var I=C;if(B==this.config.pages-1){I=F}var J;for(var A=0;A<I;A++){J=(((B-1)*C+A) in H);if(A==I-1&&B==this.config.pages-1){K+='<ul class="product-row last-row'}else{K+='<ul class="product-row'}K+=J?' has-specials">':'">';K+='<li class="product first-tile">'+G+"</li>";for(var L=1;L<E-1;L++){K+='<li class="product">'+G+"</li>"}K+='<li class="product last-tile">'+G+"</li>";K+="</ul>\n"}K+="</div>\n"}var M=$(N);M.innerHTML=K};itgoldenbrigde.widget.ProductCluster.prototype.switchContent=function(A,C){if(C.body.content){var B=$(A);B.innerHTML=C.body.content}};itgoldenbrigde.widget.ProductFilter=function(B,A){this.base("constructor")(B,A);this._expanded=false;this._filters=[];this._selectionIndex=-1};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.ProductFilter,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.ProductFilter.DEFAULTS={expandedClass:"expanded",controlSpec:".controls",expandLinkSpec:".expand_link",secondaryFilterClass:"secondary",contractLinkSpec:".contract_link",selectedClass:"selected",filterListSpec:"ul.filterItems",animateDuration:50};itgoldenbrigde.widget.ProductFilter.prototype.init=function(){var F=this.widget();var E=this.part(this.config.filterListSpec);var B=this.part(this.config.controlSpec);if(!F||!E||!B){return }B.style.display="block";this._expanded=Element.hasClassName(F,this.config.expandedClass);this._animator=new itgoldenbrigde.fx.Animator;var A=this.part(this.config.expandLinkSpec);var C=this.part(this.config.contractLinkSpec);if(!A||!C){return }Event.observe(A,"click",this.expandLinkClicked.bindAsEventListener(this));Event.observe(C,"click",this.contractLinkClicked.bindAsEventListener(this));var D=this.filterClicked.bindAsEventListener(this);Event.observe(E,"click",D);function G(I,H){this._filters.push(Element.assignId(I));if(Element.hasClassName(I,this.config.selectedClass)){this._selectionIndex=H}I.filterIndex=H;if(this._expanded||Element.hasClassName(I,this.config.selectedClass)||!Element.hasClassName(I,this.config.secondaryFilterClass)){return }I.style.display="none"}Array.forEach(E.getElementsByTagName("li"),G,this)};itgoldenbrigde.widget.ProductFilter.prototype.expandFilters=function(I){var D=[];var E=this.widget();var G=this.part(this.config.filterListSpec);var B=G.getElementsByTagName("li")[0].offsetWidth;function H(J,L){var N=$(J);if(L==this._selectionIndex||Element.hasClassName(N,this.config.selectedClass)||!Element.hasClassName(N,this.config.secondaryFilterClass)){return }N.style.width=B+"px";N.style.height="auto";var M=Element.getDimensions(N);N.style.width="";var K=new itgoldenbrigde.fx.Resize(itgoldenbrigde.fx.easeInOutSine,N,M,{width:B,height:0});var O=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,N,0,1);D.push(new itgoldenbrigde.fx.Blend(K,O))}var A=this.part(this.config.expandLinkSpec);var F=this.part(this.config.contractLinkSpec);A.style.visibility="hidden";F.style.visibility="hidden";this._filters.forEach(H,this);if(!D.length){return }function C(){A.style.visibility="";F.style.visibility="";Element.addClassName(E,this.config.expandedClass);this._expanded=true;if(I){I()}}this._animator.setDuration(D.length*this.config.animateDuration);this._animator.play(new itgoldenbrigde.fx.Chain(D),C.bind(this))};itgoldenbrigde.widget.ProductFilter.prototype.contractFilters=function(I){var D=[];var E=this.widget();var G=this.part(this.config.filterListSpec);var B=G.getElementsByTagName("li")[0].clientWidth;function H(J,L){var N=$(J);if(L==this._selectionIndex||Element.hasClassName(N,this.config.selectedClass)||!Element.hasClassName(N,this.config.secondaryFilterClass)){return }N.style.width=B+"px";var M=Element.getDimensions(N);N.style.width="";var K=new itgoldenbrigde.fx.Resize(itgoldenbrigde.fx.easeInOutSine,N,{width:B,height:0},M);var O=new itgoldenbrigde.fx.Fade(itgoldenbrigde.fx.linearTween,N,1,0);D.push(new itgoldenbrigde.fx.Blend(K,O))}var A=this.part(this.config.expandLinkSpec);var F=this.part(this.config.contractLinkSpec);A.style.visibility="hidden";F.style.visibility="hidden";this._filters.forEach(H,this);if(!D.length){return }function C(){A.style.visibility="";F.style.visibility="";Element.removeClassName(E,this.config.expandedClass);this._expanded=false;if(I){I()}}this._animator.setDuration(D.length*this.config.animateDuration);this._animator.play(new itgoldenbrigde.fx.Chain(D),C.bind(this))};itgoldenbrigde.widget.ProductFilter.prototype.selectFilter=function(A){if(A==this._selectionIndex){return }var B=this._filters[this._selectionIndex];var C=this._filters[A];this._selectionIndex=A;if(B){Element.removeClassName($(B),this.config.selectedClass)}if(C){Element.addClassName($(C),this.config.selectedClass)}};itgoldenbrigde.widget.ProductFilter.prototype.expandLinkClicked=function(A){var B=A.target||A.srcElement;B.blur();Event.stop(A);this.expandFilters()};itgoldenbrigde.widget.ProductFilter.prototype.contractLinkClicked=function(A){var B=A.target||A.srcElement;B.blur();Event.stop(A);this.contractFilters()};itgoldenbrigde.widget.ProductFilter.prototype.findFilterNode=function(A){var B=this.widget();while(A!=B&&!("filterIndex" in A)){A=A.parentNode}if(!("filterIndex" in A)){return null}return A};itgoldenbrigde.widget.ProductFilter.prototype.filterClicked=function(A){var C=A.target||A.srcElement;C.blur();Event.stop(A);var B=this.findFilterNode(C);if(!B){return }this.selectFilter(B.filterIndex);if(this._expanded){this.contractFilters(this.filterContent.bind(this))}else{this.filterContent()}};itgoldenbrigde.widget.ProductFilter.prototype.filterContent=function(){var B=$(this._filters[this._selectionIndex]);if(!B){return }var A=B.getElementsByTagName("a")[0];if(!A){return }window.open(A.href,"_self")};itgoldenbrigde.widget.SmartTextField=function(A){this.textAreaNodeId=A.textAreaElementId;this.errNodeId=A.errDivElementId;this.checkServerURL=A.checkServerURL;this.sid=A.sid;this.partNumber=A.partNumber;this.inFlight=false;this.resubmit=false;this.serverError="";this.wrappedText="";this.previewDivId="";this.timer=-1;this.cancelledRequest=false;$(this.textAreaNodeId).stf=this;Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.SmartTextField.prototype.init=function(){var A=$(this.textAreaNodeId);var C=null;var B=(function(D){if(C){window.clearTimeout(C)}C=this.afterKeypress.bindAndDelay(this,1000,D)}).bind(this);Event.observe(A,"keyup",B)};itgoldenbrigde.widget.SmartTextField.prototype.checkServer=function(){this.timer=-1;this.inFlight=true;this.resubmit=false;var E=this;if(this.checkServerURL){var D=function(F){if(!E.cancelledRequest){if(F!="BAD REQUEST"&&F.substring(0,6)!="<html>"){E.inFlight=false;E.serverError="";if(E.resubmit){E.resubmit=false;E.checkServerSoon()}if(F.substr(0,2)!="OK"){E.serverError=F}if(F.substr(0,3)=="OK:"){E.wrappedText=F.substring(3);if(E.previewDivId){$(E.previewDivId).innerHTML=E.wrappedText}}E.showError()}}};var A=function(F){return };var C={mt:$(E.textAreaNodeId).value,pn:this.partNumber,wosid:this.sid};var B=XHR.post(this.checkServerURL,C);B.addMethods(D,A)}};itgoldenbrigde.widget.SmartTextField.prototype.checkServerSoon=function(){this.cancelledRequest=false;if(!this.inFlight){if(this.timer!=-1){window.clearTimeout(this.timer)}var A=this;this.timer=window.setTimeout(function(){A.checkServer()},500)}else{this.resubmit=true}};itgoldenbrigde.widget.SmartTextField.prototype.afterKeypress=function(A){this.checkServerSoon();return };itgoldenbrigde.widget.SmartTextField.prototype.showError=function(){var A=$(this.errNodeId);A.innerHTML=this.serverError.replace(/</,"&lt;")};itgoldenbrigde.widget.SmartTextField.prototype.setPreviewDivId=function(A){this.previewDivId=A};itgoldenbrigde.widget.SmartTextField.prototype.cancelRequest=function(){this.cancelledRequest=true;this.inFlight=false;this.resubmit=false};itgoldenbrigde.widget.SyncContent=function(A){this.config=A;this.change()};itgoldenbrigde.widget.SyncContent.prototype.getContent=function(){var A=null;var B=(function(C){if(C.body&&C.body.content){A=C.body.content}}).bind(this);itgoldenbrigde.io.json.invoke({url:this.getUrl(),sync:true,success:B,scriptKeys:["content"]});return A};itgoldenbrigde.widget.SyncContent.prototype.change=function(){var A=this.getContent();if(A){document.write(A)}};itgoldenbrigde.widget.SyncContent.prototype.getUrl=function(){return this.config.url};itgoldenbrigde.widget.TabController=function(A){this.base("constructor")(A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.TabController,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.TabController.DEFAULTS={activeClass:"active",inactiveClass:"inactive",transition:"swapfade",animate:false,autoAdvance:false};itgoldenbrigde.widget.TabController.ADVANCE_DELAY=6000;itgoldenbrigde.widget.TabController.prototype.init=function(){var B=document.getElementById(this.config.contentId);var A=this.tabContentIdFromTabId(this.config.selectedTabId);if(!document.getElementById(A)){var H=document.createElement("div");H.id=this.config.contentId;H.className=B.className;B.id=A;B.className="";B=B.parentNode.replaceChild(H,B);H.appendChild(B)}var G={id:this.config.contentId,duration:500,transition:this.config.transition};this._swapper=new itgoldenbrigde.fx.ContentSwapper(G);var F=window.location.hash.match(/^#tab(\d+)$/);var D;this.config.tabIds=[];for(var C in this.config.tabs){this.config.tabIds.push(C)}if(F&&F[1]){F=parseInt(F[1],10)-1;for(var E in this.config.tabs){D=E.match(/(\d+)$/);if(!D||D[1]!=F){continue}this.selectTab(E);break}}this.resume()};itgoldenbrigde.widget.TabController.prototype.calculateTabHeights=function(G){var B=document.getElementById(G);var A=document.createElement("li");A.innerHTML='<a href="#"><strong>one line</strong></a>';B.appendChild(A);var D=parseInt(Element.getStyles(A.getElementsByTagName("strong")[0],"height"),10);B.removeChild(A);var I=B.getElementsByTagName("strong");var E=I.length;for(var C=0,F,H;C<E;C++){F=I[C];H=parseInt(Element.getStyles(F,"height"),10);if(H>D){Element.addClassName(F.parentNode.parentNode,"two-line")}}};itgoldenbrigde.widget.TabController.prototype.assignWrapper=function(A){this.config.wrapperId=A;var B=document.getElementById(A);if(B){Event.observe(B,"mouseover",this.pause.bindAsEventListener(this));Event.observe(B,"mouseout",this.resume.bindAsEventListener(this))}};itgoldenbrigde.widget.TabController.prototype.pause=function(A){if(!this.config.autoAdvance){return }this.paused=true;if(this.timer){window.clearTimeout(this.timer)}this.timer=null};itgoldenbrigde.widget.TabController.prototype.resume=function(A){if(!this.config.autoAdvance){return }if(A){this.paused=false}if(this.timer){window.clearTimeout(this.timer)}this.timer=this.showNextTab.bindAndDelay(this,itgoldenbrigde.widget.TabController.ADVANCE_DELAY)};itgoldenbrigde.widget.TabController.prototype.showNextTab=function(){if(this.paused||this.locked){return }var A=this.config.selectedTabId;var C=this.config.tabIds;var B=C.indexOf(A);if(B==C.length-1){B=0}else{B++}this.selectTab(C[B])};itgoldenbrigde.widget.TabController.prototype.preloadNextTab=function(){var A=this.config.selectedTabId;var G=this.config.tabIds;var D=G.indexOf(A);if(D==G.length-1){D=0}else{D++}var C=G[D];if(document.getElementById(this.tabContentIdFromTabId(C))){return }function F(I){if(!I||!I.body){return }var H=coherent.Scripts.extract(I.body.content);this.insertTabContent(C,H)}var B=this.config.tabContentUrl||this.config.tabs[C];B=itgoldenbrigde.util.expandTemplate(B,{tabId:C});var E={url:B,success:F.bind(this),scriptKeys:["content"]};itgoldenbrigde.io.json.invoke(E)};itgoldenbrigde.widget.TabController.prototype.tabContentIdFromTabId=function(A){return[this.config.contentId,A].join("_")};itgoldenbrigde.widget.TabController.prototype.insertTabContent=function(B,C){if(document.getElementById(this.tabContentIdFromTabId(B))){return null}var A=document.getElementById(this.config.contentId);var D=document.createElement("div");D.id=this.tabContentIdFromTabId(B);D.innerHTML=C;D.style.display="none";A.appendChild(D);return D};itgoldenbrigde.widget.TabController.prototype.activateTab=function(B){var E;var D;var A;if(this.config.selectedTabId){E=document.getElementById(this.config.selectedTabId);if(!this.config.animate){Element.removeClassName(E,this.config.activeClass);Element.addClassName(E,this.config.inactiveClass)}D=this.tabContentIdFromTabId(this.config.selectedTabId)}this.config.selectedTabId=B;if(B){E=document.getElementById(B);if(this.config.animate){coherent.Animator.replaceClassName(E,this.config.inactiveClass,this.config.activeClass,{duration:250,curve:coherent.easing.outSine})}else{Element.removeClassName(E,this.config.inactiveClass);Element.addClassName(E,this.config.activeClass)}A=this.tabContentIdFromTabId(B)}var F=this;function C(){F.locked=false;F.resume();document.getElementById(A).style.zoom=1;if(F.config.autoAdvance){F.preloadNextTab()}}this._swapper.swap(this.config.transition,D,A,C)};itgoldenbrigde.widget.TabController.prototype.selectTab=function(C){if(this.locked){return }if(this.config.selectedTabId==C){return }var A=this.tabContentIdFromTabId(C);if(this.timer){window.clearTimeout(this.timer);this.timer=null}this.locked=true;if(this.config.selectedTabId){var D=document.getElementById(this.config.selectedTabId);if(this.config.animate){coherent.Animator.replaceClassName(D,this.config.activeClass,this.config.inactiveClass,{duration:250,curve:coherent.easing.inSine})}}if(document.getElementById(A)){this.activateTab(C);return }function F(H){if(this.config.selectedTabId==C){return }if(!H||!H.body){return }var G=coherent.Scripts.extract(H.body.content);this.insertTabContent(C,G);this.activateTab(C)}var B=this.config.tabContentUrl||this.config.tabs[C];B=itgoldenbrigde.util.expandTemplate(B,{tabId:C});var E={url:B,success:F.bind(this),scriptKeys:["content"]};itgoldenbrigde.io.json.invoke(E)};itgoldenbrigde.widget.TextField=function(B,A){this.base("constructor")(B,A)};itgoldenbrigde.util.makeSubclass(itgoldenbrigde.widget.TextField,itgoldenbrigde.widget.BaseWidget);itgoldenbrigde.widget.TextField.DEFAULTS={placeholder:"No Value",placeholderClass:"placeholder"};itgoldenbrigde.widget.TextField.prototype.init=function(){var B=this.widget();Event.observe(B,"focus",this.fieldReceivedFocus.bindAsEventListener(this));Event.observe(B,"blur",this.fieldLostFocus.bindAsEventListener(this));this._maxLength=B.maxLength||-1;var A=(B.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(""!==A){return }B.maxLength=this.config.placeholder.length;B.value=this.config.placeholder;Element.addClassName(B,this.config.placeholderClass)};itgoldenbrigde.widget.TextField.prototype.fieldReceivedFocus=function(A){var C=this.widget();var B=(C.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(this.config.placeholder===B){C.value=""}if(-1!=this._maxLength){C.maxLength=this._maxLength}else{C.removeAttribute("maxLength")}Element.removeClassName(C,this.config.placeholderClass)};itgoldenbrigde.widget.TextField.prototype.fieldLostFocus=function(A){var C=this.widget();var B=(C.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(""!==B){return }Element.addClassName(C,this.config.placeholderClass);this._maxLength=C.maxLength||-1;C.maxLength=this.config.placeholder.length;C.value=this.config.placeholder};itgoldenbrigde.widget.VoteController=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS);Event.onDomReady(this.init.bind(this))};itgoldenbrigde.widget.VoteController.prototype.DEFAULTS={voteYesValue:1,voteNoValue:0,voteClass:"vote",voteYesClass:"yes",voteNoClass:"no",messageClass:"useful",reviewIdRegex:/-(\w+)$/,fadeDuration:200};itgoldenbrigde.widget.VoteController.prototype.init=function(){var A=document.getElementById(this.config.elementId);if(!A){return }this.attachVoteEvents(Element.getElementsByClassName(this.config.voteYesClass,A),this.voteYes.bindAsEventListener(this));this.attachVoteEvents(Element.getElementsByClassName(this.config.voteNoClass,A),this.voteNo.bindAsEventListener(this))};itgoldenbrigde.widget.VoteController.prototype.attachVoteEvents=function(B,C){function A(D){Event.observe(D,"click",C)}Array.forEach(B,A)};itgoldenbrigde.widget.VoteController.prototype.voteYes=function(A){var B=(A.srcElement||A.target);Event.stop(A);this.sendVote(B,this.config.voteYesValue)};itgoldenbrigde.widget.VoteController.prototype.voteNo=function(A){var B=(A.srcElement||A.target);Event.stop(A);this.sendVote(B,this.config.voteNoValue)};itgoldenbrigde.widget.VoteController.prototype.sendVote=function(D,B){var C=this.getVoteElem(D);var A=this.getReviewId(C);if(A){itgoldenbrigde.io.json.invoke({url:this.config.requestUrl,urlArgs:{reviewId:A,vote:B}})}this.displayFeedbackMessage(D)};itgoldenbrigde.widget.VoteController.prototype.displayFeedbackMessage=function(F){var D=this.getMessageElem(F);var E=this.getVoteElem(F);var G=this.config.feedbackMessage;var B=this.config.fadeDuration;var C=function(){D.innerHTML=G;D.parentNode.removeChild(D);E.innerHTML="";E.appendChild(D);Element.setOpacity(E,0);coherent.Animator.setStyles(E,{opacity:1},{duration:B,cleanup:true})};var A=parseInt(Element.getStyles(E,"height"),10);if(!isNaN(A)){E.style.height=Math.max(A,0)+"px"}coherent.Animator.setStyles(E,{opacity:0},{duration:B,callback:C})};itgoldenbrigde.widget.VoteController.prototype.getVoteElem=function(B){var C=this.config.voteClass;var A=B.parentNode;while(A&&A!=document.body){if(A.className==C){return A}A=A.parentNode}return null};itgoldenbrigde.widget.VoteController.prototype.getMessageElem=function(C){var A=null;var B=this.getVoteElem(C);var D=Element.getElementsByClassName(this.config.messageClass,B);if(D&&D.length>0){A=D[0]}return A};itgoldenbrigde.widget.VoteController.prototype.getReviewId=function(B){if(!B||!B.id){return null}var A=null;var C=this.config.reviewIdRegex.exec(B.id);if(C&&C.length>1){A=C[1]}return A};itgoldenbrigde.widget.EngravedPod=Class.create(coherent.View,{exposedBindings:["engravingText","productId","picassoUrl","backgroundImage"],innerHTML:'<img class="engraving" src="">',__structure__:{"img.background":coherent.ImageView({srcBinding:"backgroundImage"}),"img.engraving":coherent.ImageView({srcBinding:"engravedImage",visibleBinding:"pending(not)"})},keyDependencies:{prepareEngravedImage:["picassoUrl","language","productId","encoding","backgroundImage","engravingText"]},language:"en",c:"d",productId:"",encoding:"UTF8",backgroundImage:"",init:function(){},prepareEngravedImage:function(){if(!this.backgroundImage||!this.productId||!this.encoding||!this.language){return }if(this.__imageTimer){window.clearTimeout(this.__imageTimer);this.__imageTimer=null}var C=this.backgroundImage.match(/(http:\/\/.*?itgoldenbrigde\.com)?(\/.*)$/);var E=this.picassoUrl.match(/(http:\/\/.*?itgoldenbrigde\.com)(\/.*)$/);var A=(this.engravingText||"").split("\n");var B={l:this.language,c:this.c,r:this.productId,i:C&&C[2],p:this.encoding,th:A[0]||"",tl:A[1]||""};this.setValueForKey(true,"pending");var D=[(C[1]||"")+E[2],Object.toQueryString(B)].join("?");this.__imageTimer=window.setTimeout(function(){this.setValueForKey(D,"engravedImage");this.setValueForKey(false,"pending")}.bind(this),50)}});itgoldenbrigde.EngravingGalleryController=Class.create(coherent.ViewController,{__structure__:{"div.tabs ul":coherent.ListView({selectedIndexBinding:"selectedTabIndex",animated:"true",action:"noop"}),"div.preview":itgoldenbrigde.widget.EngravedPod({picassoUrlBinding:"picassoUrl",classBinding:"viewClass",productIdBinding:"selectedProduct.productId",backgroundImageBinding:"selectedVariation.backer",engravingTextBinding:"engravingText"}),"ul.ipod-list":coherent.ListView({contentBinding:"products",selectedObjectBinding:"selectedProduct",visibleBinding:"showProducts",action:"noop"}),"ul.ipod-list a":coherent.Anchor({titleBinding:"*.title"}),"ul.ipod-list img":coherent.ImageView({altBinding:"*.productId",srcBinding:"*.productImage"}),"ul.variations":coherent.ListView({contentBinding:"productVariations",selectedObjectBinding:"selectedVariation",visibleBinding:"showVariations",action:"noop"}),"ul.variations a":coherent.Anchor({titleBinding:"*.label",classBinding:"selectedProduct.productId"}),"ul.variations span":coherent.Anchor({textBinding:"*.label",classBinding:"*.swatch"}),"div.engravings":coherent.ListView({contentBinding:"engravings",selectedIndexBinding:"selectedTabIndex",animated:"true",action:"noop"}),"div.engravings ul":coherent.ListView({contentBinding:"*.content",selectedObjectBinding:"*.selectedEngraving",action:"noop"}),"div.engravings ul a":coherent.View({htmlBinding:"*.text"})},keyDependencies:{viewClass:["selectedVariation","selectedProduct","engravings"],showVariations:["productVariations"],engravingText:["selectedTabIndex"]},init:function(){Array.forEach(Element.queryAll("div.engravings ul"),function(B){Array.forEach(B.getElementsByTagName("li"),function(C,D){Element.addClassName(C,"item"+(D+1))})});var A=Element.query(this.viewElement(),"ul.ipod-list li");if(A){A.style.display="none"}this.addObserverForKeyPath(this,"observeSelectedEngravingChange","engravings.selectedEngraving")},selectedTabIndex:function(){return this.__selectedTabIndex},setSelectedTabIndex:function(B){if(!this.engravings){return(this.__selectedTabIndex=B)}var D=this.engravings;var A=B==D.length-1;var E=this.__selectedTabIndex==D.length-1;this.__selectedTabIndex=B;if(A){this.setSelectedProduct(this.products[0])}else{if(E){this.setSelectedProduct(this.products[1])}}var C=D[this.__selectedTabIndex];if(!C.selectedEngraving){C.setValueForKey(C.content[0],"selectedEngraving")}else{this.updateEngravingText(C.selectedEngraving)}return B},selectedProduct:function(){return this.__selectedProduct},setSelectedProduct:function(B){this.willChangeValueForKey("productVariations");this.__selectedProduct=B;this.didChangeValueForKey("productVariations");var A=!(B==this.products[0]);this.setValueForKey(A,"showProducts");var C=this.productVariations();this.setValueForKey(C[0],"selectedVariation");return B},updateEngravingText:function(C){var A=C.text||"";var B=A.split(/<\s*br\s*\/?>/i).map(function(D){return D.trim()}).join("\n");this.setValueForKey(B,"engravingText")},observeSelectedEngravingChange:function(A){if(1!==A.indexes.length){return }this.updateEngravingText(A.newValue[0])},viewClass:function(){if(!this.__selectedProduct){return"preview"}if(!this.selectedVariation){return"preview "+this.__selectedProduct.productId}var A=this.__selectedProduct.productId+"_"+this.selectedVariation.swatch;return["preview",this.__selectedProduct.productId,A].join(" ")},showVariations:function(){var A=this.productVariations();return A.length>1},productVariations:function(){if(!this.__selectedProduct||!this.productData){return[]}var A=this.__selectedProduct.productId;return this.productData[A]||[]},noop:function(A,B){Event.stop(B)},setInitialSelections:function(B){var A=this.products[B.selectedProduct||1];this.setSelectedProduct(A);var C=this.productVariations();this.setValueForKey(C[B.selectedVariationIndex||0],"selectedVariation");this.setSelectedTabIndex.bindAndDelay(this,1000,B.selectedTab)}});