var Spry;
if(!Spry){Spry={}
}if(!Spry.Widget){Spry.Widget={}
}Spry.BrowserSniff=function(){var b=navigator.appName.toString();
var up=navigator.platform.toString();
var ua=navigator.userAgent.toString();
this.mozilla=this.ie=this.opera=r=false;
var re_opera=/Opera.([0-9\.]*)/i;
var re_msie=/MSIE.([0-9\.]*)/i;
var re_gecko=/gecko/i;
var re_safari=/safari\/([\d\.]*)/i;
if(ua.match(re_opera)){r=ua.match(re_opera);
this.opera=true;
this.version=parseFloat(r[1])
}else{if(ua.match(re_msie)){r=ua.match(re_msie);
this.ie=true;
this.version=parseFloat(r[1])
}else{if(ua.match(re_safari)){this.safari=true;
this.version=1.4
}else{if(ua.match(re_gecko)){var re_gecko_version=/rv:\s*([0-9\.]+)/i;
r=ua.match(re_gecko_version);
this.mozilla=true;
this.version=parseFloat(r[1])
}}}}this.windows=this.mac=this.linux=false;
this.Platform=ua.match(/windows/i)?"windows":(ua.match(/linux/i)?"linux":(ua.match(/mac/i)?"mac":ua.match(/unix/i)?"unix":"unknown"));
this[this.Platform]=true;
this.v=this.version;
if(this.safari&&this.mac&&this.mozilla){this.mozilla=false
}};
Spry.is=new Spry.BrowserSniff();
Spry.Widget.MenuBar=function(element,opts){this.init(element,opts)
};
Spry.Widget.MenuBar.prototype.init=function(element,opts){this.element=this.getElement(element);
this.currMenu=null;
this.showDelay=250;
this.hideDelay=600;
if(typeof document.getElementById=="undefined"||(navigator.vendor=="Apple Computer, Inc."&&typeof window.XMLHttpRequest=="undefined")||(Spry.is.ie&&typeof document.uniqueID=="undefined")){return
}if(Spry.is.ie&&Spry.is.version<7){try{document.execCommand("BackgroundImageCache",false,true)
}catch(err){}}this.upKeyCode=Spry.Widget.MenuBar.KEY_UP;
this.downKeyCode=Spry.Widget.MenuBar.KEY_DOWN;
this.leftKeyCode=Spry.Widget.MenuBar.KEY_LEFT;
this.rightKeyCode=Spry.Widget.MenuBar.KEY_RIGHT;
this.escKeyCode=Spry.Widget.MenuBar.KEY_ESC;
this.hoverClass="MenuBarItemHover";
this.subHoverClass="MenuBarItemSubmenuHover";
this.subVisibleClass="MenuBarSubmenuVisible";
this.hasSubClass="MenuBarItemSubmenu";
this.activeClass="MenuBarActive";
this.isieClass="MenuBarItemIE";
this.verticalClass="MenuBarVertical";
this.horizontalClass="MenuBarHorizontal";
this.enableKeyboardNavigation=true;
this.hasFocus=false;
if(opts){for(var k in opts){if(typeof this[k]=="undefined"){var rollover=new Image;
rollover.src=opts[k]
}}Spry.Widget.MenuBar.setOptions(this,opts)
}if(Spry.is.safari){this.enableKeyboardNavigation=false
}if(this.element){this.currMenu=this.element;
var items=this.element.getElementsByTagName("li");
for(var i=0;
i<items.length;
i++){if(i>0&&this.enableKeyboardNavigation){items[i].getElementsByTagName("a")[0].tabIndex="-1"
}this.initialize(items[i],element);
if(Spry.is.ie){this.addClassName(items[i],this.isieClass);
items[i].style.position="static"
}}if(this.enableKeyboardNavigation){var self=this;
this.addEventListener(document,"keydown",function(e){self.keyDown(e)
},false)
}if(Spry.is.ie){if(this.hasClassName(this.element,this.verticalClass)){this.element.style.position="relative"
}var linkitems=this.element.getElementsByTagName("a");
for(var i=0;
i<linkitems.length;
i++){linkitems[i].style.position="relative"
}}}};
Spry.Widget.MenuBar.KEY_ESC=27;
Spry.Widget.MenuBar.KEY_UP=38;
Spry.Widget.MenuBar.KEY_DOWN=40;
Spry.Widget.MenuBar.KEY_LEFT=37;
Spry.Widget.MenuBar.KEY_RIGHT=39;
Spry.Widget.MenuBar.prototype.getElement=function(ele){if(ele&&typeof ele=="string"){return document.getElementById(ele)
}return ele
};
Spry.Widget.MenuBar.prototype.hasClassName=function(ele,className){if(!ele||!className||!ele.className||ele.className.search(new RegExp("\\b"+className+"\\b"))==-1){return false
}return true
};
Spry.Widget.MenuBar.prototype.addClassName=function(ele,className){if(!ele||!className||this.hasClassName(ele,className)){return
}ele.className+=(ele.className?" ":"")+className
};
Spry.Widget.MenuBar.prototype.removeClassName=function(ele,className){if(!ele||!className||!this.hasClassName(ele,className)){return
}ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"")
};
Spry.Widget.MenuBar.prototype.addEventListener=function(element,eventType,handler,capture){try{if(element.addEventListener){element.addEventListener(eventType,handler,capture)
}else{if(element.attachEvent){element.attachEvent("on"+eventType,handler)
}}}catch(e){}};
Spry.Widget.MenuBar.prototype.createIframeLayer=function(menu){var layer=document.createElement("iframe");
layer.tabIndex="-1";
layer.src='javascript:""';
layer.frameBorder="0";
layer.scrolling="no";
menu.parentNode.appendChild(layer);
layer.style.left=menu.offsetLeft+"px";
layer.style.top=menu.offsetTop+"px";
layer.style.width=menu.offsetWidth+"px";
layer.style.height=menu.offsetHeight+"px"
};
Spry.Widget.MenuBar.prototype.removeIframeLayer=function(menu){var layers=menu.parentNode.getElementsByTagName("iframe");
while(layers.length>0){layers[0].parentNode.removeChild(layers[0])
}};
Spry.Widget.MenuBar.prototype.clearMenus=function(root){var menus=root.getElementsByTagName("ul");
for(var i=0;
i<menus.length;
i++){this.hideSubmenu(menus[i])
}this.removeClassName(this.element,this.activeClass)
};
Spry.Widget.MenuBar.prototype.bubbledTextEvent=function(){return Spry.is.safari&&(event.target==event.relatedTarget.parentNode||(event.eventPhase==3&&event.target.parentNode==event.relatedTarget))
};
Spry.Widget.MenuBar.prototype.showSubmenu=function(menu){if(this.currMenu){this.clearMenus(this.currMenu);
this.currMenu=null
}if(menu){this.addClassName(menu,this.subVisibleClass);
if(typeof document.all!="undefined"&&!Spry.is.opera&&navigator.vendor!="KDE"){if(!this.hasClassName(this.element,this.horizontalClass)||menu.parentNode.parentNode!=this.element){menu.style.top=menu.parentNode.offsetTop+"px"
}}if(Spry.is.ie&&Spry.is.version<7){this.createIframeLayer(menu)
}}this.addClassName(this.element,this.activeClass)
};
Spry.Widget.MenuBar.prototype.hideSubmenu=function(menu){if(menu){this.removeClassName(menu,this.subVisibleClass);
if(typeof document.all!="undefined"&&!Spry.is.opera&&navigator.vendor!="KDE"){menu.style.top="";
menu.style.left=""
}this.removeIframeLayer(menu)
}};
Spry.Widget.MenuBar.prototype.initialize=function(listitem,element){var opentime,closetime;
var link=listitem.getElementsByTagName("a")[0];
var submenus=listitem.getElementsByTagName("ul");
var menu=(submenus.length>0?submenus[0]:null);
if(menu){this.addClassName(link,this.hasSubClass)
}if(!Spry.is.ie){listitem.contains=function(testNode){if(testNode==null){return false
}if(testNode==this){return true
}else{return this.contains(testNode.parentNode)
}}
}var self=this;
this.addEventListener(listitem,"mouseover",function(e){self.mouseOver(listitem,e)
},false);
this.addEventListener(listitem,"mouseout",function(e){if(self.enableKeyboardNavigation){self.clearSelection()
}self.mouseOut(listitem,e)
},false);
if(this.enableKeyboardNavigation){this.addEventListener(link,"blur",function(e){self.onBlur(listitem)
},false);
this.addEventListener(link,"focus",function(e){self.keyFocus(listitem,e)
},false)
}};
Spry.Widget.MenuBar.prototype.keyFocus=function(listitem,e){this.lastOpen=listitem.getElementsByTagName("a")[0];
this.addClassName(this.lastOpen,listitem.getElementsByTagName("ul").length>0?this.subHoverClass:this.hoverClass);
this.hasFocus=true
};
Spry.Widget.MenuBar.prototype.onBlur=function(listitem){this.clearSelection(listitem)
};
Spry.Widget.MenuBar.prototype.clearSelection=function(el){if(!this.lastOpen){return
}if(el){el=el.getElementsByTagName("a")[0];
var item=this.lastOpen;
while(item!=this.element){var tmp=el;
while(tmp!=this.element){if(tmp==item){return
}try{tmp=tmp.parentNode
}catch(err){break
}}item=item.parentNode
}}var item=this.lastOpen;
while(item!=this.element){this.hideSubmenu(item.parentNode);
var link=item.getElementsByTagName("a")[0];
this.removeClassName(link,this.hoverClass);
this.removeClassName(link,this.subHoverClass);
item=item.parentNode
}this.lastOpen=false
};
Spry.Widget.MenuBar.prototype.keyDown=function(e){if(!this.hasFocus){return
}if(!this.lastOpen){this.hasFocus=false;
return
}var e=e||event;
var listitem=this.lastOpen.parentNode;
var link=this.lastOpen;
var submenus=listitem.getElementsByTagName("ul");
var menu=(submenus.length>0?submenus[0]:null);
var hasSubMenu=(menu)?true:false;
Spry.Widget.MenuBar.stopPropagation(e);
var opts=[listitem,menu,null,this.getSibling(listitem,"previousSibling"),this.getSibling(listitem,"nextSibling")];
if(!opts[3]){opts[2]=(listitem.parentNode.parentNode.nodeName.toLowerCase()=="li")?listitem.parentNode.parentNode:null
}var found=0;
switch(e.keyCode){case this.upKeyCode:found=this.getElementForKey(opts,"y",1);
break;
case this.downKeyCode:found=this.getElementForKey(opts,"y",-1);
break;
case this.leftKeyCode:found=this.getElementForKey(opts,"x",1);
break;
case this.rightKeyCode:found=this.getElementForKey(opts,"x",-1);
break;
case this.escKeyCode:case 9:this.clearSelection();
this.hasFocus=false;
default:return
}switch(found){case 0:return;
case 1:this.mouseOver(listitem,e);
break;
case 2:this.mouseOut(opts[2],e);
break;
case 3:case 4:this.removeClassName(link,hasSubMenu?this.subHoverClass:this.hoverClass);
break
}var link=opts[found].getElementsByTagName("a")[0];
if(opts[found].nodeName.toLowerCase()=="ul"){opts[found]=opts[found].getElementsByTagName("li")[0]
}this.addClassName(link,opts[found].getElementsByTagName("ul").length>0?this.subHoverClass:this.hoverClass);
this.lastOpen=link;
opts[found].getElementsByTagName("a")[0].focus()
};
Spry.Widget.MenuBar.prototype.mouseOver=function(listitem,e){var link=listitem.getElementsByTagName("a")[0];
var submenus=listitem.getElementsByTagName("ul");
var menu=(submenus.length>0?submenus[0]:null);
var hasSubMenu=(menu)?true:false;
if(this.enableKeyboardNavigation){this.clearSelection(listitem)
}if(this.bubbledTextEvent()){return
}if(listitem.closetime){clearTimeout(listitem.closetime)
}if(this.currMenu==listitem){this.currMenu=null
}if(this.hasFocus){link.focus()
}this.addClassName(link,hasSubMenu?this.subHoverClass:this.hoverClass);
this.lastOpen=link;
if(menu&&!this.hasClassName(menu,this.subHoverClass)){var self=this;
listitem.opentime=window.setTimeout(function(){self.showSubmenu(menu)
},this.showDelay)
}};
Spry.Widget.MenuBar.prototype.mouseOut=function(listitem,e){var link=listitem.getElementsByTagName("a")[0];
var submenus=listitem.getElementsByTagName("ul");
var menu=(submenus.length>0?submenus[0]:null);
var hasSubMenu=(menu)?true:false;
if(this.bubbledTextEvent()){return
}var related=(typeof e.relatedTarget!="undefined"?e.relatedTarget:e.toElement);
if(!listitem.contains(related)){if(listitem.opentime){clearTimeout(listitem.opentime)
}this.currMenu=listitem;
this.removeClassName(link,hasSubMenu?this.subHoverClass:this.hoverClass);
if(menu){var self=this;
listitem.closetime=window.setTimeout(function(){self.hideSubmenu(menu)
},this.hideDelay)
}if(this.hasFocus){link.blur()
}}};
Spry.Widget.MenuBar.prototype.getSibling=function(element,sibling){var child=element[sibling];
while(child&&child.nodeName.toLowerCase()!="li"){child=child[sibling]
}return child
};
Spry.Widget.MenuBar.prototype.getElementForKey=function(els,prop,dir){var found=0;
var rect=Spry.Widget.MenuBar.getPosition;
var ref=rect(els[found]);
var hideSubmenu=false;
if(els[1]&&!this.hasClassName(els[1],this.MenuBarSubmenuVisible)){els[1].style.visibility="hidden";
this.showSubmenu(els[1]);
hideSubmenu=true
}for(var i=0;
i<els.length;
i++){if(els[i]){var tmp=rect(els[i]);
if((dir*tmp[prop])<(dir*ref[prop])){ref=tmp;
found=i
}}}if(els[1]&&hideSubmenu){this.hideSubmenu(els[1]);
els[1].style.visibility=""
}return found
};
Spry.Widget.MenuBar.camelize=function(str){if(str.indexOf("-")==-1){return str
}var oStringList=str.split("-");
var isFirstEntry=true;
var camelizedString="";
for(var i=0;
i<oStringList.length;
i++){if(oStringList[i].length>0){if(isFirstEntry){camelizedString=oStringList[i];
isFirstEntry=false
}else{var s=oStringList[i];
camelizedString+=s.charAt(0).toUpperCase()+s.substring(1)
}}}return camelizedString
};
Spry.Widget.MenuBar.getStyleProp=function(element,prop){var value;
try{if(element.style){value=element.style[Spry.Widget.MenuBar.camelize(prop)]
}if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);
value=css?css.getPropertyValue(prop):null
}else{if(element.currentStyle){value=element.currentStyle[Spry.Widget.MenuBar.camelize(prop)]
}}}}catch(e){}return value=="auto"?null:value
};
Spry.Widget.MenuBar.getIntProp=function(element,prop){var a=parseInt(Spry.Widget.MenuBar.getStyleProp(element,prop),10);
if(isNaN(a)){return 0
}return a
};
Spry.Widget.MenuBar.getPosition=function(el,doc){doc=doc||document;
if(typeof(el)=="string"){el=doc.getElementById(el)
}if(!el){return false
}if(el.parentNode===null||Spry.Widget.MenuBar.getStyleProp(el,"display")=="none"){return false
}var ret={x:0,y:0};
var parent=null;
var box;
if(el.getBoundingClientRect){box=el.getBoundingClientRect();
var scrollTop=doc.documentElement.scrollTop||doc.body.scrollTop;
var scrollLeft=doc.documentElement.scrollLeft||doc.body.scrollLeft;
ret.x=box.left+scrollLeft;
ret.y=box.top+scrollTop
}else{if(doc.getBoxObjectFor){box=doc.getBoxObjectFor(el);
ret.x=box.x;
ret.y=box.y
}else{ret.x=el.offsetLeft;
ret.y=el.offsetTop;
parent=el.offsetParent;
if(parent!=el){while(parent){ret.x+=parent.offsetLeft;
ret.y+=parent.offsetTop;
parent=parent.offsetParent
}}if(Spry.is.opera||Spry.is.safari&&Spry.Widget.MenuBar.getStyleProp(el,"position")=="absolute"){ret.y-=doc.body.offsetTop
}}}if(el.parentNode){parent=el.parentNode
}else{parent=null
}if(parent.nodeName){var cas=parent.nodeName.toUpperCase();
while(parent&&cas!="BODY"&&cas!="HTML"){cas=parent.nodeName.toUpperCase();
ret.x-=parent.scrollLeft;
ret.y-=parent.scrollTop;
if(parent.parentNode){parent=parent.parentNode
}else{parent=null
}}}var gi=Spry.Widget.MenuBar.getIntProp;
var btw=gi(el,"margin-top");
var blw=gi(el,"margin-left");
ret.x-=blw;
ret.y-=btw;
return ret
};
Spry.Widget.MenuBar.stopPropagation=function(ev){if(ev.stopPropagation){ev.stopPropagation()
}else{ev.cancelBubble=true
}};
Spry.Widget.MenuBar.setOptions=function(obj,optionsObj,ignoreUndefinedProps){if(!optionsObj){return
}for(var optionName in optionsObj){if(ignoreUndefinedProps&&optionsObj[optionName]==undefined){continue
}obj[optionName]=optionsObj[optionName]
}};
var Spry;
if(!Spry){Spry={}
}if(!Spry.Widget){Spry.Widget={}
}Spry.Widget.TabbedPanels=function(element,opts){this.element=this.getElement(element);
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;
Spry.Widget.TabbedPanels.setOptions(this,opts);
if(typeof(this.defaultTab)=="number"){if(this.defaultTab<0){this.defaultTab=0
}else{var count=this.getTabbedPanelCount();
if(this.defaultTab>=count){this.defaultTab=(count>1)?(count-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(ele){if(ele&&typeof ele=="string"){return document.getElementById(ele)
}return ele
};
Spry.Widget.TabbedPanels.prototype.getElementChildren=function(element){var children=[];
var child=element.firstChild;
while(child){if(child.nodeType==1){children.push(child)
}child=child.nextSibling
}return children
};
Spry.Widget.TabbedPanels.prototype.addClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))!=-1)){return
}ele.className+=(ele.className?" ":"")+className
};
Spry.Widget.TabbedPanels.prototype.removeClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))==-1)){return
}ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"")
};
Spry.Widget.TabbedPanels.setOptions=function(obj,optionsObj,ignoreUndefinedProps){if(!optionsObj){return
}for(var optionName in optionsObj){if(ignoreUndefinedProps&&optionsObj[optionName]==undefined){continue
}obj[optionName]=optionsObj[optionName]
}};
Spry.Widget.TabbedPanels.prototype.getTabGroup=function(){if(this.element){var children=this.getElementChildren(this.element);
if(children.length){return children[0]
}}return null
};
Spry.Widget.TabbedPanels.prototype.getTabs=function(){var tabs=[];
var tg=this.getTabGroup();
if(tg){tabs=this.getElementChildren(tg)
}return tabs
};
Spry.Widget.TabbedPanels.prototype.getContentPanelGroup=function(){if(this.element){var children=this.getElementChildren(this.element);
if(children.length>1){return children[1]
}}return null
};
Spry.Widget.TabbedPanels.prototype.getContentPanels=function(){var panels=[];
var pg=this.getContentPanelGroup();
if(pg){panels=this.getElementChildren(pg)
}return panels
};
Spry.Widget.TabbedPanels.prototype.getIndex=function(ele,arr){ele=this.getElement(ele);
if(ele&&arr&&arr.length){for(var i=0;
i<arr.length;
i++){if(ele==arr[i]){return i
}}}return -1
};
Spry.Widget.TabbedPanels.prototype.getTabIndex=function(ele){var i=this.getIndex(ele,this.getTabs());
if(i<0){i=this.getIndex(ele,this.getContentPanels())
}return i
};
Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex=function(){return this.currentTabIndex
};
Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount=function(ele){return Math.min(this.getTabs().length,this.getContentPanels().length)
};
Spry.Widget.TabbedPanels.addEventListener=function(element,eventType,handler,capture){try{if(element.addEventListener){element.addEventListener(eventType,handler,capture)
}else{if(element.attachEvent){element.attachEvent("on"+eventType,handler)
}}}catch(e){}};
Spry.Widget.TabbedPanels.prototype.onTabClick=function(e,tab){this.showPanel(tab);
if(e.preventDefault){e.preventDefault()
}else{e.returnValue=false
}if(e.stopPropagation){e.stopPropagation()
}else{e.cancelBubble=true
}return false
};
Spry.Widget.TabbedPanels.prototype.onTabMouseOver=function(e,tab){this.addClassName(tab,this.tabHoverClass);
return false
};
Spry.Widget.TabbedPanels.prototype.onTabMouseOut=function(e,tab){this.removeClassName(tab,this.tabHoverClass);
return false
};
Spry.Widget.TabbedPanels.prototype.onTabFocus=function(e,tab){this.hasFocus=true;
this.addClassName(tab,this.tabFocusedClass);
return false
};
Spry.Widget.TabbedPanels.prototype.onTabBlur=function(e,tab){this.hasFocus=false;
this.removeClassName(tab,this.tabFocusedClass);
return false
};
Spry.Widget.TabbedPanels.ENTER_KEY=13;
Spry.Widget.TabbedPanels.SPACE_KEY=32;
Spry.Widget.TabbedPanels.prototype.onTabKeyDown=function(e,tab){var key=e.keyCode;
if(!this.hasFocus||(key!=Spry.Widget.TabbedPanels.ENTER_KEY&&key!=Spry.Widget.TabbedPanels.SPACE_KEY)){return true
}this.showPanel(tab);
if(e.preventDefault){e.preventDefault()
}else{e.returnValue=false
}if(e.stopPropagation){e.stopPropagation()
}else{e.cancelBubble=true
}return false
};
Spry.Widget.TabbedPanels.prototype.preorderTraversal=function(root,func){var stopTraversal=false;
if(root){stopTraversal=func(root);
if(root.hasChildNodes()){var child=root.firstChild;
while(!stopTraversal&&child){stopTraversal=this.preorderTraversal(child,func);
try{child=child.nextSibling
}catch(e){child=null
}}}}return stopTraversal
};
Spry.Widget.TabbedPanels.prototype.addPanelEventListeners=function(tab,panel){var self=this;
Spry.Widget.TabbedPanels.addEventListener(tab,"click",function(e){return self.onTabClick(e,tab)
},false);
Spry.Widget.TabbedPanels.addEventListener(tab,"mouseover",function(e){return self.onTabMouseOver(e,tab)
},false);
Spry.Widget.TabbedPanels.addEventListener(tab,"mouseout",function(e){return self.onTabMouseOut(e,tab)
},false);
if(this.enableKeyboardNavigation){var tabIndexEle=null;
var tabAnchorEle=null;
this.preorderTraversal(tab,function(node){if(node.nodeType==1){var tabIndexAttr=tab.attributes.getNamedItem("tabindex");
if(tabIndexAttr){tabIndexEle=node;
return true
}if(!tabAnchorEle&&node.nodeName.toLowerCase()=="a"){tabAnchorEle=node
}}return false
});
if(tabIndexEle){this.focusElement=tabIndexEle
}else{if(tabAnchorEle){this.focusElement=tabAnchorEle
}}if(this.focusElement){Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"focus",function(e){return self.onTabFocus(e,tab)
},false);
Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"blur",function(e){return self.onTabBlur(e,tab)
},false);
Spry.Widget.TabbedPanels.addEventListener(this.focusElement,"keydown",function(e){return self.onTabKeyDown(e,tab)
},false)
}}};
Spry.Widget.TabbedPanels.prototype.showPanel=function(elementOrIndex){var tpIndex=-1;
if(typeof elementOrIndex=="number"){tpIndex=elementOrIndex
}else{tpIndex=this.getTabIndex(elementOrIndex)
}if(!tpIndex<0||tpIndex>=this.getTabbedPanelCount()){return
}var tabs=this.getTabs();
var panels=this.getContentPanels();
var numTabbedPanels=Math.max(tabs.length,panels.length);
for(var i=0;
i<numTabbedPanels;
i++){if(i!=tpIndex){if(tabs[i]){this.removeClassName(tabs[i],this.tabSelectedClass)
}if(panels[i]){this.removeClassName(panels[i],this.panelVisibleClass);
panels[i].style.display="none"
}}}this.addClassName(tabs[tpIndex],this.tabSelectedClass);
this.addClassName(panels[tpIndex],this.panelVisibleClass);
panels[tpIndex].style.display="block";
this.currentTabIndex=tpIndex
};
Spry.Widget.TabbedPanels.prototype.attachBehaviors=function(element){var tabs=this.getTabs();
var panels=this.getContentPanels();
var panelCount=this.getTabbedPanelCount();
for(var i=0;
i<panelCount;
i++){this.addPanelEventListeners(tabs[i],panels[i])
}this.showPanel(this.defaultTab)
};
var Spry;
if(!Spry){Spry={}
}Spry.forwards=1;
Spry.backwards=2;
if(!Spry.Effect){Spry.Effect={}
}Spry.Effect.Transitions={linearTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+(time/duration)*change
},sinusoidalTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+((-Math.cos((time/duration)*Math.PI)/2)+0.5)*change
},squareTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+Math.pow(time/duration,2)*change
},squarerootTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+Math.sqrt(time/duration)*change
},fifthTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+Math.sqrt((-Math.cos((time/duration)*Math.PI)/2)+0.5)*change
},circleTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}var pos=time/duration;
return begin+Math.sqrt(1-Math.pow((pos-1),2))*change
},pulsateTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}return begin+(0.5+Math.sin(17*time/duration)/2)*change
},growSpecificTransition:function(time,begin,change,duration){if(time>duration){return change+begin
}var pos=time/duration;
return begin+(5*Math.pow(pos,3)-6.4*Math.pow(pos,2)+2*pos)*change
}};
for(var trans in Spry.Effect.Transitions){Spry[trans]=Spry.Effect.Transitions[trans]
}Spry.Effect.Registry=function(){this.effects=[]
};
Spry.Effect.Registry.prototype.getRegisteredEffect=function(element,options){var a={};
a.element=Spry.Effect.getElement(element);
a.options=options;
for(var i=0;
i<this.effects.length;
i++){if(this.effectsAreTheSame(this.effects[i],a)){return this.effects[i].effect
}}return false
};
Spry.Effect.Registry.prototype.addEffect=function(effect,element,options){if(!this.getRegisteredEffect(element,options)){var len=this.effects.length;
this.effects[len]={};
var eff=this.effects[len];
eff.effect=effect;
eff.element=Spry.Effect.getElement(element);
eff.options=options
}};
Spry.Effect.Registry.prototype.effectsAreTheSame=function(effectA,effectB){if(effectA.element!=effectB.element){return false
}var compare=Spry.Effect.Utils.optionsAreIdentical(effectA.options,effectB.options);
if(compare){if(typeof effectB.options.setup=="function"){effectA.options.setup=effectB.options.setup
}if(typeof effectB.options.finish=="function"){effectA.options.finish=effectB.options.finish
}}return compare
};
var SpryRegistry=new Spry.Effect.Registry;
if(!Spry.Effect.Utils){Spry.Effect.Utils={}
}Spry.Effect.Utils.showError=function(msg){alert("Spry.Effect ERR: "+msg)
};
Spry.Effect.Utils.showInitError=function(effect){Spry.Effect.Utils.showError("The "+effect+" class can't be accessed as a static function anymore. \nPlease read Spry Effects migration documentation.");
return false
};
Spry.Effect.Utils.Position=function(){this.x=0;
this.y=0;
this.units="px"
};
Spry.Effect.Utils.Rectangle=function(){this.width=0;
this.height=0;
this.units="px"
};
Spry.Effect.Utils.intToHex=function(integerNum){var result=integerNum.toString(16);
if(result.length==1){result="0"+result
}return result
};
Spry.Effect.Utils.hexToInt=function(hexStr){return parseInt(hexStr,16)
};
Spry.Effect.Utils.rgb=function(redInt,greenInt,blueInt){var intToHex=Spry.Effect.Utils.intToHex;
var redHex=intToHex(redInt);
var greenHex=intToHex(greenInt);
var blueHex=intToHex(blueInt);
compositeColorHex=redHex.concat(greenHex,blueHex).toUpperCase();
compositeColorHex="#"+compositeColorHex;
return compositeColorHex
};
Spry.Effect.Utils.longColorVersion=function(color){if(color.match(/^#[0-9a-f]{3}$/i)){var tmp=color.split("");
var color="#";
for(var i=1;
i<tmp.length;
i++){color+=tmp[i]+""+tmp[i]
}}return color
};
Spry.Effect.Utils.camelize=function(stringToCamelize){if(stringToCamelize.indexOf("-")==-1){return stringToCamelize
}var oStringList=stringToCamelize.split("-");
var isFirstEntry=true;
var camelizedString="";
for(var i=0;
i<oStringList.length;
i++){if(oStringList[i].length>0){if(isFirstEntry){camelizedString=oStringList[i];
isFirstEntry=false
}else{var s=oStringList[i];
camelizedString+=s.charAt(0).toUpperCase()+s.substring(1)
}}}return camelizedString
};
Spry.Effect.Utils.isPercentValue=function(value){var result=false;
if(typeof value=="string"&&value.length>0&&value.lastIndexOf("%")>0){result=true
}return result
};
Spry.Effect.Utils.getPercentValue=function(value){var result=0;
try{result=Number(value.substring(0,value.lastIndexOf("%")))
}catch(e){Spry.Effect.Utils.showError("Spry.Effect.Utils.getPercentValue: "+e)
}return result
};
Spry.Effect.Utils.getPixelValue=function(value){var result=0;
if(typeof value=="number"){return value
}var unitIndex=value.lastIndexOf("px");
if(unitIndex==-1){unitIndex=value.length
}try{result=parseInt(value.substring(0,unitIndex),10)
}catch(e){}return result
};
Spry.Effect.Utils.getFirstChildElement=function(node){if(node){var childCurr=node.firstChild;
while(childCurr){if(childCurr.nodeType==1){return childCurr
}childCurr=childCurr.nextSibling
}}return null
};
Spry.Effect.Utils.fetchChildImages=function(startEltIn,targetImagesOut){if(!startEltIn||startEltIn.nodeType!=1||!targetImagesOut){return
}if(startEltIn.hasChildNodes()){var childImages=startEltIn.getElementsByTagName("img");
var imageCnt=childImages.length;
for(var i=0;
i<imageCnt;
i++){var imgCurr=childImages[i];
var dimensionsCurr=Spry.Effect.getDimensions(imgCurr);
targetImagesOut.push([imgCurr,dimensionsCurr.width,dimensionsCurr.height])
}}};
Spry.Effect.Utils.optionsAreIdentical=function(optionsA,optionsB){if(optionsA==null&&optionsB==null){return true
}if(optionsA!=null&&optionsB!=null){var objectCountA=0;
var objectCountB=0;
for(var propA in optionsA){objectCountA++
}for(var propB in optionsB){objectCountB++
}if(objectCountA!=objectCountB){return false
}for(var prop in optionsA){var typeA=typeof optionsA[prop];
var typeB=typeof optionsB[prop];
if(typeA!=typeB||(typeA!="undefined"&&optionsA[prop]!=optionsB[prop])){return false
}}return true
}return false
};
Spry.Effect.Utils.DoEffect=function(effectName,element,options){if(!options){var options={}
}options.name=effectName;
var ef=SpryRegistry.getRegisteredEffect(element,options);
if(!ef){ef=new Spry.Effect[effectName](element,options);
SpryRegistry.addEffect(ef,element,options)
}ef.start();
return true
};
if(!Spry.Utils){Spry.Utils={}
}Spry.Utils.Notifier=function(){this.observers=[];
this.suppressNotifications=0
};
Spry.Utils.Notifier.prototype.addObserver=function(observer){if(!observer){return
}var len=this.observers.length;
for(var i=0;
i<len;
i++){if(this.observers[i]==observer){return
}}this.observers[len]=observer
};
Spry.Utils.Notifier.prototype.removeObserver=function(observer){if(!observer){return
}for(var i=0;
i<this.observers.length;
i++){if(this.observers[i]==observer){this.observers.splice(i,1);
break
}}};
Spry.Utils.Notifier.prototype.notifyObservers=function(methodName,data){if(!methodName){return
}if(!this.suppressNotifications){var len=this.observers.length;
for(var i=0;
i<len;
i++){var obs=this.observers[i];
if(obs){if(typeof obs=="function"){obs(methodName,this,data)
}else{if(obs[methodName]){obs[methodName](this,data)
}}}}}};
Spry.Utils.Notifier.prototype.enableNotifications=function(){if(--this.suppressNotifications<0){this.suppressNotifications=0;
Spry.Effect.Utils.showError("Unbalanced enableNotifications() call!\n")
}};
Spry.Utils.Notifier.prototype.disableNotifications=function(){++this.suppressNotifications
};
Spry.Effect.getElement=function(ele){var element=ele;
if(typeof ele=="string"){element=document.getElementById(ele)
}if(element==null){Spry.Effect.Utils.showError('Element "'+ele+'" not found.')
}return element
};
Spry.Effect.getStyleProp=function(element,prop){var value;
var camelized=Spry.Effect.Utils.camelize(prop);
try{if(element.style){value=element.style[camelized]
}if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);
value=css?css.getPropertyValue(prop):null
}else{if(element.currentStyle){value=element.currentStyle[camelized]
}}}}catch(e){Spry.Effect.Utils.showError("Spry.Effect.getStyleProp: "+e)
}return value=="auto"?null:value
};
Spry.Effect.setStyleProp=function(element,prop,value){try{element.style[Spry.Effect.Utils.camelize(prop)]=value
}catch(e){Spry.Effect.Utils.showError("Spry.Effect.setStyleProp: "+e)
}};
Spry.Effect.getStylePropRegardlessOfDisplayState=function(element,prop,displayElement){var refElement=displayElement?displayElement:element;
var displayOrig=Spry.Effect.getStyleProp(refElement,"display");
var visibilityOrig=Spry.Effect.getStyleProp(refElement,"visibility");
if(displayOrig=="none"){Spry.Effect.setStyleProp(refElement,"visibility","hidden");
Spry.Effect.setStyleProp(refElement,"display","block");
if(window.opera){refElement.focus()
}}var styleProp=Spry.Effect.getStyleProp(element,prop);
if(displayOrig=="none"){Spry.Effect.setStyleProp(refElement,"display","none");
Spry.Effect.setStyleProp(refElement,"visibility",visibilityOrig)
}return styleProp
};
Spry.Effect.makePositioned=function(element){var pos=Spry.Effect.getStyleProp(element,"position");
if(!pos||pos=="static"){element.style.position="relative";
if(window.opera){element.style.top=0;
element.style.left=0
}}};
Spry.Effect.isInvisible=function(element){var propDisplay=Spry.Effect.getStyleProp(element,"display");
if(propDisplay&&propDisplay.toLowerCase()=="none"){return true
}var propVisible=Spry.Effect.getStyleProp(element,"visibility");
if(propVisible&&propVisible.toLowerCase()=="hidden"){return true
}return false
};
Spry.Effect.enforceVisible=function(element){var propDisplay=Spry.Effect.getStyleProp(element,"display");
if(propDisplay&&propDisplay.toLowerCase()=="none"){Spry.Effect.setStyleProp(element,"display","block")
}var propVisible=Spry.Effect.getStyleProp(element,"visibility");
if(propVisible&&propVisible.toLowerCase()=="hidden"){Spry.Effect.setStyleProp(element,"visibility","visible")
}};
Spry.Effect.makeClipping=function(element){var overflow=Spry.Effect.getStyleProp(element,"overflow");
if(!overflow||(overflow.toLowerCase()!="hidden"&&overflow.toLowerCase()!="scroll")){var heightCache=0;
var needsCache=/MSIE 7.0/.test(navigator.userAgent)&&/Windows NT/.test(navigator.userAgent);
if(needsCache){heightCache=Spry.Effect.getDimensionsRegardlessOfDisplayState(element).height
}Spry.Effect.setStyleProp(element,"overflow","hidden");
if(needsCache){Spry.Effect.setStyleProp(element,"height",heightCache+"px")
}}};
Spry.Effect.cleanWhitespace=function(element){var childCountInit=element.childNodes.length;
for(var i=childCountInit-1;
i>=0;
i--){var node=element.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){try{element.removeChild(node)
}catch(e){Spry.Effect.Utils.showError("Spry.Effect.cleanWhitespace: "+e)
}}}};
Spry.Effect.getComputedStyle=function(element){return/MSIE/.test(navigator.userAgent)?element.currentStyle:document.defaultView.getComputedStyle(element,null)
};
Spry.Effect.getDimensions=function(element){var dimensions=new Spry.Effect.Utils.Rectangle;
var computedStyle=null;
if(element.style.width&&/px/i.test(element.style.width)){dimensions.width=parseInt(element.style.width,10)
}else{computedStyle=Spry.Effect.getComputedStyle(element);
var tryComputedStyle=computedStyle&&computedStyle.width&&/px/i.test(computedStyle.width);
if(tryComputedStyle){dimensions.width=parseInt(computedStyle.width,10)
}if(!tryComputedStyle||dimensions.width==0){dimensions.width=element.offsetWidth
}}if(element.style.height&&/px/i.test(element.style.height)){dimensions.height=parseInt(element.style.height,10)
}else{if(!computedStyle){computedStyle=Spry.Effect.getComputedStyle(element)
}var tryComputedStyle=computedStyle&&computedStyle.height&&/px/i.test(computedStyle.height);
if(tryComputedStyle){dimensions.height=parseInt(computedStyle.height,10)
}if(!tryComputedStyle||dimensions.height==0){dimensions.height=element.offsetHeight
}}return dimensions
};
Spry.Effect.getDimensionsRegardlessOfDisplayState=function(element,displayElement){var refElement=displayElement?displayElement:element;
var displayOrig=Spry.Effect.getStyleProp(refElement,"display");
var visibilityOrig=Spry.Effect.getStyleProp(refElement,"visibility");
if(displayOrig=="none"){Spry.Effect.setStyleProp(refElement,"visibility","hidden");
Spry.Effect.setStyleProp(refElement,"display","block");
if(window.opera){refElement.focus()
}}var dimensions=Spry.Effect.getDimensions(element);
if(displayOrig=="none"){Spry.Effect.setStyleProp(refElement,"display","none");
Spry.Effect.setStyleProp(refElement,"visibility",visibilityOrig)
}return dimensions
};
Spry.Effect.getOpacity=function(element){var o=Spry.Effect.getStyleProp(element,"opacity");
if(typeof o=="undefined"||o==null){o=1
}return o
};
Spry.Effect.getBgColor=function(ele){return Spry.Effect.getStyleProp(ele,"background-color")
};
Spry.Effect.intPropStyle=function(e,prop){var i=parseInt(Spry.Effect.getStyleProp(e,prop),10);
if(isNaN(i)){return 0
}return i
};
Spry.Effect.getPosition=function(element){var position=new Spry.Effect.Utils.Position;
var computedStyle=null;
if(element.style.left&&/px/i.test(element.style.left)){position.x=parseInt(element.style.left,10)
}else{computedStyle=Spry.Effect.getComputedStyle(element);
var tryComputedStyle=computedStyle&&computedStyle.left&&/px/i.test(computedStyle.left);
if(tryComputedStyle){position.x=parseInt(computedStyle.left,10)
}if(!tryComputedStyle||position.x==0){position.x=element.offsetLeft
}}if(element.style.top&&/px/i.test(element.style.top)){position.y=parseInt(element.style.top,10)
}else{if(!computedStyle){computedStyle=Spry.Effect.getComputedStyle(element)
}var tryComputedStyle=computedStyle&&computedStyle.top&&/px/i.test(computedStyle.top);
if(tryComputedStyle){position.y=parseInt(computedStyle.top,10)
}if(!tryComputedStyle||position.y==0){position.y=element.offsetTop
}}return position
};
Spry.Effect.getOffsetPosition=Spry.Effect.getPosition;
Spry.Effect.Animator=function(options){Spry.Utils.Notifier.call(this);
this.name="Animator";
this.element=null;
this.startMilliseconds=0;
this.repeat="none";
this.isRunning=false;
this.timer=null;
this.cancelRemaining=0;
if(!options){var options={}
}if(options.toggle){this.direction=false
}else{this.direction=Spry.forwards
}var self=this;
if(options.setup!=null){this.addObserver({onPreEffect:function(){try{self.options.setup(self.element,self)
}catch(e){Spry.Effect.Utils.showError("Spry.Effect.Animator.prototype.start: setup callback: "+e)
}}})
}if(options.finish!=null){this.addObserver({onPostEffect:function(){try{self.options.finish(self.element,self)
}catch(e){Spry.Effect.Utils.showError("Spry.Effect.Animator.prototype.stop: finish callback: "+e)
}}})
}this.options={duration:1000,toggle:false,transition:Spry.linearTransition,interval:16};
this.setOptions(options);
if(options.transition){this.setTransition(options.transition)
}if(options.fps){this.setFps(options.fps)
}};
Spry.Effect.Animator.prototype=new Spry.Utils.Notifier();
Spry.Effect.Animator.prototype.constructor=Spry.Utils.Animator;
Spry.Effect.Animator.prototype.notStaticAnimator=true;
Spry.Effect.Animator.prototype.setOptions=function(options){if(!options){return
}for(var prop in options){this.options[prop]=options[prop]
}};
Spry.Effect.Animator.prototype.setTransition=function(transition){if(typeof transition=="number"||transition=="1"||transition=="2"){switch(parseInt(transition,10)){case 1:transition=Spry.linearTransition;
break;
case 2:transition=Spry.sinusoidalTransition;
break;
default:Spry.Effect.Utils.showError("unknown transition")
}}else{if(typeof transition=="string"){if(typeof window[transition]=="function"){transition=window[transition]
}else{if(typeof Spry[transition]=="function"){transition=Spry[transition]
}else{Spry.Effect.Utils.showError("unknown transition")
}}}}this.options.transition=transition;
if(typeof this.effectsArray!="undefined"){var l=this.effectsArray.length;
for(var i=0;
i<l;
i++){this.effectsArray[i].effect.setTransition(transition)
}}};
Spry.Effect.Animator.prototype.setDuration=function(duration){this.options.duration=duration;
if(typeof this.effectsArray!="undefined"){var l=this.effectsArray.length;
for(var i=0;
i<l;
i++){this.effectsArray[i].effect.setDuration(duration)
}}};
Spry.Effect.Animator.prototype.setFps=function(fps){this.options.interval=parseInt(1000/fps,10);
this.options.fps=fps;
if(typeof this.effectsArray!="undefined"){var l=this.effectsArray.length;
for(var i=0;
i<l;
i++){this.effectsArray[i].effect.setFps(fps)
}}};
Spry.Effect.Animator.prototype.start=function(withoutTimer){if(!this.element){return
}if(arguments.length==0){withoutTimer=false
}if(this.isRunning){this.cancel()
}this.prepareStart();
var currDate=new Date();
this.startMilliseconds=currDate.getTime();
if(this.element.id){this.element=document.getElementById(this.element.id)
}if(this.cancelRemaining!=0&&this.options.toggle){if(this.cancelRemaining<1&&typeof this.options.transition=="function"){var startTime=0;
var stopTime=this.options.duration;
var start=0;
var stop=1;
var emergency=0;
this.cancelRemaining=Math.round(this.cancelRemaining*1000)/1000;
var found=false;
var middle=0;
while(!found){if(emergency++>this.options.duration){break
}var half=startTime+((stopTime-startTime)/2);
middle=Math.round(this.options.transition(half,1,-1,this.options.duration)*1000)/1000;
if(middle==this.cancelRemaining){this.startMilliseconds-=half;
found=true
}if(middle<this.cancelRemaining){stopTime=half;
stop=middle
}else{startTime=half;
start=middle
}}}this.cancelRemaining=0
}this.notifyObservers("onPreEffect",this);
if(withoutTimer==false){var self=this;
this.timer=setInterval(function(){self.drawEffect()
},this.options.interval)
}this.isRunning=true
};
Spry.Effect.Animator.prototype.stopFlagReset=function(){if(this.timer){clearInterval(this.timer);
this.timer=null
}this.startMilliseconds=0
};
Spry.Effect.Animator.prototype.stop=function(){this.stopFlagReset();
this.notifyObservers("onPostEffect",this);
this.isRunning=false
};
Spry.Effect.Animator.prototype.cancel=function(){var elapsed=this.getElapsedMilliseconds();
if(this.startMilliseconds>0&&elapsed<this.options.duration){this.cancelRemaining=this.options.transition(elapsed,0,1,this.options.duration)
}this.stopFlagReset();
this.notifyObservers("onCancel",this);
this.isRunning=false
};
Spry.Effect.Animator.prototype.drawEffect=function(){var isRunning=true;
this.notifyObservers("onStep",this);
var timeElapsed=this.getElapsedMilliseconds();
if(typeof this.options.transition!="function"){Spry.Effect.Utils.showError("unknown transition");
return
}this.animate();
if(timeElapsed>this.options.duration){isRunning=false;
this.stop()
}return isRunning
};
Spry.Effect.Animator.prototype.getElapsedMilliseconds=function(){if(this.startMilliseconds>0){var currDate=new Date();
return(currDate.getTime()-this.startMilliseconds)
}return 0
};
Spry.Effect.Animator.prototype.doToggle=function(){if(!this.direction){this.direction=Spry.forwards;
return
}if(this.options.toggle==true){if(this.direction==Spry.forwards){this.direction=Spry.backwards;
this.notifyObservers("onToggle",this)
}else{if(this.direction==Spry.backwards){this.direction=Spry.forwards
}}}};
Spry.Effect.Animator.prototype.prepareStart=function(){if(this.options&&this.options.toggle){this.doToggle()
}};
Spry.Effect.Animator.prototype.animate=function(){};
Spry.Effect.Animator.prototype.onStep=function(el){if(el!=this){this.notifyObservers("onStep",this)
}};
Spry.Effect.Move=function(element,fromPos,toPos,options){this.dynamicFromPos=false;
if(arguments.length==3){options=toPos;
toPos=fromPos;
fromPos=Spry.Effect.getPosition(element);
this.dynamicFromPos=true
}Spry.Effect.Animator.call(this,options);
this.name="Move";
this.element=Spry.Effect.getElement(element);
if(!this.element){return
}if(fromPos.units!=toPos.units){Spry.Effect.Utils.showError("Spry.Effect.Move: Conflicting units ("+fromPos.units+", "+toPos.units+")")
}this.units=fromPos.units;
this.startX=Number(fromPos.x);
this.stopX=Number(toPos.x);
this.startY=Number(fromPos.y);
this.stopY=Number(toPos.y)
};
Spry.Effect.Move.prototype=new Spry.Effect.Animator();
Spry.Effect.Move.prototype.constructor=Spry.Effect.Move;
Spry.Effect.Move.prototype.animate=function(){var left=0;
var top=0;
var floor=Math.floor;
var elapsed=this.getElapsedMilliseconds();
if(this.direction==Spry.forwards){left=floor(this.options.transition(elapsed,this.startX,this.stopX-this.startX,this.options.duration));
top=floor(this.options.transition(elapsed,this.startY,this.stopY-this.startY,this.options.duration))
}else{if(this.direction==Spry.backwards){left=floor(this.options.transition(elapsed,this.stopX,this.startX-this.stopX,this.options.duration));
top=floor(this.options.transition(elapsed,this.stopY,this.startY-this.stopY,this.options.duration))
}}this.element.style.left=left+this.units;
this.element.style.top=top+this.units
};
Spry.Effect.Move.prototype.prepareStart=function(){if(this.options&&this.options.toggle){this.doToggle()
}if(this.dynamicFromPos==true){var fromPos=Spry.Effect.getPosition(this.element);
this.startX=fromPos.x;
this.startY=fromPos.y;
this.rangeMoveX=this.startX-this.stopX;
this.rangeMoveY=this.startY-this.stopY
}};
Spry.Effect.Size=function(element,fromRect,toRect,options){this.dynamicFromRect=false;
if(arguments.length==3){options=toRect;
toRect=fromRect;
fromRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
this.dynamicFromRect=true
}Spry.Effect.Animator.call(this,options);
this.name="Size";
this.element=Spry.Effect.getElement(element);
if(!this.element){return
}element=this.element;
if(fromRect.units!=toRect.units){Spry.Effect.Utils.showError("Spry.Effect.Size: Conflicting units ("+fromRect.units+", "+toRect.units+")");
return false
}this.units=fromRect.units;
var originalRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
this.originalWidth=originalRect.width;
this.originalHeight=originalRect.height;
this.startWidth=fromRect.width;
this.startHeight=fromRect.height;
this.stopWidth=toRect.width;
this.stopHeight=toRect.height;
this.childImages=new Array();
if(this.options.useCSSBox){Spry.Effect.makePositioned(this.element);
var intProp=Spry.Effect.intPropStyle;
this.startFromBorder_top=intProp(element,"border-top-width");
this.startFromBorder_bottom=intProp(element,"border-bottom-width");
this.startFromBorder_left=intProp(element,"border-left-width");
this.startFromBorder_right=intProp(element,"border-right-width");
this.startFromPadding_top=intProp(element,"padding-top");
this.startFromPadding_bottom=intProp(element,"padding-bottom");
this.startFromPadding_left=intProp(element,"padding-left");
this.startFromPadding_right=intProp(element,"padding-right");
this.startFromMargin_top=intProp(element,"margin-top");
this.startFromMargin_bottom=intProp(element,"margin-bottom");
this.startFromMargin_right=intProp(element,"margin-right");
this.startFromMargin_left=intProp(element,"margin-left");
this.startLeft=intProp(element,"left");
this.startTop=intProp(element,"top")
}if(this.options.scaleContent){Spry.Effect.Utils.fetchChildImages(element,this.childImages)
}this.fontFactor=1;
var fontSize=Spry.Effect.getStyleProp(this.element,"font-size");
if(fontSize&&/em\s*$/.test(fontSize)){this.fontFactor=parseFloat(fontSize)
}var isPercent=Spry.Effect.Utils.isPercentValue;
if(isPercent(this.startWidth)){var startWidthPercent=Spry.Effect.Utils.getPercentValue(this.startWidth);
this.startWidth=originalRect.width*(startWidthPercent/100)
}if(isPercent(this.startHeight)){var startHeightPercent=Spry.Effect.Utils.getPercentValue(this.startHeight);
this.startHeight=originalRect.height*(startHeightPercent/100)
}if(isPercent(this.stopWidth)){var stopWidthPercent=Spry.Effect.Utils.getPercentValue(this.stopWidth);
this.stopWidth=originalRect.width*(stopWidthPercent/100)
}if(isPercent(this.stopHeight)){var stopHeightPercent=Spry.Effect.Utils.getPercentValue(this.stopHeight);
this.stopHeight=originalRect.height*(stopHeightPercent/100)
}this.enforceVisible=Spry.Effect.isInvisible(this.element)
};
Spry.Effect.Size.prototype=new Spry.Effect.Animator();
Spry.Effect.Size.prototype.constructor=Spry.Effect.Size;
Spry.Effect.Size.prototype.animate=function(){var width=0;
var height=0;
var fontSize=0;
var direction=0;
var floor=Math.floor;
var elapsed=this.getElapsedMilliseconds();
if(this.direction==Spry.forwards){width=floor(this.options.transition(elapsed,this.startWidth,this.stopWidth-this.startWidth,this.options.duration));
height=floor(this.options.transition(elapsed,this.startHeight,this.stopHeight-this.startHeight,this.options.duration));
direction=1
}else{if(this.direction==Spry.backwards){width=floor(this.options.transition(elapsed,this.stopWidth,this.startWidth-this.stopWidth,this.options.duration));
height=floor(this.options.transition(elapsed,this.stopHeight,this.startHeight-this.stopHeight,this.options.duration));
direction=-1
}}var propFactor=width/this.originalWidth;
fontSize=this.fontFactor*propFactor;
var elStyle=this.element.style;
if(width<0){width=0
}if(height<0){height=0
}elStyle.width=width+this.units;
elStyle.height=height+this.units;
if(typeof this.options.useCSSBox!="undefined"&&this.options.useCSSBox==true){var intProp=Spry.Effect.intPropStyle;
var origTop=intProp(this.element,"top");
var origLeft=intProp(this.element,"left");
var origMarginTop=intProp(this.element,"margin-top");
var origMarginLeft=intProp(this.element,"margin-left");
var widthFactor=propFactor;
var heightFactor=height/this.originalHeight;
var border_top=floor(this.startFromBorder_top*heightFactor);
var border_bottom=floor(this.startFromBorder_bottom*heightFactor);
var border_left=floor(this.startFromBorder_left*widthFactor);
var border_right=floor(this.startFromBorder_right*widthFactor);
var padding_top=floor(this.startFromPadding_top*heightFactor);
var padding_bottom=floor(this.startFromPadding_bottom*heightFactor);
var padding_left=floor(this.startFromPadding_left*widthFactor);
var padding_right=floor(this.startFromPadding_right*widthFactor);
var margin_top=floor(this.startFromMargin_top*heightFactor);
var margin_bottom=floor(this.startFromMargin_bottom*heightFactor);
var margin_right=floor(this.startFromMargin_right*widthFactor);
var margin_left=floor(this.startFromMargin_left*widthFactor);
elStyle.borderTopWidth=border_top+this.units;
elStyle.borderBottomWidth=border_bottom+this.units;
elStyle.borderLeftWidth=border_left+this.units;
elStyle.borderRightWidth=border_right+this.units;
elStyle.paddingTop=padding_top+this.units;
elStyle.paddingBottom=padding_bottom+this.units;
elStyle.paddingLeft=padding_left+this.units;
elStyle.paddingRight=padding_right+this.units;
elStyle.marginTop=margin_top+this.units;
elStyle.marginBottom=margin_bottom+this.units;
elStyle.marginLeft=margin_left+this.units;
elStyle.marginRight=margin_right+this.units;
elStyle.left=floor(origLeft+origMarginLeft-margin_left)+this.units;
elStyle.top=floor(origTop+origMarginTop-margin_top)+this.units
}if(this.options.scaleContent){for(var i=0;
i<this.childImages.length;
i++){this.childImages[i][0].style.width=propFactor*this.childImages[i][1]+this.units;
this.childImages[i][0].style.height=propFactor*this.childImages[i][2]+this.units
}this.element.style.fontSize=fontSize+"em"
}if(this.enforceVisible){Spry.Effect.enforceVisible(this.element);
this.enforceVisible=false
}};
Spry.Effect.Size.prototype.prepareStart=function(){if(this.options&&this.options.toggle){this.doToggle()
}if(this.dynamicFromRect==true){var fromRect=Spry.Effect.getDimensions(element);
this.startWidth=fromRect.width;
this.startHeight=fromRect.height;
this.widthRange=this.startWidth-this.stopWidth;
this.heightRange=this.startHeight-this.stopHeight
}};
Spry.Effect.Opacity=function(element,startOpacity,stopOpacity,options){this.dynamicStartOpacity=false;
if(arguments.length==3){options=stopOpacity;
stopOpacity=startOpacity;
startOpacity=Spry.Effect.getOpacity(element);
this.dynamicStartOpacity=true
}Spry.Effect.Animator.call(this,options);
this.name="Opacity";
this.element=Spry.Effect.getElement(element);
if(!this.element){return
}if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout)){Spry.Effect.setStyleProp(this.element,"zoom","1")
}this.startOpacity=startOpacity;
this.stopOpacity=stopOpacity;
this.enforceVisible=Spry.Effect.isInvisible(this.element)
};
Spry.Effect.Opacity.prototype=new Spry.Effect.Animator();
Spry.Effect.Opacity.prototype.constructor=Spry.Effect.Opacity;
Spry.Effect.Opacity.prototype.animate=function(){var opacity=0;
var elapsed=this.getElapsedMilliseconds();
if(this.direction==Spry.forwards){opacity=this.options.transition(elapsed,this.startOpacity,this.stopOpacity-this.startOpacity,this.options.duration)
}else{if(this.direction==Spry.backwards){opacity=this.options.transition(elapsed,this.stopOpacity,this.startOpacity-this.stopOpacity,this.options.duration)
}}if(opacity<0){opacity=0
}if(/MSIE/.test(navigator.userAgent)){var tmpval=Spry.Effect.getStyleProp(this.element,"filter");
if(tmpval){tmpval=tmpval.replace(/alpha\(opacity=[0-9]{1,3}\)/g,"")
}this.element.style.filter=tmpval+"alpha(opacity="+Math.floor(opacity*100)+")"
}else{this.element.style.opacity=opacity
}if(this.enforceVisible){Spry.Effect.enforceVisible(this.element);
this.enforceVisible=false
}};
Spry.Effect.Opacity.prototype.prepareStart=function(){if(this.options&&this.options.toggle){this.doToggle()
}if(this.dynamicStartOpacity==true){this.startOpacity=Spry.Effect.getOpacity(element);
this.opacityRange=this.startOpacity-this.stopOpacity
}};
Spry.Effect.Color=function(element,startColor,stopColor,options){this.dynamicStartColor=false;
if(arguments.length==3){options=stopColor;
stopColor=startColor;
startColor=Spry.Effect.getBgColor(element);
this.dynamicStartColor=true
}Spry.Effect.Animator.call(this,options);
this.name="Color";
this.element=Spry.Effect.getElement(element);
if(!this.element){return
}this.startColor=startColor;
this.stopColor=stopColor;
this.startRedColor=Spry.Effect.Utils.hexToInt(startColor.substr(1,2));
this.startGreenColor=Spry.Effect.Utils.hexToInt(startColor.substr(3,2));
this.startBlueColor=Spry.Effect.Utils.hexToInt(startColor.substr(5,2));
this.stopRedColor=Spry.Effect.Utils.hexToInt(stopColor.substr(1,2));
this.stopGreenColor=Spry.Effect.Utils.hexToInt(stopColor.substr(3,2));
this.stopBlueColor=Spry.Effect.Utils.hexToInt(stopColor.substr(5,2))
};
Spry.Effect.Color.prototype=new Spry.Effect.Animator();
Spry.Effect.Color.prototype.constructor=Spry.Effect.Color;
Spry.Effect.Color.prototype.animate=function(){var redColor=0;
var greenColor=0;
var blueColor=0;
var floor=Math.floor;
var elapsed=this.getElapsedMilliseconds();
if(this.direction==Spry.forwards){redColor=floor(this.options.transition(elapsed,this.startRedColor,this.stopRedColor-this.startRedColor,this.options.duration));
greenColor=floor(this.options.transition(elapsed,this.startGreenColor,this.stopGreenColor-this.startGreenColor,this.options.duration));
blueColor=floor(this.options.transition(elapsed,this.startBlueColor,this.stopBlueColor-this.startBlueColor,this.options.duration))
}else{if(this.direction==Spry.backwards){redColor=floor(this.options.transition(elapsed,this.stopRedColor,this.startRedColor-this.stopRedColor,this.options.duration));
greenColor=floor(this.options.transition(elapsed,this.stopGreenColor,this.startGreenColor-this.stopGreenColor,this.options.duration));
blueColor=floor(this.options.transition(elapsed,this.stopBlueColor,this.startBlueColor-this.stopBlueColor,this.options.duration))
}}this.element.style.backgroundColor=Spry.Effect.Utils.rgb(redColor,greenColor,blueColor)
};
Spry.Effect.Color.prototype.prepareStart=function(){if(this.options&&this.options.toggle){this.doToggle()
}if(this.dynamicStartColor==true){this.startColor=Spry.Effect.getBgColor(element);
this.startRedColor=Spry.Effect.Utils.hexToInt(startColor.substr(1,2));
this.startGreenColor=Spry.Effect.Utils.hexToInt(startColor.substr(3,2));
this.startBlueColor=Spry.Effect.Utils.hexToInt(startColor.substr(5,2));
this.redColorRange=this.startRedColor-this.stopRedColor;
this.greenColorRange=this.startGreenColor-this.stopGreenColor;
this.blueColorRange=this.startBlueColor-this.stopBlueColor
}};
Spry.Effect.Cluster=function(options){Spry.Effect.Animator.call(this,options);
this.name="Cluster";
this.effectsArray=new Array();
this.currIdx=-1;
var _ClusteredEffect=function(effect,kind){this.effect=effect;
this.kind=kind;
this.isRunning=false
};
this.ClusteredEffect=_ClusteredEffect
};
Spry.Effect.Cluster.prototype=new Spry.Effect.Animator();
Spry.Effect.Cluster.prototype.constructor=Spry.Effect.Cluster;
Spry.Effect.Cluster.prototype.setInterval=function(interval){var l=this.effectsArray.length;
this.options.interval=interval;
for(var i=0;
i<l;
i++){this.effectsArray[i].effect.setInterval(interval)
}};
Spry.Effect.Cluster.prototype.drawEffect=function(){var isRunning=true;
var allEffectsDidRun=false;
var baseEffectIsStillRunning=false;
var evalNextEffectsRunning=false;
if((this.currIdx==-1&&this.direction==Spry.forwards)||(this.currIdx==this.effectsArray.length&&this.direction==Spry.backwards)){this.initNextEffectsRunning()
}var start=this.direction==Spry.forwards?0:this.effectsArray.length-1;
var stop=this.direction==Spry.forwards?this.effectsArray.length:-1;
var step=this.direction==Spry.forwards?1:-1;
for(var i=start;
i!=stop;
i+=step){if(this.effectsArray[i].isRunning==true){baseEffectIsStillRunning=this.effectsArray[i].effect.drawEffect();
if(baseEffectIsStillRunning==false&&i==this.currIdx){this.effectsArray[i].isRunning=false;
evalNextEffectsRunning=true
}}}if(evalNextEffectsRunning==true){allEffectsDidRun=this.initNextEffectsRunning()
}if(allEffectsDidRun==true){this.stop();
isRunning=false;
for(var i=0;
i<this.effectsArray.length;
i++){this.effectsArray[i].isRunning=false
}this.currIdx=this.direction==Spry.forwards?this.effectsArray.length:-1
}return isRunning
};
Spry.Effect.Cluster.prototype.initNextEffectsRunning=function(){var allEffectsDidRun=false;
var step=this.direction==Spry.forwards?1:-1;
var stop=this.direction==Spry.forwards?this.effectsArray.length:-1;
this.currIdx+=step;
if((this.currIdx>(this.effectsArray.length-1)&&this.direction==Spry.forwards)||(this.currIdx<0&&this.direction==Spry.backwards)){allEffectsDidRun=true
}else{for(var i=this.currIdx;
i!=stop;
i+=step){if((i>this.currIdx&&this.direction==Spry.forwards||i<this.currIdx&&this.direction==Spry.backwards)&&this.effectsArray[i].kind=="queue"){break
}this.effectsArray[i].effect.start(true);
this.effectsArray[i].isRunning=true;
this.currIdx=i
}}return allEffectsDidRun
};
Spry.Effect.Cluster.prototype.toggleCluster=function(){if(!this.direction){this.direction=Spry.forwards;
return
}if(this.options.toggle==true){if(this.direction==Spry.forwards){this.direction=Spry.backwards;
this.notifyObservers("onToggle",this);
this.currIdx=this.effectsArray.length
}else{if(this.direction==Spry.backwards){this.direction=Spry.forwards;
this.currIdx=-1
}}}else{if(this.direction==Spry.forwards){this.currIdx=-1
}else{if(this.direction==Spry.backwards){this.currIdx=this.effectsArray.length
}}}};
Spry.Effect.Cluster.prototype.doToggle=function(){this.toggleCluster();
for(var i=0;
i<this.effectsArray.length;
i++){if(this.effectsArray[i].effect.options&&(this.effectsArray[i].effect.options.toggle!=null)){if(this.effectsArray[i].effect.options.toggle==true){this.effectsArray[i].effect.doToggle()
}}}};
Spry.Effect.Cluster.prototype.cancel=function(){for(var i=0;
i<this.effectsArray.length;
i++){if(this.effectsArray[i].effect.isRunning){this.effectsArray[i].effect.cancel()
}}var elapsed=this.getElapsedMilliseconds();
if(this.startMilliseconds>0&&elapsed<this.options.duration){this.cancelRemaining=this.options.transition(elapsed,0,1,this.options.duration)
}this.stopFlagReset();
this.notifyObservers("onCancel",this);
this.isRunning=false
};
Spry.Effect.Cluster.prototype.addNextEffect=function(effect){effect.addObserver(this);
this.effectsArray[this.effectsArray.length]=new this.ClusteredEffect(effect,"queue");
if(this.effectsArray.length==1){this.element=effect.element
}};
Spry.Effect.Cluster.prototype.addParallelEffect=function(effect){if(this.effectsArray.length==0||this.effectsArray[this.effectsArray.length-1].kind!="parallel"){effect.addObserver(this)
}this.effectsArray[this.effectsArray.length]=new this.ClusteredEffect(effect,"parallel");
if(this.effectsArray.length==1){this.element=effect.element
}};
Spry.Effect.Cluster.prototype.prepareStart=function(){this.toggleCluster()
};
Spry.Effect.Fade=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Fade")
}Spry.Effect.Cluster.call(this,options);
this.name="Fade";
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var durationInMilliseconds=1000;
var fromOpacity=0;
var toOpacity=100;
var doToggle=false;
var transition=Spry.fifthTransition;
var fps=60;
var originalOpacity=0;
if(/MSIE/.test(navigator.userAgent)){originalOpacity=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(this.element,"filter").replace(/alpha\(opacity=([0-9]{1,3})\)/g,"$1"),10)
}else{originalOpacity=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(this.element,"opacity")*100,10)
}if(isNaN(originalOpacity)){originalOpacity=100
}if(options){if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.from!=null){if(Spry.Effect.Utils.isPercentValue(options.from)){fromOpacity=Spry.Effect.Utils.getPercentValue(options.from)*originalOpacity/100
}else{fromOpacity=options.from
}}if(options.to!=null){if(Spry.Effect.Utils.isPercentValue(options.to)){toOpacity=Spry.Effect.Utils.getPercentValue(options.to)*originalOpacity/100
}else{toOpacity=options.to
}}if(options.toggle!=null){doToggle=options.toggle
}if(options.transition!=null){transition=options.transition
}if(options.fps!=null){fps=options.fps
}else{this.options.transition=transition
}}fromOpacity=fromOpacity/100;
toOpacity=toOpacity/100;
options={duration:durationInMilliseconds,toggle:doToggle,transition:transition,from:fromOpacity,to:toOpacity,fps:fps};
var fadeEffect=new Spry.Effect.Opacity(element,fromOpacity,toOpacity,options);
this.addNextEffect(fadeEffect)
};
Spry.Effect.Fade.prototype=new Spry.Effect.Cluster();
Spry.Effect.Fade.prototype.constructor=Spry.Effect.Fade;
Spry.Effect.Blind=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Blind")
}Spry.Effect.Cluster.call(this,options);
this.name="Blind";
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var durationInMilliseconds=1000;
var doToggle=false;
var kindOfTransition=Spry.circleTransition;
var fps=60;
var doScaleContent=false;
Spry.Effect.makeClipping(element);
var originalRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
var fromHeightPx=originalRect.height;
var toHeightPx=0;
var optionFrom=options?options.from:originalRect.height;
var optionTo=options?options.to:0;
var fullCSSBox=false;
if(options){if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.from!=null){if(Spry.Effect.Utils.isPercentValue(options.from)){fromHeightPx=Spry.Effect.Utils.getPercentValue(options.from)*originalRect.height/100
}else{fromHeightPx=Spry.Effect.Utils.getPixelValue(options.from)
}}if(options.to!=null){if(Spry.Effect.Utils.isPercentValue(options.to)){toHeightPx=Spry.Effect.Utils.getPercentValue(options.to)*originalRect.height/100
}else{toHeightPx=Spry.Effect.Utils.getPixelValue(options.to)
}}if(options.toggle!=null){doToggle=options.toggle
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}if(options.useCSSBox!=null){fullCSSBox=options.useCSSBox
}}var fromRect=new Spry.Effect.Utils.Rectangle;
fromRect.width=originalRect.width;
fromRect.height=fromHeightPx;
var toRect=new Spry.Effect.Utils.Rectangle;
toRect.width=originalRect.width;
toRect.height=toHeightPx;
options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,scaleContent:doScaleContent,useCSSBox:fullCSSBox,from:optionFrom,to:optionTo,fps:fps};
var blindEffect=new Spry.Effect.Size(element,fromRect,toRect,options);
this.addNextEffect(blindEffect)
};
Spry.Effect.Blind.prototype=new Spry.Effect.Cluster();
Spry.Effect.Blind.prototype.constructor=Spry.Effect.Blind;
Spry.Effect.Highlight=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Highlight")
}Spry.Effect.Cluster.call(this,options);
this.name="Highlight";
var durationInMilliseconds=1000;
var toColor="#ffffff";
var doToggle=false;
var kindOfTransition=Spry.sinusoidalTransition;
var fps=60;
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var fromColor=Spry.Effect.getBgColor(element);
if(fromColor=="transparent"){fromColor="#ffff99"
}if(options){if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.from!=null){fromColor=options.from
}if(options.to!=null){toColor=options.to
}if(options.toggle!=null){doToggle=options.toggle
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}}if(fromColor.indexOf("rgb")!=-1){var fromColor=Spry.Effect.Utils.rgb(parseInt(fromColor.substring(fromColor.indexOf("(")+1,fromColor.indexOf(",")),10),parseInt(fromColor.substring(fromColor.indexOf(",")+1,fromColor.lastIndexOf(",")),10),parseInt(fromColor.substring(fromColor.lastIndexOf(",")+1,fromColor.indexOf(")")),10))
}if(toColor.indexOf("rgb")!=-1){var toColor=Spry.Effect.Utils.rgb(parseInt(toColor.substring(toColor.indexOf("(")+1,toColor.indexOf(",")),10),parseInt(toColor.substring(toColor.indexOf(",")+1,toColor.lastIndexOf(",")),10),parseInt(toColor.substring(toColor.lastIndexOf(",")+1,toColor.indexOf(")")),10))
}var fromColor=Spry.Effect.Utils.longColorVersion(fromColor);
var toColor=Spry.Effect.Utils.longColorVersion(toColor);
this.restoreBackgroundImage=Spry.Effect.getStyleProp(element,"background-image");
options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,fps:fps};
var highlightEffect=new Spry.Effect.Color(element,fromColor,toColor,options);
this.addNextEffect(highlightEffect);
this.addObserver({onPreEffect:function(effect){Spry.Effect.setStyleProp(effect.element,"background-image","none")
},onPostEffect:function(effect){Spry.Effect.setStyleProp(effect.element,"background-image",effect.restoreBackgroundImage);
if(effect.direction==Spry.forwards&&effect.options.restoreColor){Spry.Effect.setStyleProp(element,"background-color",effect.options.restoreColor)
}}})
};
Spry.Effect.Highlight.prototype=new Spry.Effect.Cluster();
Spry.Effect.Highlight.prototype.constructor=Spry.Effect.Highlight;
Spry.Effect.Slide=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Slide")
}Spry.Effect.Cluster.call(this,options);
this.name="Slide";
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var durationInMilliseconds=1000;
var doToggle=false;
var kindOfTransition=Spry.sinusoidalTransition;
var fps=60;
var slideHorizontally=false;
var firstChildElt=Spry.Effect.Utils.getFirstChildElement(element);
var direction=-1;
if(/MSIE 7.0/.test(navigator.userAgent)&&/Windows NT/.test(navigator.userAgent)){Spry.Effect.makePositioned(element)
}Spry.Effect.makeClipping(element);
if(/MSIE 6.0/.test(navigator.userAgent)&&/Windows NT/.test(navigator.userAgent)){var pos=Spry.Effect.getStyleProp(element,"position");
if(pos&&(pos=="static"||pos=="fixed")){Spry.Effect.setStyleProp(element,"position","relative");
Spry.Effect.setStyleProp(element,"top","");
Spry.Effect.setStyleProp(element,"left","")
}}if(firstChildElt){Spry.Effect.makePositioned(firstChildElt);
Spry.Effect.makeClipping(firstChildElt);
var childRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(firstChildElt,element);
Spry.Effect.setStyleProp(firstChildElt,"width",childRect.width+"px")
}var fromDim=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
var initDim=new Spry.Effect.Utils.Rectangle();
var toDim=new Spry.Effect.Utils.Rectangle();
initDim.width=toDim.width=fromDim.width;
initDim.height=toDim.height=fromDim.height;
if(!this.options.to){if(!options){options={}
}options.to="0%"
}if(options&&options.horizontal!==null&&options.horizontal===true){slideHorizontally=true
}if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.from!=null){if(slideHorizontally){if(Spry.Effect.Utils.isPercentValue(options.from)){fromDim.width=initDim.width*Spry.Effect.Utils.getPercentValue(options.from)/100
}else{fromDim.width=Spry.Effect.Utils.getPixelValue(options.from)
}}else{if(Spry.Effect.Utils.isPercentValue(options.from)){fromDim.height=initDim.height*Spry.Effect.Utils.getPercentValue(options.from)/100
}else{fromDim.height=Spry.Effect.Utils.getPixelValue(options.from)
}}}if(options.to!=null){if(slideHorizontally){if(Spry.Effect.Utils.isPercentValue(options.to)){toDim.width=initDim.width*Spry.Effect.Utils.getPercentValue(options.to)/100
}else{toDim.width=Spry.Effect.Utils.getPixelValue(options.to)
}}else{if(Spry.Effect.Utils.isPercentValue(options.to)){toDim.height=initDim.height*Spry.Effect.Utils.getPercentValue(options.to)/100
}else{toDim.height=Spry.Effect.Utils.getPixelValue(options.to)
}}}if(options.toggle!=null){doToggle=options.toggle
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}options={duration:durationInMilliseconds,transition:kindOfTransition,scaleContent:false,toggle:doToggle,fps:fps};
var size=new Spry.Effect.Size(element,fromDim,toDim,options);
this.addParallelEffect(size);
if((fromDim.width<toDim.width&&slideHorizontally)||(fromDim.height<toDim.height&&!slideHorizontally)){direction=1
}var fromPos=new Spry.Effect.Utils.Position();
var toPos=new Spry.Effect.Utils.Position();
toPos.x=fromPos.x=Spry.Effect.intPropStyle(firstChildElt,"left");
toPos.y=fromPos.y=Spry.Effect.intPropStyle(firstChildElt,"top");
toPos.units=fromPos.units;
if(slideHorizontally){toPos.x=parseInt(fromPos.x+direction*(fromDim.width-toDim.width),10)
}else{toPos.y=parseInt(fromPos.y+direction*(fromDim.height-toDim.height),10)
}if(direction==1){var tmp=fromPos;
var fromPos=toPos;
var toPos=tmp
}options={duration:durationInMilliseconds,transition:kindOfTransition,toggle:doToggle,from:fromPos,to:toPos,fps:fps};
var move=new Spry.Effect.Move(firstChildElt,fromPos,toPos,options);
this.addParallelEffect(move)
};
Spry.Effect.Slide.prototype=new Spry.Effect.Cluster();
Spry.Effect.Slide.prototype.constructor=Spry.Effect.Slide;
Spry.Effect.Grow=function(element,options){if(!element){return
}if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Grow")
}Spry.Effect.Cluster.call(this,options);
this.name="Grow";
var durationInMilliseconds=1000;
var doToggle=false;
var doScaleContent=true;
var calcHeight=false;
var growFromCenter=true;
var fullCSSBox=false;
var kindOfTransition=Spry.squareTransition;
var fps=60;
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}Spry.Effect.makeClipping(element);
var dimRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
var originalWidth=dimRect.width;
var originalHeight=dimRect.height;
var propFactor=(originalWidth==0)?1:originalHeight/originalWidth;
var fromRect=new Spry.Effect.Utils.Rectangle;
fromRect.width=0;
fromRect.height=0;
var toRect=new Spry.Effect.Utils.Rectangle;
toRect.width=originalWidth;
toRect.height=originalHeight;
var optionFrom=options?options.from:dimRect.width;
var optionTo=options?options.to:0;
var pixelValue=Spry.Effect.Utils.getPixelValue;
if(options){if(options.growCenter!=null){growFromCenter=options.growCenter
}if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.useCSSBox!=null){fullCSSBox=options.useCSSBox
}if(options.scaleContent!=null){doScaleContent=options.scaleContent
}if(options.from!=null){if(Spry.Effect.Utils.isPercentValue(options.from)){fromRect.width=originalWidth*(Spry.Effect.Utils.getPercentValue(options.from)/100);
fromRect.height=originalHeight*(Spry.Effect.Utils.getPercentValue(options.from)/100)
}else{if(calcHeight){fromRect.height=pixelValue(options.from);
fromRect.width=pixelValue(options.from)/propFactor
}else{fromRect.width=pixelValue(options.from);
fromRect.height=propFactor*pixelValue(options.from)
}}}if(options.to!=null){if(Spry.Effect.Utils.isPercentValue(options.to)){toRect.width=originalWidth*(Spry.Effect.Utils.getPercentValue(options.to)/100);
toRect.height=originalHeight*(Spry.Effect.Utils.getPercentValue(options.to)/100)
}else{if(calcHeight){toRect.height=pixelValue(options.to);
toRect.width=pixelValue(options.to)/propFactor
}else{toRect.width=pixelValue(options.to);
toRect.height=propFactor*pixelValue(options.to)
}}}if(options.toggle!=null){doToggle=options.toggle
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}}options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,scaleContent:doScaleContent,useCSSBox:fullCSSBox,fps:fps};
var sizeEffect=new Spry.Effect.Size(element,fromRect,toRect,options);
this.addParallelEffect(sizeEffect);
if(growFromCenter){Spry.Effect.makePositioned(element);
var startOffsetPosition=new Spry.Effect.Utils.Position();
startOffsetPosition.x=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(element,"left"),10);
startOffsetPosition.y=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(element,"top"),10);
if(!startOffsetPosition.x){startOffsetPosition.x=0
}if(!startOffsetPosition.y){startOffsetPosition.y=0
}options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,from:optionFrom,to:optionTo,fps:fps};
var fromPos=new Spry.Effect.Utils.Position;
fromPos.x=startOffsetPosition.x+(originalWidth-fromRect.width)/2;
fromPos.y=startOffsetPosition.y+(originalHeight-fromRect.height)/2;
var toPos=new Spry.Effect.Utils.Position;
toPos.x=startOffsetPosition.x+(originalWidth-toRect.width)/2;
toPos.y=startOffsetPosition.y+(originalHeight-toRect.height)/2;
var moveEffect=new Spry.Effect.Move(element,fromPos,toPos,options);
this.addParallelEffect(moveEffect)
}};
Spry.Effect.Grow.prototype=new Spry.Effect.Cluster();
Spry.Effect.Grow.prototype.constructor=Spry.Effect.Grow;
Spry.Effect.Shake=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Shake")
}Spry.Effect.Cluster.call(this,options);
this.options.direction=false;
if(this.options.toggle){this.options.toggle=false
}this.name="Shake";
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var durationInMilliseconds=100;
var kindOfTransition=Spry.linearTransition;
var fps=60;
var steps=4;
if(options){if(options.duration!=null){steps=Math.ceil(this.options.duration/durationInMilliseconds)-1
}if(options.fps!=null){fps=options.fps
}if(options.transition!=null){kindOfTransition=options.transition
}}Spry.Effect.makePositioned(element);
var startOffsetPosition=new Spry.Effect.Utils.Position();
startOffsetPosition.x=parseInt(Spry.Effect.getStyleProp(element,"left"),10);
startOffsetPosition.y=parseInt(Spry.Effect.getStyleProp(element,"top"),10);
if(!startOffsetPosition.x){startOffsetPosition.x=0
}if(!startOffsetPosition.y){startOffsetPosition.y=0
}var centerPos=new Spry.Effect.Utils.Position;
centerPos.x=startOffsetPosition.x;
centerPos.y=startOffsetPosition.y;
var rightPos=new Spry.Effect.Utils.Position;
rightPos.x=startOffsetPosition.x+20;
rightPos.y=startOffsetPosition.y+0;
var leftPos=new Spry.Effect.Utils.Position;
leftPos.x=startOffsetPosition.x+-20;
leftPos.y=startOffsetPosition.y+0;
options={duration:Math.ceil(durationInMilliseconds/2),toggle:false,fps:fps,transition:kindOfTransition};
var effect=new Spry.Effect.Move(element,centerPos,rightPos,options);
this.addNextEffect(effect);
options={duration:durationInMilliseconds,toggle:false,fps:fps,transition:kindOfTransition};
var effectToRight=new Spry.Effect.Move(element,rightPos,leftPos,options);
var effectToLeft=new Spry.Effect.Move(element,leftPos,rightPos,options);
for(var i=0;
i<steps;
i++){if(i%2==0){this.addNextEffect(effectToRight)
}else{this.addNextEffect(effectToLeft)
}}var pos=(steps%2==0)?rightPos:leftPos;
options={duration:Math.ceil(durationInMilliseconds/2),toggle:false,fps:fps,transition:kindOfTransition};
var effect=new Spry.Effect.Move(element,pos,centerPos,options);
this.addNextEffect(effect)
};
Spry.Effect.Shake.prototype=new Spry.Effect.Cluster();
Spry.Effect.Shake.prototype.constructor=Spry.Effect.Shake;
Spry.Effect.Shake.prototype.doToggle=function(){};
Spry.Effect.Squish=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Squish")
}if(!options){options={}
}if(!options.to){options.to="0%"
}if(!options.from){options.from="100%"
}options.growCenter=false;
Spry.Effect.Grow.call(this,element,options);
this.name="Squish"
};
Spry.Effect.Squish.prototype=new Spry.Effect.Grow();
Spry.Effect.Squish.prototype.constructor=Spry.Effect.Squish;
Spry.Effect.Pulsate=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Pulsate")
}Spry.Effect.Cluster.call(this,options);
this.options.direction=false;
if(this.options.toggle){this.options.toggle=false
}var element=Spry.Effect.getElement(element);
var originalOpacity=0;
this.element=element;
if(!this.element){return
}this.name="Pulsate";
var durationInMilliseconds=100;
var fromOpacity=100;
var toOpacity=0;
var doToggle=false;
var kindOfTransition=Spry.linearTransition;
var fps=60;
if(/MSIE/.test(navigator.userAgent)){originalOpacity=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(this.element,"filter").replace(/alpha\(opacity=([0-9]{1,3})\)/g,"$1"),10)
}else{originalOpacity=parseInt(Spry.Effect.getStylePropRegardlessOfDisplayState(this.element,"opacity")*100,10)
}if(isNaN(originalOpacity)){originalOpacity=100
}if(options){if(options.from!=null){if(Spry.Effect.Utils.isPercentValue(options.from)){fromOpacity=Spry.Effect.Utils.getPercentValue(options.from)*originalOpacity/100
}else{fromOpacity=options.from
}}if(options.to!=null){if(Spry.Effect.Utils.isPercentValue(options.to)){toOpacity=Spry.Effect.Utils.getPercentValue(options.to)*originalOpacity/100
}else{toOpacity=options.to
}}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}}options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,fps:fps};
fromOpacity=fromOpacity/100;
toOpacity=toOpacity/100;
var fadeEffect=new Spry.Effect.Opacity(element,fromOpacity,toOpacity,options);
var appearEffect=new Spry.Effect.Opacity(element,toOpacity,fromOpacity,options);
var steps=parseInt(this.options.duration/200,10);
for(var i=0;
i<steps;
i++){this.addNextEffect(fadeEffect);
this.addNextEffect(appearEffect)
}};
Spry.Effect.Pulsate.prototype=new Spry.Effect.Cluster();
Spry.Effect.Pulsate.prototype.constructor=Spry.Effect.Pulsate;
Spry.Effect.Pulsate.prototype.doToggle=function(){};
Spry.Effect.Puff=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Puff")
}Spry.Effect.Cluster.call(this,options);
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}this.name="Puff";
var doToggle=false;
var doScaleContent=false;
var durationInMilliseconds=1000;
var kindOfTransition=Spry.fifthTransition;
var fps=60;
Spry.Effect.makePositioned(element);
if(options){if(options.toggle!=null){doToggle=options.toggle
}if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.fps!=null){fps=options.fps
}}var originalRect=Spry.Effect.getDimensions(element);
var startWidth=originalRect.width;
var startHeight=originalRect.height;
options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,fps:fps};
var fromOpacity=1;
var toOpacity=0;
var opacityEffect=new Spry.Effect.Opacity(element,fromOpacity,toOpacity,options);
this.addParallelEffect(opacityEffect);
var fromPos=Spry.Effect.getPosition(element);
var toPos=new Spry.Effect.Utils.Position;
toPos.x=startWidth/2*-1;
toPos.y=startHeight/2*-1;
options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,from:fromPos,to:toPos,fps:fps};
var moveEffect=new Spry.Effect.Move(element,fromPos,toPos,options);
this.addParallelEffect(moveEffect);
var self=this;
this.addObserver({onPreEffect:function(){if(self.direction==Spry.backwards){self.element.style.display="block"
}},onPostEffect:function(){if(self.direction==Spry.forwards){self.element.style.display="none"
}}})
};
Spry.Effect.Puff.prototype=new Spry.Effect.Cluster;
Spry.Effect.Puff.prototype.constructor=Spry.Effect.Puff;
Spry.Effect.DropOut=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("DropOut")
}Spry.Effect.Cluster.call(this,options);
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}var durationInMilliseconds=1000;
var fps=60;
var kindOfTransition=Spry.fifthTransition;
var direction=Spry.forwards;
var doToggle=false;
this.name="DropOut";
Spry.Effect.makePositioned(element);
if(options){if(options.duration!=null){durationInMilliseconds=options.duration
}if(options.toggle!=null){doToggle=options.toggle
}if(options.fps!=null){fps=options.fps
}if(options.transition!=null){kindOfTransition=options.transition
}if(options.dropIn!=null){direction=-1
}}var startOffsetPosition=new Spry.Effect.Utils.Position();
startOffsetPosition.x=parseInt(Spry.Effect.getStyleProp(element,"left"),10);
startOffsetPosition.y=parseInt(Spry.Effect.getStyleProp(element,"top"),10);
if(!startOffsetPosition.x){startOffsetPosition.x=0
}if(!startOffsetPosition.y){startOffsetPosition.y=0
}var fromPos=new Spry.Effect.Utils.Position;
fromPos.x=startOffsetPosition.x+0;
fromPos.y=startOffsetPosition.y+0;
var toPos=new Spry.Effect.Utils.Position;
toPos.x=startOffsetPosition.x+0;
toPos.y=startOffsetPosition.y+(direction*160);
options={from:fromPos,to:toPos,duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,fps:fps};
var moveEffect=new Spry.Effect.Move(element,options.from,options.to,options);
this.addParallelEffect(moveEffect);
var fromOpacity=1;
var toOpacity=0;
options={duration:durationInMilliseconds,toggle:doToggle,transition:kindOfTransition,fps:fps};
var opacityEffect=new Spry.Effect.Opacity(element,fromOpacity,toOpacity,options);
this.addParallelEffect(opacityEffect);
var self=this;
this.addObserver({onPreEffect:function(){self.element.style.display="block"
},onPostEffect:function(){if(self.direction==Spry.forwards){self.element.style.display="none"
}}})
};
Spry.Effect.DropOut.prototype=new Spry.Effect.Cluster();
Spry.Effect.DropOut.prototype.constructor=Spry.Effect.DropOut;
Spry.Effect.Fold=function(element,options){if(!this.notStaticAnimator){return Spry.Effect.Utils.showInitError("Fold")
}Spry.Effect.Cluster.call(this,options);
var element=Spry.Effect.getElement(element);
this.element=element;
if(!this.element){return
}this.name="Fold";
var durationInMilliseconds=1000;
var doToggle=false;
var doScaleContent=true;
var fullCSSBox=false;
var kindOfTransition=Spry.fifthTransition;
var fps=fps;
Spry.Effect.makeClipping(element);
var originalRect=Spry.Effect.getDimensionsRegardlessOfDisplayState(element);
var startWidth=originalRect.width;
var startHeight=originalRect.height;
var stopWidth=startWidth;
var stopHeight=startHeight/5;
var fromRect=new Spry.Effect.Utils.Rectangle;
fromRect.width=startWidth;
fromRect.height=startHeight;
var toRect=new Spry.Effect.Utils.Rectangle;
toRect.width=stopWidth;
toRect.height=stopHeight;
if(options){if(options.duration!=null){durationInMilliseconds=Math.ceil(options.duration/2)
}if(options.toggle!=null){doToggle=options.toggle
}if(options.useCSSBox!=null){fullCSSBox=options.useCSSBox
}if(options.fps!=null){fps=options.fps
}if(options.transition!=null){kindOfTransition=options.transition
}}options={duration:durationInMilliseconds,toggle:doToggle,scaleContent:doScaleContent,useCSSBox:fullCSSBox,transition:kindOfTransition,fps:fps};
var sizeEffect=new Spry.Effect.Size(element,fromRect,toRect,options);
this.addNextEffect(sizeEffect);
fromRect.width=toRect.width;
fromRect.height=toRect.height;
toRect.width="0%";
var sizeEffect=new Spry.Effect.Size(element,fromRect,toRect,options);
this.addNextEffect(sizeEffect)
};
Spry.Effect.Fold.prototype=new Spry.Effect.Cluster();
Spry.Effect.Fold.prototype.constructor=Spry.Effect.Fold;
Spry.Effect.DoFade=function(element,options){return Spry.Effect.Utils.DoEffect("Fade",element,options)
};
Spry.Effect.DoBlind=function(element,options){return Spry.Effect.Utils.DoEffect("Blind",element,options)
};
Spry.Effect.DoHighlight=function(element,options){return Spry.Effect.Utils.DoEffect("Highlight",element,options)
};
Spry.Effect.DoSlide=function(element,options){return Spry.Effect.Utils.DoEffect("Slide",element,options)
};
Spry.Effect.DoGrow=function(element,options){return Spry.Effect.Utils.DoEffect("Grow",element,options)
};
Spry.Effect.DoShake=function(element,options){return Spry.Effect.Utils.DoEffect("Shake",element,options)
};
Spry.Effect.DoSquish=function(element,options){return Spry.Effect.Utils.DoEffect("Squish",element,options)
};
Spry.Effect.DoPulsate=function(element,options){return Spry.Effect.Utils.DoEffect("Pulsate",element,options)
};
Spry.Effect.DoPuff=function(element,options){return Spry.Effect.Utils.DoEffect("Puff",element,options)
};
Spry.Effect.DoDropOut=function(element,options){return Spry.Effect.Utils.DoEffect("DropOut",element,options)
};
Spry.Effect.DoFold=function(element,options){return Spry.Effect.Utils.DoEffect("Fold",element,options)
};
var Spry;
if(!Spry){Spry={}
}if(!Spry.Widget){Spry.Widget={}
}Spry.Widget.SlidingPanels=function(element,opts){this.element=this.getElement(element);
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,opts);
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(e){this.hasFocus=true;
this.addClassName(this.element,this.focusedClass);
return false
};
Spry.Widget.SlidingPanels.prototype.onBlur=function(e){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(e){var key=e.keyCode;
if(!this.hasFocus||(key!=this.previousPanelKeyCode&&key!=this.nextPanelKeyCode)){return true
}if(key==this.nextPanelKeyCode){this.showNextPanel()
}else{this.showPreviousPanel()
}if(e.preventDefault){e.preventDefault()
}else{e.returnValue=false
}if(e.stopPropagation){e.stopPropagation()
}else{e.cancelBubble=true
}return false
};
Spry.Widget.SlidingPanels.prototype.attachBehaviors=function(){var ele=this.element;
if(!ele){return
}if(this.enableKeyboardNavigation){var focusEle=null;
var tabIndexAttr=ele.attributes.getNamedItem("tabindex");
if(tabIndexAttr||ele.nodeName.toLowerCase()=="a"){focusEle=ele
}if(focusEle){var self=this;
Spry.Widget.SlidingPanels.addEventListener(focusEle,"focus",function(e){return self.onFocus(e||window.event)
},false);
Spry.Widget.SlidingPanels.addEventListener(focusEle,"blur",function(e){return self.onBlur(e||window.event)
},false);
Spry.Widget.SlidingPanels.addEventListener(focusEle,"keydown",function(e){return self.onKeyDown(e||window.event)
},false)
}}if(this.currentPanel){var ea=this.enableAnimation;
this.enableAnimation=false;
this.showPanel(this.currentPanel);
this.enableAnimation=ea
}};
Spry.Widget.SlidingPanels.prototype.getElement=function(ele){if(ele&&typeof ele=="string"){return document.getElementById(ele)
}return ele
};
Spry.Widget.SlidingPanels.prototype.addClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))!=-1)){return
}ele.className+=(ele.className?" ":"")+className
};
Spry.Widget.SlidingPanels.prototype.removeClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))==-1)){return
}ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"")
};
Spry.Widget.SlidingPanels.setOptions=function(obj,optionsObj,ignoreUndefinedProps){if(!optionsObj){return
}for(var optionName in optionsObj){if(ignoreUndefinedProps&&optionsObj[optionName]==undefined){continue
}obj[optionName]=optionsObj[optionName]
}};
Spry.Widget.SlidingPanels.prototype.getElementChildren=function(element){var children=[];
var child=element.firstChild;
while(child){if(child.nodeType==1){children.push(child)
}child=child.nextSibling
}return children
};
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(handler){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",handler,false)
}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",handler,false)
}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",handler)
}}}};
Spry.Widget.SlidingPanels.processLoadQueue=function(handler){Spry.Widget.SlidingPanels.onloadDidFire=true;
var q=Spry.Widget.SlidingPanels.loadQueue;
var qlen=q.length;
for(var i=0;
i<qlen;
i++){q[i].attachBehaviors()
}};
Spry.Widget.SlidingPanels.addLoadListener(Spry.Widget.SlidingPanels.processLoadQueue);
Spry.Widget.SlidingPanels.addEventListener=function(element,eventType,handler,capture){try{if(element.addEventListener){element.addEventListener(eventType,handler,capture)
}else{if(element.attachEvent){element.attachEvent("on"+eventType,handler)
}}}catch(e){}};
Spry.Widget.SlidingPanels.prototype.getContentPanelIndex=function(ele){if(ele){ele=this.getElement(ele);
var panels=this.getContentPanels();
var numPanels=panels.length;
for(var i=0;
i<numPanels;
i++){if(panels[i]==ele){return i
}}}return -1
};
Spry.Widget.SlidingPanels.prototype.showPanel=function(elementOrIndex){var pIndex=-1;
if(typeof elementOrIndex=="number"){pIndex=elementOrIndex
}else{pIndex=this.getContentPanelIndex(elementOrIndex)
}var numPanels=this.getContentPanelsCount();
if(numPanels>0){pIndex=(pIndex>=numPanels)?numPanels-1:pIndex
}else{pIndex=0
}var panel=this.getContentPanels()[pIndex];
var contentGroup=this.getContentGroup();
if(panel&&contentGroup){if(this.currentPanel){this.removeClassName(this.currentPanel,this.currentPanelClass)
}this.currentPanel=panel;
var nx=-panel.offsetLeft;
var ny=-panel.offsetTop;
if(this.enableAnimation){if(this.animator){this.animator.stop()
}var cx=contentGroup.offsetLeft;
var cy=contentGroup.offsetTop;
if(cx!=nx||cy!=ny){var self=this;
this.addClassName(this.element,this.animatingClass);
this.animator=new Spry.Widget.SlidingPanels.PanelAnimator(contentGroup,cx,cy,nx,ny,{duration:this.duration,fps:this.fps,transition:this.transition,finish:function(){self.removeClassName(self.element,self.animatingClass);
self.addClassName(panel,self.currentPanelClass)
}});
this.animator.start()
}}else{contentGroup.style.left=nx+"px";
contentGroup.style.top=ny+"px";
this.addClassName(panel,this.currentPanelClass)
}}return panel
};
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(ele,curX,curY,dstX,dstY,opts){this.element=ele;
this.curX=curX;
this.curY=curY;
this.dstX=dstX;
this.dstY=dstY;
this.fps=60;
this.duration=500;
this.transition=Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;
this.startTime=0;
this.timerID=0;
this.finish=null;
var self=this;
this.intervalFunc=function(){self.step()
};
Spry.Widget.SlidingPanels.setOptions(this,opts,true);
this.interval=1000/this.fps
};
Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition=function(time,begin,finish,duration){time/=duration;
return begin+((2-time)*time*finish)
};
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 elapsedTime=(new Date()).getTime()-this.startTime;
var done=elapsedTime>=this.duration;
var x,y;
if(done){x=this.curX=this.dstX;
y=this.curY=this.dstY
}else{x=this.transition(elapsedTime,this.curX,this.dstX-this.curX,this.duration);
y=this.transition(elapsedTime,this.curY,this.dstY-this.curY,this.duration)
}this.element.style.left=x+"px";
this.element.style.top=y+"px";
if(!done){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(element,opts){this.element=this.getElement(element);
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,opts,true);
this.attachBehaviors()
};
Spry.Widget.Accordion.prototype.getElement=function(ele){if(ele&&typeof ele=="string"){return document.getElementById(ele)
}return ele
};
Spry.Widget.Accordion.prototype.addClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))!=-1)){return
}ele.className+=(ele.className?" ":"")+className
};
Spry.Widget.Accordion.prototype.removeClassName=function(ele,className){if(!ele||!className||(ele.className&&ele.className.search(new RegExp("\\b"+className+"\\b"))==-1)){return
}ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"")
};
Spry.Widget.Accordion.setOptions=function(obj,optionsObj,ignoreUndefinedProps){if(!optionsObj){return
}for(var optionName in optionsObj){if(ignoreUndefinedProps&&optionsObj[optionName]==undefined){continue
}obj[optionName]=optionsObj[optionName]
}};
Spry.Widget.Accordion.prototype.onPanelTabMouseOver=function(e,panel){if(panel){this.addClassName(this.getPanelTab(panel),this.hoverClass)
}return false
};
Spry.Widget.Accordion.prototype.onPanelTabMouseOut=function(e,panel){if(panel){this.removeClassName(this.getPanelTab(panel),this.hoverClass)
}return false
};
Spry.Widget.Accordion.prototype.openPanel=function(elementOrIndex){var panelA=this.currentPanel;
var panelB;
if(typeof elementOrIndex=="number"){panelB=this.getPanels()[elementOrIndex]
}else{panelB=this.getElement(elementOrIndex)
}if(!panelB||panelA==panelB){return null
}var contentA=panelA?this.getPanelContent(panelA):null;
var contentB=this.getPanelContent(panelB);
if(!contentB){return null
}if(this.useFixedPanelHeights&&!this.fixedPanelHeight){this.fixedPanelHeight=(contentA.offsetHeight)?contentA.offsetHeight:contentA.scrollHeight
}if(this.enableAnimation){if(this.animator){this.animator.stop()
}this.animator=new Spry.Widget.Accordion.PanelAnimator(this,panelB,{duration:this.duration,fps:this.fps,transition:this.transition});
this.animator.start()
}else{if(contentA){contentA.style.display="none";
contentA.style.height="0px"
}contentB.style.display="block";
contentB.style.height=(this.useFixedPanelHeights?this.fixedPanelHeight:contentB.scrollHeight)+"px"
}if(panelA){this.removeClassName(panelA,this.openClass);
this.addClassName(panelA,this.closedClass)
}this.removeClassName(panelB,this.closedClass);
this.addClassName(panelB,this.openClass);
this.currentPanel=panelB;
return panelB
};
Spry.Widget.Accordion.prototype.closePanel=function(){if(!this.useFixedPanelHeights&&this.currentPanel){var panel=this.currentPanel;
var content=this.getPanelContent(panel);
if(content){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{content.style.display="none";
content.style.height="0px"
}}this.removeClassName(panel,this.openClass);
this.addClassName(panel,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 panels=this.getPanels();
return this.openPanel(panels[panels.length-1])
};
Spry.Widget.Accordion.prototype.onPanelTabClick=function(e,panel){if(panel!=this.currentPanel){this.openPanel(panel)
}else{this.closePanel()
}if(this.enableKeyboardNavigation){this.focus()
}if(e.preventDefault){e.preventDefault()
}else{e.returnValue=false
}if(e.stopPropagation){e.stopPropagation()
}else{e.cancelBubble=true
}return false
};
Spry.Widget.Accordion.prototype.onFocus=function(e){this.hasFocus=true;
this.addClassName(this.element,this.focusedClass);
return false
};
Spry.Widget.Accordion.prototype.onBlur=function(e){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(e){var key=e.keyCode;
if(!this.hasFocus||(key!=this.previousPanelKeyCode&&key!=this.nextPanelKeyCode)){return true
}var panels=this.getPanels();
if(!panels||panels.length<1){return false
}var currentPanel=this.currentPanel?this.currentPanel:panels[0];
var nextPanel=(key==this.nextPanelKeyCode)?currentPanel.nextSibling:currentPanel.previousSibling;
while(nextPanel){if(nextPanel.nodeType==1){break
}nextPanel=(key==this.nextPanelKeyCode)?nextPanel.nextSibling:nextPanel.previousSibling
}if(nextPanel&&currentPanel!=nextPanel){this.openPanel(nextPanel)
}if(e.preventDefault){e.preventDefault()
}else{e.returnValue=false
}if(e.stopPropagation){e.stopPropagation()
}else{e.cancelBubble=true
}return false
};
Spry.Widget.Accordion.prototype.attachPanelHandlers=function(panel){if(!panel){return
}var tab=this.getPanelTab(panel);
if(tab){var self=this;
Spry.Widget.Accordion.addEventListener(tab,"click",function(e){return self.onPanelTabClick(e,panel)
},false);
Spry.Widget.Accordion.addEventListener(tab,"mouseover",function(e){return self.onPanelTabMouseOver(e,panel)
},false);
Spry.Widget.Accordion.addEventListener(tab,"mouseout",function(e){return self.onPanelTabMouseOut(e,panel)
},false)
}};
Spry.Widget.Accordion.addEventListener=function(element,eventType,handler,capture){try{if(element.addEventListener){element.addEventListener(eventType,handler,capture)
}else{if(element.attachEvent){element.attachEvent("on"+eventType,handler)
}}}catch(e){}};
Spry.Widget.Accordion.prototype.initPanel=function(panel,isDefault){var content=this.getPanelContent(panel);
if(isDefault){this.currentPanel=panel;
this.removeClassName(panel,this.closedClass);
this.addClassName(panel,this.openClass);
if(content){if(this.useFixedPanelHeights){if(this.fixedPanelHeight){content.style.height=this.fixedPanelHeight+"px"
}}else{content.style.height="auto"
}}}else{this.removeClassName(panel,this.openClass);
this.addClassName(panel,this.closedClass);
if(content){content.style.height="0px";
content.style.display="none"
}}this.attachPanelHandlers(panel)
};
Spry.Widget.Accordion.prototype.attachBehaviors=function(){var panels=this.getPanels();
for(var i=0;
i<panels.length;
i++){this.initPanel(panels[i],i==this.defaultPanel)
}this.enableKeyboardNavigation=(this.enableKeyboardNavigation&&this.element.attributes.getNamedItem("tabindex"));
if(this.enableKeyboardNavigation){var self=this;
Spry.Widget.Accordion.addEventListener(this.element,"focus",function(e){return self.onFocus(e)
},false);
Spry.Widget.Accordion.addEventListener(this.element,"blur",function(e){return self.onBlur(e)
},false);
Spry.Widget.Accordion.addEventListener(this.element,"keydown",function(e){return self.onKeyDown(e)
},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(panel){var panels=this.getPanels();
for(var i=0;
i<panels.length;
i++){if(panel==panels[i]){return i
}}return -1
};
Spry.Widget.Accordion.prototype.getCurrentPanelIndex=function(){return this.getPanelIndex(this.currentPanel)
};
Spry.Widget.Accordion.prototype.getPanelTab=function(panel){if(!panel){return null
}return this.getElementChildren(panel)[0]
};
Spry.Widget.Accordion.prototype.getPanelContent=function(panel){if(!panel){return null
}return this.getElementChildren(panel)[1]
};
Spry.Widget.Accordion.prototype.getElementChildren=function(element){var children=[];
var child=element.firstChild;
while(child){if(child.nodeType==1){children.push(child)
}child=child.nextSibling
}return children
};
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(accordion,panel,opts){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=panel;
this.panelToOpen=accordion.getElement(panel);
this.panelData=[];
Spry.Widget.Accordion.setOptions(this,opts,true);
this.interval=Math.floor(1000/this.fps);
var panels=accordion.getPanels();
for(var i=0;
i<panels.length;
i++){var p=panels[i];
var c=accordion.getPanelContent(p);
if(c){var h=c.offsetHeight;
if(h==undefined){h=0
}if(p==panel&&h==0){c.style.display="block"
}if(p==panel||h>0){var obj=new Object;
obj.panel=p;
obj.content=c;
obj.fromHeight=h;
obj.toHeight=(p==panel)?(accordion.useFixedPanelHeights?accordion.fixedPanelHeight:c.scrollHeight):0;
obj.distance=obj.toHeight-obj.fromHeight;
obj.overflow=c.style.overflow;
this.panelData.push(obj);
c.style.overflow="hidden";
c.style.height=h+"px"
}}}};
Spry.Widget.Accordion.PanelAnimator.defaultTransition=function(time,begin,finish,duration){time/=duration;
return begin+((2-time)*time*finish)
};
Spry.Widget.Accordion.PanelAnimator.prototype.start=function(){var self=this;
this.startTime=(new Date).getTime();
this.timer=setTimeout(function(){self.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 curTime=(new Date).getTime();
var elapsedTime=curTime-this.startTime;
var i,obj;
if(elapsedTime>=this.duration){for(i=0;
i<this.panelData.length;
i++){obj=this.panelData[i];
if(obj.panel!=this.panel){obj.content.style.display="none";
obj.content.style.height="0px"
}obj.content.style.overflow=obj.overflow;
obj.content.style.height=obj.toHeight+"px"
}if(this.onComplete){this.onComplete()
}return
}for(i=0;
i<this.panelData.length;
i++){obj=this.panelData[i];
var ht=this.transition(elapsedTime,obj.fromHeight,obj.distance,this.duration);
obj.content.style.height=((ht<0)?0:ht)+"px"
}var self=this;
this.timer=setTimeout(function(){self.stepAnimation()
},this.interval)
};