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.bindings=[];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);};Spry.Widget.TabbedPanels.prototype.onTabMouseOver=function(e,tab)
{this.addClassName(tab,this.tabHoverClass);};Spry.Widget.TabbedPanels.prototype.onTabMouseOut=function(e,tab)
{this.removeClassName(tab,this.tabHoverClass);};Spry.Widget.TabbedPanels.prototype.onTabFocus=function(e,tab)
{this.hasFocus=true;this.addClassName(this.element,this.tabFocusedClass);};Spry.Widget.TabbedPanels.prototype.onTabBlur=function(e,tab)
{this.hasFocus=false;this.removeClassName(this.element,this.tabFocusedClass);};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.stopPropagation)
e.stopPropagation();if(e.preventDefault)
e.preventDefault();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={};}
if(!Spry.Widget)
{Spry.Widget={};}
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;var isie=(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE');if(typeof document.getElementById=='undefined'||(navigator.vendor=='Apple Computer, Inc.'&&typeof window.XMLHttpRequest=='undefined')||(isie&&typeof document.uniqueID=='undefined'))
{return;}
if(opts)
{for(var k in opts)
{var rollover=new Image;rollover.src=opts[k];}}
if(this.element)
{this.currMenu=this.element;var items=this.element.getElementsByTagName('li');for(var i=0;i<items.length;i++)
{this.initialize(items[i],element,isie);if(isie)
{this.addClassName(items[i],"MenuBarItemIE");items[i].style.position="static";}}
if(isie)
{if(this.hasClassName(this.element,"MenuBarVertical"))
{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.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:false;';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,"MenuBarActive");};Spry.Widget.MenuBar.prototype.bubbledTextEvent=function()
{return(navigator.vendor=='Apple Computer, Inc.'&&(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,"MenuBarSubmenuVisible");if(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE')
{if(!this.hasClassName(this.element,"MenuBarHorizontal")||menu.parentNode.parentNode!=this.element)
{menu.style.top=menu.parentNode.offsetTop+'px';}}
if(typeof document.uniqueID!="undefined")
{this.createIframeLayer(menu);}}
this.addClassName(this.element,"MenuBarActive");};Spry.Widget.MenuBar.prototype.hideSubmenu=function(menu)
{if(menu)
{this.removeClassName(menu,"MenuBarSubmenuVisible");if(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE')
{menu.style.top='';menu.style.left='';}
this.removeIframeLayer(menu);}};Spry.Widget.MenuBar.prototype.initialize=function(listitem,element,isie)
{var opentime,closetime;var link=listitem.getElementsByTagName('a')[0];var submenus=listitem.getElementsByTagName('ul');var menu=(submenus.length>0?submenus[0]:null);var hasSubMenu=false;if(menu)
{this.addClassName(link,"MenuBarItemSubmenu");hasSubMenu=true;}
if(!isie)
{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)
{if(self.bubbledTextEvent())
{return;}
clearTimeout(closetime);if(self.currMenu==listitem)
{self.currMenu=null;}
self.addClassName(link,hasSubMenu?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(menu&&!self.hasClassName(menu,"MenuBarSubmenuVisible"))
{opentime=window.setTimeout(function(){self.showSubmenu(menu);},250);}},false);this.addEventListener(listitem,'mouseout',function(e)
{if(self.bubbledTextEvent())
{return;}
var related=(typeof e.relatedTarget!='undefined'?e.relatedTarget:e.toElement);if(!listitem.contains(related))
{clearTimeout(opentime);self.currMenu=listitem;self.removeClassName(link,hasSubMenu?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(menu)
{closetime=window.setTimeout(function(){self.hideSubmenu(menu);},600);}}},false);};var expandFirstItemAutomatically=false;var initMenuIdToExpand=false;var expandMenuItemByUrl=true;var initialMenuItemAlwaysExpanded=true;var dhtmlgoodies_slmenuObj;var divToScroll=false;var ulToScroll=false;var divCounter=1;var otherDivsToScroll=new Array();var divToHide=false;var parentDivToHide=new Array();var ulToHide=false;var offsetOpera=0;if(navigator.userAgent.indexOf('Opera')>=0)offsetOpera=1;var slideMenuHeightOfCurrentBox=0;var objectsToExpand=new Array();var initExpandIndex=0;var alwaysExpanedItems=new Array();function popMenusToShow()
{var obj=divToScroll;var endArray=new Array();while(obj&&obj.tagName!='BODY'){if(obj.tagName=='DIV'&&obj.id.indexOf('slideDiv')>=0){var objFound=-1;for(var no=0;no<otherDivsToScroll.length;no++){if(otherDivsToScroll[no]==obj){objFound=no;}}
if(objFound>=0){otherDivsToScroll.splice(objFound,1);}}
obj=obj.parentNode;}}
function showSubMenu(e,inputObj)
{if(this&&this.tagName)inputObj=this.parentNode;if(inputObj&&inputObj.tagName=='LI'){divToScroll=inputObj.getElementsByTagName('DIV')[0];for(var no=0;no<otherDivsToScroll.length;no++){if(otherDivsToScroll[no]==divToScroll)return;}}
hidingInProcess=false;if(otherDivsToScroll.length>0){if(divToScroll){if(otherDivsToScroll.length>0){popMenusToShow();}
if(otherDivsToScroll.length>0){autoHideMenus();hidingInProcess=true;}}}
if(divToScroll&&!hidingInProcess){divToScroll.style.display='';otherDivsToScroll.length=0;otherDivToScroll=divToScroll.parentNode;otherDivsToScroll.push(divToScroll);while(otherDivToScroll&&otherDivToScroll.tagName!='BODY'){if(otherDivToScroll.tagName=='DIV'&&otherDivToScroll.id.indexOf('slideDiv')>=0){otherDivsToScroll.push(otherDivToScroll);}
otherDivToScroll=otherDivToScroll.parentNode;}
ulToScroll=divToScroll.getElementsByTagName('UL')[0];if(divToScroll.style.height.replace('px','')/1<=1)scrollDownSub();}}
function autoHideMenus()
{if(otherDivsToScroll.length>0){divToHide=otherDivsToScroll[otherDivsToScroll.length-1];parentDivToHide.length=0;var obj=divToHide.parentNode.parentNode.parentNode;while(obj&&obj.tagName=='DIV'){if(obj.id.indexOf('slideDiv')>=0)parentDivToHide.push(obj);obj=obj.parentNode.parentNode.parentNode;}
var tmpHeight=(divToHide.style.height.replace('px','')/1-slideMenuHeightOfCurrentBox);if(tmpHeight<0)tmpHeight=0;if(slideMenuHeightOfCurrentBox)divToHide.style.height=tmpHeight+'px';ulToHide=divToHide.getElementsByTagName('UL')[0];slideMenuHeightOfCurrentBox=ulToHide.offsetHeight;scrollUpMenu();}else{slideMenuHeightOfCurrentBox=0;showSubMenu();}}
function scrollUpMenu()
{var height=divToHide.offsetHeight;height-=15;if(height<0)height=0;divToHide.style.height=height+'px';for(var no=0;no<parentDivToHide.length;no++){parentDivToHide[no].style.height=parentDivToHide[no].getElementsByTagName('UL')[0].offsetHeight+'px';}
if(height>0){setTimeout('scrollUpMenu()',5);}else{divToHide.style.display='none';otherDivsToScroll.length=otherDivsToScroll.length-1;autoHideMenus();}}
function scrollDownSub()
{if(divToScroll){var height=divToScroll.offsetHeight/1;var offsetMove=Math.min(15,(ulToScroll.offsetHeight-height));height=height+offsetMove;divToScroll.style.height=height+'px';for(var no=1;no<otherDivsToScroll.length;no++){var tmpHeight=otherDivsToScroll[no].offsetHeight/1+offsetMove;otherDivsToScroll[no].style.height=tmpHeight+'px';}
if(height<ulToScroll.offsetHeight)setTimeout('scrollDownSub()',5);else{divToScroll=false;ulToScroll=false;if(objectsToExpand.length>0&&initExpandIndex<(objectsToExpand.length-1)){initExpandIndex++;showSubMenu(false,objectsToExpand[initExpandIndex]);}}}}
function initSubItems(inputObj,currentDepth)
{divCounter++;var div=document.createElement('DIV');div.style.overflow='hidden';div.style.position='relative';div.style.display='none';div.style.height='1px';div.id='slideDiv'+divCounter;div.className='slideMenuDiv'+currentDepth;inputObj.parentNode.appendChild(div);div.appendChild(inputObj);var menuItem=inputObj.getElementsByTagName('LI')[0];while(menuItem){if(menuItem.tagName=='LI'){var aTag=menuItem.getElementsByTagName('A')[0];aTag.className='slMenuItem_depth'+currentDepth;var subUl=menuItem.getElementsByTagName('UL');if(subUl.length>0){initSubItems(subUl[0],currentDepth+1);}
aTag.onclick=showSubMenu;}
menuItem=menuItem.nextSibling;}}
function initSlideDownMenu()
{dhtmlgoodies_slmenuObj=document.getElementById('dhtmlgoodies_slidedown_menu');dhtmlgoodies_slmenuObj.style.visibility='visible';var mainUl=dhtmlgoodies_slmenuObj.getElementsByTagName('UL')[0];var mainMenuItem=mainUl.getElementsByTagName('LI')[0];mainItemCounter=1;while(mainMenuItem){if(mainMenuItem.tagName=='LI'){var aTag=mainMenuItem.getElementsByTagName('A')[0];aTag.className='slMenuItem_depth1';var subUl=mainMenuItem.getElementsByTagName('UL');if(subUl.length>0){mainMenuItem.id='mainMenuItem'+mainItemCounter;initSubItems(subUl[0],2);aTag.onclick=showSubMenu;mainItemCounter++;}}
mainMenuItem=mainMenuItem.nextSibling;}
if(location.search.indexOf('mainMenuItemToSlide')>=0){var items=location.search.split('&');for(var no=0;no<items.length;no++){if(items[no].indexOf('mainMenuItemToSlide')>=0){values=items[no].split('=');showSubMenu(false,document.getElementById('mainMenuItem'+values[1]));initMenuIdToExpand=false;}}}else if(expandFirstItemAutomatically>0){if(document.getElementById('mainMenuItem'+expandFirstItemAutomatically)){showSubMenu(false,document.getElementById('mainMenuItem'+expandFirstItemAutomatically));initMenuIdToExpand=false;}}
if(expandMenuItemByUrl)
{var aTags=dhtmlgoodies_slmenuObj.getElementsByTagName('A');for(var no=0;no<aTags.length;no++){var hrefToCheckOn=aTags[no].href;if(location.href.indexOf(hrefToCheckOn)>=0&&hrefToCheckOn.indexOf('#')<hrefToCheckOn.length-1){initMenuIdToExpand=false;var obj=aTags[no].parentNode;while(obj&&obj.id!='dhtmlgoodies_slidedown_menu'){if(obj.tagName=='LI'){var subUl=obj.getElementsByTagName('UL');if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode]=true;if(subUl.length>0){objectsToExpand.unshift(obj);}}
obj=obj.parentNode;}
showSubMenu(false,objectsToExpand[0]);break;}}}
if(initMenuIdToExpand)
{objectsToExpand=new Array();var obj=document.getElementById(initMenuIdToExpand)
while(obj&&obj.id!='dhtmlgoodies_slidedown_menu'){if(obj.tagName=='LI'){var subUl=obj.getElementsByTagName('UL');if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode]=true;if(subUl.length>0){objectsToExpand.unshift(obj);}}
obj=obj.parentNode;}
showSubMenu(false,objectsToExpand[0]);}}
window.onload=initSlideDownMenu;

