if(APE!==undefined){throw Error("APE is already defined.")}var APE={extend:function(a,e,b){if(arguments.length===0){return}var d=arguments.callee,c;d.prototype=e.prototype;a.prototype=c=new d;if(typeof b=="object"){APE.mixin(c,b)}c.constructor=a;return a},mixin:function(e,d){var c=["toString","valueOf"],f,b=0,a;for(f in d){if(d.hasOwnProperty(f)){e[f]=d[f]}}for(;b<c.length;b++){a=c[b];if(d.hasOwnProperty(a)){e[a]=d[a]}}return e},toString:function(){return"[APE JavaScript Library]"},getByNode:function(a){var c=a.id,b;if(!c){if(!APE.getByNode._i){APE.getByNode._i=0}b=APE.getFunctionName(this);if(!b){b="APE"}c=a.id=b+"_"+(APE.getByNode._i++)}if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[c]||(this.instances[c]=APE.newApply(this,arguments))},getFunctionName:function(a){if(typeof a.name=="string"){return a.name}var b=Function.prototype.toString.call(a).match(/\s([a-z]+)\(/i);return b&&b[1]||""},getById:function(a){if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[a]||(this.instances[a]=APE.newApply(this,arguments))},createFactory:function(a){var c=a.instances={};return b;function b(d){return c[d]||(c[d]=APE.newApply(a,arguments))}},newApply:(function(){function b(){}return a;function a(e,c){var d;b.prototype=e.prototype;b.prototype.constructor=e;d=new b;e.apply(d,c);return d}})(),deferError:function(a){setTimeout(function(){throw a},1)}};(function(){APE.namespace=a;function a(g){var h=g.split("."),e=window,k=Object.prototype.hasOwnProperty,j=e.qualifiedName,f=0,c=h.length,d;for(;f<c;f++){d=h[f];if(!k.call(e,d)){e[d]=new b((j||"APE")+"."+d)}e=e[d]}return e}b.prototype.toString=function(){return"["+this.qualifiedName+"]"};function b(c){this.qualifiedName=c}})();(function(){var b=Object.prototype,a=b.hasOwnProperty;if(typeof window!="undefined"&&a&&!a.call(window,"Object")){Object.prototype.hasOwnProperty=function(c){if(this===window){return(c in this)&&(b[c]!==this[c])}return a.call(this,c)}}})();APE.namespace("APE.dom");(function(){APE.mixin(APE.dom,{hasToken:e,removeClass:i,addClass:f,getElementsByClassName:j,findAncestorWithClass:g});function e(l,k){return b(k,"").test(l)}function i(l,k){var m=l.className;if(!m){return}if(m===k){l.className="";return}l.className=c(m.replace(b(k,"g")," "))}function f(l,k){if(!l.className){l.className=k}if(!b(k).test(l.className)){l.className+=" "+k}}var a={};function b(l,k){var m=l+"$"+k;return(a[m]||(a[m]=RegExp("(?:^|\\s)"+l+"(?:$|\\s)",k)))}function j(l,m,s){if(!s){return[]}m=m||"*";if(l.getElementsByClassName&&(m==="*")){return Array.prototype.slice.call(l.getElementsByClassName(s))}var n=b(s,""),p=l.getElementsByTagName(m),q=p.length,k=0,o,r=Array(q);for(o=0;o<q;o++){if(n.test(p[o].className)){r[k++]=p[o]}}r.length=k;return r}function g(n,k,l){if(n==null||n===l){return null}var o=b(k,""),m;for(m=n.parentNode;m!=l;){if(o.test(m.className)){return m}m=m.parentNode}return null}var d=/^\s+|\s+$/g,h=/\s\s+/g;function c(k){return k.replace(d,"").replace(h," ")}})();APE.namespace("APE.dom");(function(){APE.mixin(APE.dom.Event={},{getTarget:d,addCallback:e,removeCallback:f,preventDefault:b});function d(g){return g&&g.target||event.srcElement}var a="addEventListener" in this;function c(h,g){return a?g:function(i){g.call(h,i)}}function e(j,i,g){if(a){j.addEventListener(i,g,false)}else{var h=c(j,g);j.attachEvent("on"+i,h)}return h||g}function f(i,h,g){if(a){i.removeEventListener(h,g,false)}else{i.detachEvent("on"+h,g)}return g}function b(g){g=g||event;if(typeof g.preventDefault=="function"){g.preventDefault()}else{if("returnValue" in g){g.returnValue=false}}}})();APE.namespace("APE.dom");(function(){APE.mixin(APE.dom,{findAncestorWithTagName:b});var a=/^H/.test(document.documentElement.tagName);function b(f,d,c){d=(a?d.toUpperCase():d.toLowerCase());for(var e=f.parentNode;e&&e!=c;){if(e.tagName===d){return e}e=e.parentNode}return null}})();APE.namespace("APE.dom");(function(){var b=APE.dom,a=document;b.textContent="textContent" in a.documentElement?"textContent":"innerText"})();APE.namespace("shopping.widget");shopping.widget.Carousel=function(c,b,a){this.id=c;this.timeDuration=b||250;this.isVertical=!!a;this._queue=0;this.init()};shopping.widget.Carousel.prototype={pos:0,init:function(){var b=document.getElementById(this.id),l,h=b.childNodes,e,g,k=APE.dom.Event.addCallback,d=this.isVertical?"offsetTop":"offsetLeft",m=this.isVertical?"offsetHeight":"offsetWidth",j=shopping.widget.Carousel;this.style=b.style;this.clientDimension=this.isVertical?"clientHeight":"clientWidth";this.stylePos=this.isVertical?"top":"left";for(e=0,g=h.length;e<g;e++){l=h[e];if(!l){break}if(!("tagName" in l)){l.parentNode.removeChild(l)}}this.scrollDistance=b.lastChild[d]+b.lastChild[m];this.frameSize=b.parentNode[this.clientDimension];var a=this.isVertical?"height":"width";this.style[a]=this.scrollDistance+10+"px";var c=document.getElementById(this.id+"Prev"),f=document.getElementById(this.id+"Next");if(c){k(c,"click",j.handleButtonClick)}if(f){k(f,"click",j.handleButtonClick)}},moveStart:function(b){if(this.timerId){this._queue+=b?1:-1;return}var e=document.getElementById(this.id+"Frame")[this.clientDimension],c=APE.dom;if(this.scrollDistance<=e){return}if(b){e=-e}this.newPos=this.pos+e;if(!b){c.removeClass(document.getElementById(this.id+"Next"),"carouselButton-disabled");if(this.newPos>=0){e=-this.pos;this.newPos=0;c.addClass(document.getElementById(this.id+"Prev"),"carouselButton-disabled")}}else{if(this.pos===0&&this.newPos){c.removeClass(document.getElementById(this.id+"Prev"),"carouselButton-disabled")}if(this.newPos<=this.frameSize-this.scrollDistance){c.addClass(document.getElementById(this.id+"Next"),"carouselButton-disabled");var a=this.scrollDistance+this.pos-this.frameSize;e=-a;this.newPos=this.pos-a}}this.startTime=new Date().valueOf();this.startPos=this.pos;this.dx=e;this.timerId=window.setInterval("shopping.widget.Carousel.instances['"+this.id+"'].move()",12)},move:function(){var a=new Date-this.startTime,c=a/this.timeDuration,b=(Math.atan(1.4*(2*c-1))/Math.atan(1.4)+1)/2;if(c>=1){return this.moveEnd()}this.style[this.stylePos]=(this.pos=0|this.startPos+this.dx*b)+"px"},moveEnd:function(){window.clearInterval(this.timerId);this.timerId=null;this.style[this.stylePos]=(this.pos=this.newPos)+"px";if(typeof this.onend=="function"){this.onend()}if(this._queue!==0){var a=this._queue>0;this._queue+=a?-1:1;this.moveStart(a)}}};shopping.widget.Carousel.getById=APE.getById;shopping.widget.Carousel.handleButtonClick=function(){var a=this.id.match(/(\w+)(Next|Prev)$/),b=shopping.widget.Carousel.getById(a[1]);b.moveStart(a[2]==="Next")};APE.namespace("shopping.widget");(function(){shopping.widget.Panel=i;function i(j){this.id=j;document.getElementById(j).tabIndex=0}i.activeId="";i.getById=APE.getById;var c=APE.dom,f=document.body;c.Event.addCallback(f,"click",e);c.Event.addCallback(f,"mousedown",b);f=null;var d={},g=/Actuator$/;i.prototype={show:function(){if(i.activeId===this.id){this.hide();return}i.activeId=this.id;document.getElementById(this.id).style.display="block";var j=this.id.replace(/Panel$/,"Actuator"),k=document.getElementById(j);if(k){APE.dom.addClass(k,"actuatorActive")}},hide:function(){document.getElementById(this.id).style.display="none";i.activeId="";var j=this.id.replace(/Panel$/,"Actuator"),k=document.getElementById(j);if(typeof this.onhide=="function"){this.onhide()}if(k){APE.dom.removeClass(k,"actuatorActive")}}};function e(k){var j=c.Event.getTarget(k),n=j.id,l=document,m;if(!n||!g.test(n)){return}n=n.replace(g,"Panel");c.Event.preventDefault(k);if(!(n in d)){d[n]=n;m=l.getElementById(n);c.Event.addCallback(m,"mousedown",h);c.Event.addCallback(m,"keydown",a);c.Event.addCallback(j,"keydown",a)}i.getById(n).show()}function a(j){if(j.keyCode===27){i.getById(this.id.replace(g,"Panel")).hide()}}function b(k){var l=c.Event.getTarget(k),j=l&&l.id;if(i.activeId){if(j&&j.replace(g,"Panel")===i.activeId){return}i.getById(i.activeId).hide()}}function h(k){k=k||window.event;if(k.stopPropagation){k.stopPropagation()}k.cancelBubble=true;var l=APE.dom,j=l.Event.getTarget(k);if(l.hasToken(j.className,"panelClose")){i.getById(this.id).hide()}}})();(function(){var c=APE.dom,a=c.Event;a.addCallback(document.body,"mousedown",b);function b(f){var g=a.getTarget(f),d=g.className,e,i,h;if(!d){return}if(c.hasToken(d,"carouselButton")&&!c.hasToken(d,"carouselButtonDisabled")){e=g.id.replace(/(?:Prev|Next)$/,"");if(e){i=document.getElementById(e+"Frame");h=i&&c.hasToken(i.className,"carouselV");shopping.widget.Carousel.getById(e,1000,h)}}}})();