// JavaScript Document
// Copyright (c) 2007. Adobe Systems Incorporated.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//   * Neither the name of Adobe Systems Incorporated nor the names of its
//     contributors may be used to endorse or promote products derived from this
//     software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
var Spry;if(!Spry){Spry={}}if(!Spry.Widget){Spry.Widget={}}Spry.Widget.TabbedPanels=function(a,c){this.element=this.getElement(a);this.defaultTab=0;this.tabSelectedClass="TabbedPanelsTabSelected";this.tabHoverClass="TabbedPanelsTabHover";this.tabFocusedClass="TabbedPanelsTabFocused";this.panelVisibleClass="TabbedPanelsContentVisible";this.focusElement=null;this.hasFocus=false;this.currentTabIndex=0;this.enableKeyboardNavigation=true;this.nextPanelKeyCode=Spry.Widget.TabbedPanels.KEY_RIGHT;this.previousPanelKeyCode=Spry.Widget.TabbedPanels.KEY_LEFT;Spry.Widget.TabbedPanels.setOptions(this,c);if(typeof(this.defaultTab)=="number"){if(this.defaultTab<0){this.defaultTab=0}else{var b=this.getTabbedPanelCount();if(this.defaultTab>=b){this.defaultTab=(b>1)?(b-1):0}}this.defaultTab=this.getTabs()[this.defaultTab]}if(this.defaultTab){this.defaultTab=this.getElement(this.defaultTab)}this.attachBehaviors()};Spry.Widget.TabbedPanels.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a)}return a};Spry.Widget.TabbedPanels.prototype.getElementChildren=function(b){var a=[];var c=b.firstChild;while(c){if(c.nodeType==1){a.push(c)}c=c.nextSibling}return a};Spry.Widget.TabbedPanels.prototype.addClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))!=-1)){return}b.className+=(b.className?" ":"")+a};Spry.Widget.TabbedPanels.prototype.removeClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))==-1)){return}b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b","g"),"")};Spry.Widget.TabbedPanels.setOptions=function(d,c,a){if(!c){return}for(var b in c){if(a&&c[b]==undefined){continue}d[b]=c[b]}};Spry.Widget.TabbedPanels.prototype.getTabGroup=function(){if(this.element){var a=this.getElementChildren(this.element);if(a.length){return a[0]}}return null};Spry.Widget.TabbedPanels.prototype.getTabs=function(){var a=[];var b=this.getTabGroup();if(b){a=this.getElementChildren(b)}return a};Spry.Widget.TabbedPanels.prototype.getContentPanelGroup=function(){if(this.element){var a=this.getElementChildren(this.element);if(a.length>1){return a[1]}}return null};Spry.Widget.TabbedPanels.prototype.getContentPanels=function(){var a=[];var b=this.getContentPanelGroup();if(b){a=this.getElementChildren(b)}return a};Spry.Widget.TabbedPanels.prototype.getIndex=function(c,a){c=this.getElement(c);if(c&&a&&a.length){for(var b=0;b<a.length;b++){if(c==a[b]){return b}}}return -1};Spry.Widget.TabbedPanels.prototype.getTabIndex=function(b){var a=this.getIndex(b,this.getTabs());if(a<0){a=this.getIndex(b,this.getContentPanels())}return a};Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex=function(){return this.currentTabIndex};Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount=function(a){return Math.min(this.getTabs().length,this.getContentPanels().length)};Spry.Widget.TabbedPanels.addEventListener=function(c,b,d,a){try{if(c.addEventListener){c.addEventListener(b,d,a)}else{if(c.attachEvent){c.attachEvent("on"+b,d)}}}catch(f){}};Spry.Widget.TabbedPanels.prototype.cancelEvent=function(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}return false};Spry.Widget.TabbedPanels.prototype.onTabClick=function(b,a){this.showPanel(a);return this.cancelEvent(b)};Spry.Widget.TabbedPanels.prototype.onTabMouseOver=function(b,a){this.addClassName(a,this.tabHoverClass);return false};Spry.Widget.TabbedPanels.prototype.onTabMouseOut=function(b,a){this.removeClassName(a,this.tabHoverClass);return false};Spry.Widget.TabbedPanels.prototype.onTabFocus=function(b,a){this.hasFocus=true;this.addClassName(a,this.tabFocusedClass);return false};Spry.Widget.TabbedPanels.prototype.onTabBlur=function(b,a){this.hasFocus=false;this.removeClassName(a,this.tabFocusedClass);return false};Spry.Widget.TabbedPanels.KEY_UP=38;Spry.Widget.TabbedPanels.KEY_DOWN=40;Spry.Widget.TabbedPanels.KEY_LEFT=37;Spry.Widget.TabbedPanels.KEY_RIGHT=39;Spry.Widget.TabbedPanels.prototype.onTabKeyDown=function(g,f){var c=g.keyCode;if(!this.hasFocus||(c!=this.previousPanelKeyCode&&c!=this.nextPanelKeyCode)){return true}var b=this.getTabs();for(var a=0;a<b.length;a++){if(b[a]==f){var d=false;if(c==this.previousPanelKeyCode&&a>0){d=b[a-1]}else{if(c==this.nextPanelKeyCode&&a<b.length-1){d=b[a+1]}}if(d){this.showPanel(d);d.focus();break}}}return this.cancelEvent(g)};Spry.Widget.TabbedPanels.prototype.preorderTraversal=function(a,b){var d=false;if(a){d=b(a);if(a.hasChildNodes()){var f=a.firstChild;while(!d&&f){d=this.preorderTraversal(f,b);try{f=f.nextSibling}catch(c){f=null}}}}return d};Spry.Widget.TabbedPanels.prototype.addPanelEventListeners=function(d,b){var c=this;Spry.Widget.TabbedPanels.addEventListener(d,"click",function(f){return c.onTabClick(f,d)},false);Spry.Widget.TabbedPanels.addEventListener(d,"mouseover",function(f){return c.onTabMouseOver(f,d)},false);Spry.Widget.TabbedPanels.addEventListener(d,"mouseout",function(f){return c.onTabMouseOut(f,d)},false);if(this.enableKeyboardNavigation){var e=null;var a=null;this.preorderTraversal(d,function(f){if(f.nodeType==1){var g=d.attributes.getNamedItem("tabindex");if(g){e=f;return true}if(!a&&f.nodeName.toLowerCase()=="a"){a=f}}return false});if(e){this.focusElement=e}else{if(a){this.focusElement=a}}if(this.focusElement){Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"focus",function(f){return c.onTabFocus(f,d)},false);Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"blur",function(f){return c.onTabBlur(f,d)},false);Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"keydown",function(f){return c.onTabKeyDown(f,d)},false)}}};Spry.Widget.TabbedPanels.prototype.showPanel=function(b){var f=-1;if(typeof b=="number"){f=b}else{f=this.getTabIndex(b)}if(!f<0||f>=this.getTabbedPanelCount()){return}var e=this.getTabs();var c=this.getContentPanels();var a=Math.max(e.length,c.length);for(var d=0;d<a;d++){if(d!=f){if(e[d]){this.removeClassName(e[d],this.tabSelectedClass)}if(c[d]){this.removeClassName(c[d],this.panelVisibleClass);c[d].style.display="none"}}}this.addClassName(e[f],this.tabSelectedClass);this.addClassName(c[f],this.panelVisibleClass);c[f].style.display="block";this.currentTabIndex=f};Spry.Widget.TabbedPanels.prototype.attachBehaviors=function(d){var c=this.getTabs();var a=this.getContentPanels();var e=this.getTabbedPanelCount();for(var b=0;b<e;b++){this.addPanelEventListeners(c[b],a[b])}this.showPanel(this.defaultTab)};var Spry;if(!Spry){Spry={}}if(!Spry.Widget){Spry.Widget={}}Spry.Widget.SlidingPanels=function(a,b){this.element=this.getElement(a);this.enableAnimation=true;this.currentPanel=null;this.enableKeyboardNavigation=true;this.hasFocus=false;this.previousPanelKeyCode=Spry.Widget.SlidingPanels.KEY_LEFT;this.nextPanelKeyCode=Spry.Widget.SlidingPanels.KEY_RIGHT;this.currentPanelClass="SlidingPanelsCurrentPanel";this.focusedClass="SlidingPanelsFocused";this.animatingClass="SlidingPanelsAnimating";Spry.Widget.SlidingPanels.setOptions(this,b);if(this.element){this.element.style.overflow="hidden"}if(this.defaultPanel){if(typeof this.defaultPanel=="number"){this.currentPanel=this.getContentPanels()[this.defaultPanel]}else{this.currentPanel=this.getElement(this.defaultPanel)}}if(!this.currentPanel){this.currentPanel=this.getContentPanels()[0]}if(Spry.Widget.SlidingPanels.onloadDidFire){this.attachBehaviors()}else{Spry.Widget.SlidingPanels.loadQueue.push(this)}};Spry.Widget.SlidingPanels.prototype.onFocus=function(a){this.hasFocus=true;this.addClassName(this.element,this.focusedClass);return false};Spry.Widget.SlidingPanels.prototype.onBlur=function(a){this.hasFocus=false;this.removeClassName(this.element,this.focusedClass);return false};Spry.Widget.SlidingPanels.KEY_LEFT=37;Spry.Widget.SlidingPanels.KEY_UP=38;Spry.Widget.SlidingPanels.KEY_RIGHT=39;Spry.Widget.SlidingPanels.KEY_DOWN=40;Spry.Widget.SlidingPanels.prototype.onKeyDown=function(b){var a=b.keyCode;if(!this.hasFocus||(a!=this.previousPanelKeyCode&&a!=this.nextPanelKeyCode)){return true}if(a==this.nextPanelKeyCode){this.showNextPanel()}else{this.showPreviousPanel()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}return false};Spry.Widget.SlidingPanels.prototype.attachBehaviors=function(){var e=this.element;if(!e){return}if(this.enableKeyboardNavigation){var a=null;var d=e.attributes.getNamedItem("tabindex");if(d||e.nodeName.toLowerCase()=="a"){a=e}if(a){var b=this;Spry.Widget.SlidingPanels.addEventListener(a,"focus",function(f){return b.onFocus(f||window.event)},false);Spry.Widget.SlidingPanels.addEventListener(a,"blur",function(f){return b.onBlur(f||window.event)},false);Spry.Widget.SlidingPanels.addEventListener(a,"keydown",function(f){return b.onKeyDown(f||window.event)},false)}}if(this.currentPanel){var c=this.enableAnimation;this.enableAnimation=false;this.showPanel(this.currentPanel);this.enableAnimation=c}};Spry.Widget.SlidingPanels.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a)}return a};Spry.Widget.SlidingPanels.prototype.addClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))!=-1)){return}b.className+=(b.className?" ":"")+a};Spry.Widget.SlidingPanels.prototype.removeClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))==-1)){return}b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b","g"),"")};Spry.Widget.SlidingPanels.setOptions=function(d,c,a){if(!c){return}for(var b in c){if(a&&c[b]==undefined){continue}d[b]=c[b]}};Spry.Widget.SlidingPanels.prototype.getElementChildren=function(b){var a=[];var c=b.firstChild;while(c){if(c.nodeType==1){a.push(c)}c=c.nextSibling}return a};Spry.Widget.SlidingPanels.prototype.getCurrentPanel=function(){return this.currentPanel};Spry.Widget.SlidingPanels.prototype.getContentGroup=function(){return this.getElementChildren(this.element)[0]};Spry.Widget.SlidingPanels.prototype.getContentPanels=function(){return this.getElementChildren(this.getContentGroup())};Spry.Widget.SlidingPanels.prototype.getContentPanelsCount=function(){return this.getContentPanels().length};Spry.Widget.SlidingPanels.onloadDidFire=false;Spry.Widget.SlidingPanels.loadQueue=[];Spry.Widget.SlidingPanels.addLoadListener=function(a){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",a,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",a,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",a)}}}};Spry.Widget.SlidingPanels.processLoadQueue=function(c){Spry.Widget.SlidingPanels.onloadDidFire=true;var d=Spry.Widget.SlidingPanels.loadQueue;var a=d.length;for(var b=0;b<a;b++){d[b].attachBehaviors()}};Spry.Widget.SlidingPanels.addLoadListener(Spry.Widget.SlidingPanels.processLoadQueue);Spry.Widget.SlidingPanels.addEventListener=function(c,b,d,a){try{if(c.addEventListener){c.addEventListener(b,d,a)}else{if(c.attachEvent){c.attachEvent("on"+b,d)}}}catch(f){}};Spry.Widget.SlidingPanels.prototype.getContentPanelIndex=function(d){if(d){d=this.getElement(d);var b=this.getContentPanels();var a=b.length;for(var c=0;c<a;c++){if(b[c]==d){return c}}}return -1};Spry.Widget.SlidingPanels.prototype.showPanel=function(i){var g=-1;if(typeof i=="number"){g=i}else{g=this.getContentPanelIndex(i)}var e=this.getContentPanelsCount();if(e>0){g=(g>=e)?e-1:g}else{g=0}var a=this.getContentPanels()[g];var h=this.getContentGroup();if(a&&h){if(this.currentPanel){this.removeClassName(this.currentPanel,this.currentPanelClass)}this.currentPanel=a;var f=-a.offsetLeft;var d=-a.offsetTop;if(this.enableAnimation){if(this.animator){this.animator.stop()}var c=h.offsetLeft;var b=h.offsetTop;if(c!=f||b!=d){var j=this;this.addClassName(this.element,this.animatingClass);this.animator=new Spry.Widget.SlidingPanels.PanelAnimator(h,c,b,f,d,{duration:this.duration,fps:this.fps,transition:this.transition,finish:function(){j.removeClassName(j.element,j.animatingClass);j.addClassName(a,j.currentPanelClass)}});this.animator.start()}}else{h.style.left=f+"px";h.style.top=d+"px";this.addClassName(a,this.currentPanelClass)}}return a};Spry.Widget.SlidingPanels.prototype.showFirstPanel=function(){return this.showPanel(0)};Spry.Widget.SlidingPanels.prototype.showLastPanel=function(){return this.showPanel(this.getContentPanels().length-1)};Spry.Widget.SlidingPanels.prototype.showPreviousPanel=function(){return this.showPanel(this.getContentPanelIndex(this.currentPanel)-1)};Spry.Widget.SlidingPanels.prototype.showNextPanel=function(){return this.showPanel(this.getContentPanelIndex(this.currentPanel)+1)};Spry.Widget.SlidingPanels.PanelAnimator=function(e,b,a,g,f,d){this.element=e;this.curX=b;this.curY=a;this.dstX=g;this.dstY=f;this.fps=60;this.duration=500;this.transition=Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;this.startTime=0;this.timerID=0;this.finish=null;var c=this;this.intervalFunc=function(){c.step()};Spry.Widget.SlidingPanels.setOptions(this,d,true);this.interval=1000/this.fps};Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition=function(d,b,a,c){d/=c;return b+((2-d)*d*a)};Spry.Widget.SlidingPanels.PanelAnimator.prototype.start=function(){this.stop();this.startTime=(new Date()).getTime();this.timerID=setTimeout(this.intervalFunc,this.interval)};Spry.Widget.SlidingPanels.PanelAnimator.prototype.stop=function(){if(this.timerID){clearTimeout(this.timerID)}this.timerID=0};Spry.Widget.SlidingPanels.PanelAnimator.prototype.step=function(){var c=(new Date()).getTime()-this.startTime;var b=c>=this.duration;var a,d;if(b){a=this.curX=this.dstX;d=this.curY=this.dstY}else{a=this.transition(c,this.curX,this.dstX-this.curX,this.duration);d=this.transition(c,this.curY,this.dstY-this.curY,this.duration)}this.element.style.left=a+"px";this.element.style.top=d+"px";if(!b){this.timerID=setTimeout(this.intervalFunc,this.interval)}else{if(this.finish){this.finish()}}};var Spry;if(!Spry){Spry={}}if(!Spry.Widget){Spry.Widget={}}Spry.Widget.Accordion=function(a,b){this.element=this.getElement(a);this.defaultPanel=0;this.hoverClass="AccordionPanelTabHover";this.openClass="AccordionPanelOpen";this.closedClass="AccordionPanelClosed";this.focusedClass="AccordionFocused";this.enableAnimation=true;this.enableKeyboardNavigation=true;this.currentPanel=null;this.animator=null;this.hasFocus=null;this.previousPanelKeyCode=Spry.Widget.Accordion.KEY_UP;this.nextPanelKeyCode=Spry.Widget.Accordion.KEY_DOWN;this.useFixedPanelHeights=true;this.fixedPanelHeight=0;Spry.Widget.Accordion.setOptions(this,b,true);this.attachBehaviors()};Spry.Widget.Accordion.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a)}return a};Spry.Widget.Accordion.prototype.addClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))!=-1)){return}b.className+=(b.className?" ":"")+a};Spry.Widget.Accordion.prototype.removeClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))==-1)){return}b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b","g"),"")};Spry.Widget.Accordion.setOptions=function(d,c,a){if(!c){return}for(var b in c){if(a&&c[b]==undefined){continue}d[b]=c[b]}};Spry.Widget.Accordion.prototype.onPanelTabMouseOver=function(b,a){if(a){this.addClassName(this.getPanelTab(a),this.hoverClass)}return false};Spry.Widget.Accordion.prototype.onPanelTabMouseOut=function(b,a){if(a){this.removeClassName(this.getPanelTab(a),this.hoverClass)}return false};Spry.Widget.Accordion.prototype.openPanel=function(c){var e=this.currentPanel;var d;if(typeof c=="number"){d=this.getPanels()[c]}else{d=this.getElement(c)}if(!d||e==d){return null}var b=e?this.getPanelContent(e):null;var a=this.getPanelContent(d);if(!a){return null}if(this.useFixedPanelHeights&&!this.fixedPanelHeight){this.fixedPanelHeight=(b.offsetHeight)?b.offsetHeight:b.scrollHeight}if(this.enableAnimation){if(this.animator){this.animator.stop()}this.animator=new Spry.Widget.Accordion.PanelAnimator(this,d,{duration:this.duration,fps:this.fps,transition:this.transition});this.animator.start()}else{if(b){b.style.display="none";b.style.height="0px"}a.style.display="block";a.style.height=this.useFixedPanelHeights?this.fixedPanelHeight+"px":"auto"}if(e){this.removeClassName(e,this.openClass);this.addClassName(e,this.closedClass)}this.removeClassName(d,this.closedClass);this.addClassName(d,this.openClass);this.currentPanel=d;return d};Spry.Widget.Accordion.prototype.closePanel=function(){if(!this.useFixedPanelHeights&&this.currentPanel){var a=this.currentPanel;var b=this.getPanelContent(a);if(b){if(this.enableAnimation){if(this.animator){this.animator.stop()}this.animator=new Spry.Widget.Accordion.PanelAnimator(this,null,{duration:this.duration,fps:this.fps,transition:this.transition});this.animator.start()}else{b.style.display="none";b.style.height="0px"}}this.removeClassName(a,this.openClass);this.addClassName(a,this.closedClass);this.currentPanel=null}};Spry.Widget.Accordion.prototype.openNextPanel=function(){return this.openPanel(this.getCurrentPanelIndex()+1)};Spry.Widget.Accordion.prototype.openPreviousPanel=function(){return this.openPanel(this.getCurrentPanelIndex()-1)};Spry.Widget.Accordion.prototype.openFirstPanel=function(){return this.openPanel(0)};Spry.Widget.Accordion.prototype.openLastPanel=function(){var a=this.getPanels();return this.openPanel(a[a.length-1])};Spry.Widget.Accordion.prototype.onPanelTabClick=function(b,a){if(a!=this.currentPanel){this.openPanel(a)}else{this.closePanel()}if(this.enableKeyboardNavigation){this.focus()}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}return false};Spry.Widget.Accordion.prototype.onFocus=function(a){this.hasFocus=true;this.addClassName(this.element,this.focusedClass);return false};Spry.Widget.Accordion.prototype.onBlur=function(a){this.hasFocus=false;this.removeClassName(this.element,this.focusedClass);return false};Spry.Widget.Accordion.KEY_UP=38;Spry.Widget.Accordion.KEY_DOWN=40;Spry.Widget.Accordion.prototype.onKeyDown=function(c){var b=c.keyCode;if(!this.hasFocus||(b!=this.previousPanelKeyCode&&b!=this.nextPanelKeyCode)){return true}var a=this.getPanels();if(!a||a.length<1){return false}var f=this.currentPanel?this.currentPanel:a[0];var d=(b==this.nextPanelKeyCode)?f.nextSibling:f.previousSibling;while(d){if(d.nodeType==1){break}d=(b==this.nextPanelKeyCode)?d.nextSibling:d.previousSibling}if(d&&f!=d){this.openPanel(d)}if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}return false};Spry.Widget.Accordion.prototype.attachPanelHandlers=function(a){if(!a){return}var c=this.getPanelTab(a);if(c){var b=this;Spry.Widget.Accordion.addEventListener(c,"click",function(d){return b.onPanelTabClick(d,a)},false);Spry.Widget.Accordion.addEventListener(c,"mouseover",function(d){return b.onPanelTabMouseOver(d,a)},false);Spry.Widget.Accordion.addEventListener(c,"mouseout",function(d){return b.onPanelTabMouseOut(d,a)},false)}};Spry.Widget.Accordion.addEventListener=function(c,b,d,a){try{if(c.addEventListener){c.addEventListener(b,d,a)}else{if(c.attachEvent){c.attachEvent("on"+b,d)}}}catch(f){}};Spry.Widget.Accordion.prototype.initPanel=function(a,c){var b=this.getPanelContent(a);if(c){this.currentPanel=a;this.removeClassName(a,this.closedClass);this.addClassName(a,this.openClass);if(b){if(this.useFixedPanelHeights){if(this.fixedPanelHeight){b.style.height=this.fixedPanelHeight+"px"}}else{b.style.height="auto"}}}else{this.removeClassName(a,this.openClass);this.addClassName(a,this.closedClass);if(b){b.style.height="0px";b.style.display="none"}}this.attachPanelHandlers(a)};Spry.Widget.Accordion.prototype.attachBehaviors=function(){var b=this.getPanels();for(var c=0;c<b.length;c++){this.initPanel(b[c],c==this.defaultPanel)}this.enableKeyboardNavigation=(this.enableKeyboardNavigation&&this.element.attributes.getNamedItem("tabindex"));if(this.enableKeyboardNavigation){var a=this;Spry.Widget.Accordion.addEventListener(this.element,"focus",function(d){return a.onFocus(d)},false);Spry.Widget.Accordion.addEventListener(this.element,"blur",function(d){return a.onBlur(d)},false);Spry.Widget.Accordion.addEventListener(this.element,"keydown",function(d){return a.onKeyDown(d)},false)}};Spry.Widget.Accordion.prototype.getPanels=function(){return this.getElementChildren(this.element)};Spry.Widget.Accordion.prototype.getCurrentPanel=function(){return this.currentPanel};Spry.Widget.Accordion.prototype.getPanelIndex=function(a){var b=this.getPanels();for(var c=0;c<b.length;c++){if(a==b[c]){return c}}return -1};Spry.Widget.Accordion.prototype.getCurrentPanelIndex=function(){return this.getPanelIndex(this.currentPanel)};Spry.Widget.Accordion.prototype.getPanelTab=function(a){if(!a){return null}return this.getElementChildren(a)[0]};Spry.Widget.Accordion.prototype.getPanelContent=function(a){if(!a){return null}return this.getElementChildren(a)[1]};Spry.Widget.Accordion.prototype.getElementChildren=function(b){var a=[];var c=b.firstChild;while(c){if(c.nodeType==1){a.push(c)}c=c.nextSibling}return a};Spry.Widget.Accordion.prototype.focus=function(){if(this.element&&this.element.focus){this.element.focus()}};Spry.Widget.Accordion.prototype.blur=function(){if(this.element&&this.element.blur){this.element.blur()}};Spry.Widget.Accordion.PanelAnimator=function(j,b,a){this.timer=null;this.interval=0;this.fps=60;this.duration=500;this.startTime=0;this.transition=Spry.Widget.Accordion.PanelAnimator.defaultTransition;this.onComplete=null;this.panel=b;this.panelToOpen=j.getElement(b);this.panelData=[];this.useFixedPanelHeights=j.useFixedPanelHeights;Spry.Widget.Accordion.setOptions(this,a,true);this.interval=Math.floor(1000/this.fps);var k=j.getPanels();for(var f=0;f<k.length;f++){var d=k[f];var l=j.getPanelContent(d);if(l){var g=l.offsetHeight;if(g==undefined){g=0}if(d==b&&g==0){l.style.display="block"}if(d==b||g>0){var e=new Object;e.panel=d;e.content=l;e.fromHeight=g;e.toHeight=(d==b)?(j.useFixedPanelHeights?j.fixedPanelHeight:l.scrollHeight):0;e.distance=e.toHeight-e.fromHeight;e.overflow=l.style.overflow;this.panelData.push(e);l.style.overflow="hidden";l.style.height=g+"px"}}}};Spry.Widget.Accordion.PanelAnimator.defaultTransition=function(d,b,a,c){d/=c;return b+((2-d)*d*a)};Spry.Widget.Accordion.PanelAnimator.prototype.start=function(){var a=this;this.startTime=(new Date).getTime();this.timer=setTimeout(function(){a.stepAnimation()},this.interval)};Spry.Widget.Accordion.PanelAnimator.prototype.stop=function(){if(this.timer){clearTimeout(this.timer);for(i=0;i<this.panelData.length;i++){obj=this.panelData[i];obj.content.style.overflow=obj.overflow}}this.timer=null};Spry.Widget.Accordion.PanelAnimator.prototype.stepAnimation=function(){var e=(new Date).getTime();var b=e-this.startTime;var d,f;if(b>=this.duration){for(d=0;d<this.panelData.length;d++){f=this.panelData[d];if(f.panel!=this.panel){f.content.style.display="none";f.content.style.height="0px"}f.content.style.overflow=f.overflow;f.content.style.height=(this.useFixedPanelHeights||f.toHeight==0)?f.toHeight+"px":"auto"}if(this.onComplete){this.onComplete()}return}for(d=0;d<this.panelData.length;d++){f=this.panelData[d];var c=this.transition(b,f.fromHeight,f.distance,this.duration);f.content.style.height=((c<0)?0:c)+"px"}var a=this;this.timer=setTimeout(function(){a.stepAnimation()},this.interval)};var Spry;if(!Spry){Spry={}}if(!Spry.Widget){Spry.Widget={}}Spry.Widget.CollapsiblePanel=function(a,b){this.element=this.getElement(a);this.focusElement=null;this.hoverClass="CollapsiblePanelTabHover";this.openClass="CollapsiblePanelOpen";this.closedClass="CollapsiblePanelClosed";this.focusedClass="CollapsiblePanelFocused";this.enableAnimation=true;this.enableKeyboardNavigation=true;this.animator=null;this.hasFocus=false;this.contentIsOpen=true;this.openPanelKeyCode=Spry.Widget.CollapsiblePanel.KEY_DOWN;this.closePanelKeyCode=Spry.Widget.CollapsiblePanel.KEY_UP;Spry.Widget.CollapsiblePanel.setOptions(this,b);this.attachBehaviors()};Spry.Widget.CollapsiblePanel.prototype.getElement=function(a){if(a&&typeof a=="string"){return document.getElementById(a)}return a};Spry.Widget.CollapsiblePanel.prototype.addClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))!=-1)){return}b.className+=(b.className?" ":"")+a};Spry.Widget.CollapsiblePanel.prototype.removeClassName=function(b,a){if(!b||!a||(b.className&&b.className.search(new RegExp("\\b"+a+"\\b"))==-1)){return}b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b","g"),"")};Spry.Widget.CollapsiblePanel.prototype.hasClassName=function(b,a){if(!b||!a||!b.className||b.className.search(new RegExp("\\b"+a+"\\b"))==-1){return false}return true};Spry.Widget.CollapsiblePanel.prototype.setDisplay=function(a,b){if(a){a.style.display=b}};Spry.Widget.CollapsiblePanel.setOptions=function(d,c,a){if(!c){return}for(var b in c){if(a&&c[b]==undefined){continue}d[b]=c[b]}};Spry.Widget.CollapsiblePanel.prototype.onTabMouseOver=function(a){this.addClassName(this.getTab(),this.hoverClass);return false};Spry.Widget.CollapsiblePanel.prototype.onTabMouseOut=function(a){this.removeClassName(this.getTab(),this.hoverClass);return false};Spry.Widget.CollapsiblePanel.prototype.open=function(){this.contentIsOpen=true;if(this.enableAnimation){if(this.animator){this.animator.stop()}this.animator=new Spry.Widget.CollapsiblePanel.PanelAnimator(this,true,{duration:this.duration,fps:this.fps,transition:this.transition});this.animator.start()}else{this.setDisplay(this.getContent(),"block")}this.removeClassName(this.element,this.closedClass);this.addClassName(this.element,this.openClass)};Spry.Widget.CollapsiblePanel.prototype.close=function(){this.contentIsOpen=false;if(this.enableAnimation){if(this.animator){this.animator.stop()}this.animator=new Spry.Widget.CollapsiblePanel.PanelAnimator(this,false,{duration:this.duration,fps:this.fps,transition:this.transition});this.animator.start()}else{this.setDisplay(this.getContent(),"none")}this.removeClassName(this.element,this.openClass);this.addClassName(this.element,this.closedClass)};Spry.Widget.CollapsiblePanel.prototype.onTabClick=function(a){if(this.isOpen()){this.close()}else{this.open()}this.focus();return this.stopPropagation(a)};Spry.Widget.CollapsiblePanel.prototype.onFocus=function(a){this.hasFocus=true;this.addClassName(this.element,this.focusedClass);return false};Spry.Widget.CollapsiblePanel.prototype.onBlur=function(a){this.hasFocus=false;this.removeClassName(this.element,this.focusedClass);return false};Spry.Widget.CollapsiblePanel.KEY_UP=38;Spry.Widget.CollapsiblePanel.KEY_DOWN=40;Spry.Widget.CollapsiblePanel.prototype.onKeyDown=function(b){var a=b.keyCode;if(!this.hasFocus||(a!=this.openPanelKeyCode&&a!=this.closePanelKeyCode)){return true}if(this.isOpen()&&a==this.closePanelKeyCode){this.close()}else{if(a==this.openPanelKeyCode){this.open()}}return this.stopPropagation(b)};Spry.Widget.CollapsiblePanel.prototype.stopPropagation=function(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}return false};Spry.Widget.CollapsiblePanel.prototype.attachPanelHandlers=function(){var c=this.getTab();if(!c){return}var b=this;Spry.Widget.CollapsiblePanel.addEventListener(c,"click",function(f){return b.onTabClick(f)},false);Spry.Widget.CollapsiblePanel.addEventListener(c,"mouseover",function(f){return b.onTabMouseOver(f)},false);Spry.Widget.CollapsiblePanel.addEventListener(c,"mouseout",function(f){return b.onTabMouseOut(f)},false);if(this.enableKeyboardNavigation){var d=null;var a=null;this.preorderTraversal(c,function(e){if(e.nodeType==1){var f=c.attributes.getNamedItem("tabindex");if(f){d=e;return true}if(!a&&e.nodeName.toLowerCase()=="a"){a=e}}return false});if(d){this.focusElement=d}else{if(a){this.focusElement=a}}if(this.focusElement){Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement,"focus",function(f){return b.onFocus(f)},false);Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement,"blur",function(f){return b.onBlur(f)},false);Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement,"keydown",function(f){return b.onKeyDown(f)},false)}}};Spry.Widget.CollapsiblePanel.addEventListener=function(c,b,d,a){try{if(c.addEventListener){c.addEventListener(b,d,a)}else{if(c.attachEvent){c.attachEvent("on"+b,d)}}}catch(f){}};Spry.Widget.CollapsiblePanel.prototype.preorderTraversal=function(a,b){var d=false;if(a){d=b(a);if(a.hasChildNodes()){var f=a.firstChild;while(!d&&f){d=this.preorderTraversal(f,b);try{f=f.nextSibling}catch(c){f=null}}}}return d};Spry.Widget.CollapsiblePanel.prototype.attachBehaviors=function(){var a=this.element;var b=this.getTab();var c=this.getContent();if(this.contentIsOpen||this.hasClassName(a,this.openClass)){this.addClassName(a,this.openClass);this.removeClassName(a,this.closedClass);this.setDisplay(c,"block");this.contentIsOpen=true}else{this.removeClassName(a,this.openClass);this.addClassName(a,this.closedClass);this.setDisplay(c,"none");this.contentIsOpen=false}this.attachPanelHandlers()};Spry.Widget.CollapsiblePanel.prototype.getTab=function(){return this.getElementChildren(this.element)[0]};Spry.Widget.CollapsiblePanel.prototype.getContent=function(){return this.getElementChildren(this.element)[1]};Spry.Widget.CollapsiblePanel.prototype.isOpen=function(){return this.contentIsOpen};Spry.Widget.CollapsiblePanel.prototype.getElementChildren=function(b){var a=[];var c=b.firstChild;while(c){if(c.nodeType==1){a.push(c)}c=c.nextSibling}return a};Spry.Widget.CollapsiblePanel.prototype.focus=function(){if(this.focusElement&&this.focusElement.focus){this.focusElement.focus()}};Spry.Widget.CollapsiblePanel.PanelAnimator=function(a,d,b){this.timer=null;this.interval=0;this.fps=60;this.duration=500;this.startTime=0;this.transition=Spry.Widget.CollapsiblePanel.PanelAnimator.defaultTransition;this.onComplete=null;this.panel=a;this.content=a.getContent();this.doOpen=d;Spry.Widget.CollapsiblePanel.setOptions(this,b,true);this.interval=Math.floor(1000/this.fps);var f=this.content;var e=f.offsetHeight?f.offsetHeight:0;this.fromHeight=(d&&f.style.display=="none")?0:e;if(!d){this.toHeight=0}else{if(f.style.display=="none"){f.style.visibility="hidden";f.style.display="block"}f.style.height="";this.toHeight=f.offsetHeight}this.distance=this.toHeight-this.fromHeight;this.overflow=f.style.overflow;f.style.height=this.fromHeight+"px";f.style.visibility="visible";f.style.overflow="hidden";f.style.display="block"};Spry.Widget.CollapsiblePanel.PanelAnimator.defaultTransition=function(d,b,a,c){d/=c;return b+((2-d)*d*a)};Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.start=function(){var a=this;this.startTime=(new Date).getTime();this.timer=setTimeout(function(){a.stepAnimation()},this.interval)};Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.stop=function(){if(this.timer){clearTimeout(this.timer);this.content.style.overflow=this.overflow}this.timer=null};Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.stepAnimation=function(){var d=(new Date).getTime();var b=d-this.startTime;if(b>=this.duration){if(!this.doOpen){this.content.style.display="none"}this.content.style.overflow=this.overflow;this.content.style.height=this.toHeight+"px";if(this.onComplete){this.onComplete()}return}var c=this.transition(b,this.fromHeight,this.distance,this.duration);this.content.style.height=((c<0)?0:c)+"px";var a=this;this.timer=setTimeout(function(){a.stepAnimation()},this.interval)};Spry.Widget.CollapsiblePanelGroup=function(a,b){this.element=this.getElement(a);this.opts=b;this.attachBehaviors()};Spry.Widget.CollapsiblePanelGroup.prototype.setOptions=Spry.Widget.CollapsiblePanel.prototype.setOptions;Spry.Widget.CollapsiblePanelGroup.prototype.getElement=Spry.Widget.CollapsiblePanel.prototype.getElement;Spry.Widget.CollapsiblePanelGroup.prototype.getElementChildren=Spry.Widget.CollapsiblePanel.prototype.getElementChildren;Spry.Widget.CollapsiblePanelGroup.prototype.setElementWidget=function(a,b){if(!a||!b){return}if(!a.spry){a.spry=new Object}a.spry.collapsiblePanel=b};Spry.Widget.CollapsiblePanelGroup.prototype.getElementWidget=function(a){return(a&&a.spry&&a.spry.collapsiblePanel)?a.spry.collapsiblePanel:null};Spry.Widget.CollapsiblePanelGroup.prototype.getPanels=function(){if(!this.element){return[]}return this.getElementChildren(this.element)};Spry.Widget.CollapsiblePanelGroup.prototype.getPanel=function(a){return this.getPanels()[a]};Spry.Widget.CollapsiblePanelGroup.prototype.attachBehaviors=function(){if(!this.element){return}var d=this.getPanels();var c=d.length;for(var b=0;b<c;b++){var a=d[b];this.setElementWidget(a,new Spry.Widget.CollapsiblePanel(a,this.opts))}};Spry.Widget.CollapsiblePanelGroup.prototype.openPanel=function(b){var a=this.getElementWidget(this.getPanel(b));if(a&&!a.isOpen()){a.open()}};Spry.Widget.CollapsiblePanelGroup.prototype.closePanel=function(b){var a=this.getElementWidget(this.getPanel(b));if(a&&a.isOpen()){a.close()}};Spry.Widget.CollapsiblePanelGroup.prototype.openAllPanels=function(){var d=this.getPanels();var c=d.length;for(var b=0;b<c;b++){var a=this.getElementWidget(d[b]);if(a&&!a.isOpen()){a.open()}}};Spry.Widget.CollapsiblePanelGroup.prototype.closeAllPanels=function(){var d=this.getPanels();var c=d.length;for(var b=0;b<c;b++){var a=this.getElementWidget(d[b]);if(a&&a.isOpen()){a.close()}}};