/*----------------------------------------------------------------------------\
|                               Tab Pane 1.02                                 |
|-----------------------------------------------------------------------------|
|                         Created by Erik Arvidsson                           |
|                  (http://webfx.eae.net/contact.html#erik)                   |
|                      For WebFX (http://webfx.eae.net/)                      |
|-----------------------------------------------------------------------------|
|                  Copyright (c) 1998 - 2003 Erik Arvidsson                   |
|-----------------------------------------------------------------------------|
| This software is provided "as is", without warranty of any kind, express or |
| implied, including  but not limited  to the warranties of  merchantability, |
| fitness for a particular purpose and noninfringement. In no event shall the |
| authors or  copyright  holders be  liable for any claim,  damages or  other |
| liability, whether  in an  action of  contract, tort  or otherwise, arising |
| from,  out of  or in  connection with  the software or  the  use  or  other |
| dealings in the software.                                                   |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| This  software is  available under the  three different licenses  mentioned |
| below.  To use this software you must chose, and qualify, for one of those. |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
| Permits  anyone the right to use the  software in a  non-commercial context |
| free of charge.                                                             |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
| Permits the  license holder the right to use  the software in a  commercial |
| context. Such license must be specifically obtained, however it's valid for |
| any number of  implementations of the licensed software.                    |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
| Permits anyone the right to use and modify the software without limitations |
| as long as proper  credits are given  and the original  and modified source |
| code are included. Requires  that the final product, software derivate from |
| the original  source or any  software  utilizing a GPL  component, such  as |
| this, is also licensed under the GPL license.                               |
|-----------------------------------------------------------------------------|
| Created 2002-01-?? | All changes are in the log above. | Updated 2003-03-03 |
\----------------------------------------------------------------------------*/

function hasSupport(){if(typeof hasSupport.support!="undefined")return hasSupport.support;var a=/msie 5\.[56789]/i.test(navigator.userAgent);hasSupport.support=typeof document.implementation!="undefined"&&document.implementation.hasFeature("html","1.0")||a;if(a){document._getElementsByTagName=document.getElementsByTagName;document.getElementsByTagName=function(b){return b=="*"?document.all:document._getElementsByTagName(b)}}return hasSupport.support} function WebFXTabPane(a,b){if(!(!hasSupport()||a==null)){this.element=a;this.element.tabPane=this;this.pages=[];this.selectedIndex=null;this.useCookie=b!=null?b:true;this.element.className=this.classNameTag+" "+this.element.className;this.tabRow=document.createElement("div");this.tabRow.className="tab-row";a.insertBefore(this.tabRow,a.firstChild);var d=0;if(this.useCookie){d=Number(WebFXTabPane.getCookie("webfxtab_"+this.element.id));if(isNaN(d))d=0}this.selectedIndex=d;d=a.childNodes;for(var c=0;c< d.length;c++)d[c].nodeType==1&&d[c].className=="tab-page"&&this.addTabPage(d[c])}}WebFXTabPane.prototype.classNameTag="dynamic-tab-pane-control";WebFXTabPane.prototype.setSelectedIndex=function(a){if(this.selectedIndex!=a){this.selectedIndex!=null&&this.pages[this.selectedIndex]!=null&&this.pages[this.selectedIndex].hide();this.selectedIndex=a;this.pages[this.selectedIndex].show();this.useCookie&&WebFXTabPane.setCookie("webfxtab_"+this.element.id,a)}};WebFXTabPane.prototype.getSelectedIndex=function(){return this.selectedIndex}; WebFXTabPane.prototype.addTabPage=function(a){if(hasSupport()){if(a.tabPage==this)return a.tabPage;var b=this.pages.length;a=this.pages[b]=new WebFXTabPage(a,this,b);a.tabPane=this;this.tabRow.appendChild(a.tab);b==this.selectedIndex?a.show():a.hide();return a}};WebFXTabPane.prototype.dispose=function(){this.tabRow=this.element=this.element.tabPane=null;for(var a=0;a<this.pages.length;a++){this.pages[a].dispose();this.pages[a]=null}this.pages=null}; WebFXTabPane.setCookie=function(a,b,d){var c="";if(d){c=new Date;c.setTime(c.getTime()+d*24*60*60*1E3);c="; expires="+c.toGMTString()}document.cookie=a+"="+b+c+"; path=/"};WebFXTabPane.getCookie=function(a){a=RegExp("(;|^)[^;]*("+a+")=([^;]*)(;|$)").exec(document.cookie);return a!=null?a[3]:null};WebFXTabPane.removeCookie=function(a){setCookie(a,"",-1)}; function WebFXTabPage(a,b,d){if(!(!hasSupport()||a==null)){this.element=a;this.element.tabPage=this;this.index=d;a=a.childNodes;for(b=0;b<a.length;b++)if(a[b].nodeType==1&&a[b].className=="tab"){this.tab=a[b];break}this.aElement=a=document.createElement("A");a.href="#";for(a.onclick=function(){return false};this.tab.hasChildNodes();)a.appendChild(this.tab.firstChild);this.tab.appendChild(a);var c=this;this.tab.onclick=function(){c.select()};this.tab.onmouseover=function(){WebFXTabPage.tabOver(c)}; this.tab.onmouseout=function(){WebFXTabPage.tabOut(c)}}}WebFXTabPage.prototype.show=function(){var a=this.tab,b=a.className+" selected";b=b.replace(/ +/g," ");a.className=b;this.element.style.display="block"};WebFXTabPage.prototype.hide=function(){var a=this.tab,b=a.className;b=b.replace(/ selected/g,"");a.className=b;this.element.style.display="none"};WebFXTabPage.prototype.select=function(){this.tabPane.setSelectedIndex(this.index)}; WebFXTabPage.prototype.dispose=function(){this.aElement=this.aElement.onclick=null;this.element.tabPage=null;this.tab.onclick=null;this.tab.onmouseover=null;this.element=this.tabPane=this.tab=this.tab.onmouseout=null};WebFXTabPage.tabOver=function(a){a=a.tab;var b=a.className+" hover";b=b.replace(/ +/g," ");a.className=b};WebFXTabPage.tabOut=function(a){a=a.tab;var b=a.className;b=b.replace(/ hover/g,"");a.className=b}; function setupAllTabs(){if(hasSupport())for(var a=document.getElementsByTagName("*"),b=a.length,d=/tab\-pane/,c=/tab\-page/,g,e,f=0;f<b;f++){e=a[f];g=e.className;if(g!="")if(d.test(g)&&!e.tabPane)new WebFXTabPane(e);else c.test(g)&&!e.tabPage&&d.test(e.parentNode.className)&&e.parentNode.tabPane.addTabPage(e)}} function disposeAllTabs(){if(hasSupport()){for(var a=document.getElementsByTagName("*"),b=a.length,d=/tab\-pane/,c,g,e=[],f=0;f<b;f++){g=a[f];c=g.className;if(c!="")if(d.test(c)&&g.tabPane)e[e.length]=g.tabPane}for(f=e.length-1;f>=0;f--){e[f].dispose();e[f]=null}}} if(typeof window.addEventListener!="undefined")window.addEventListener("load",setupAllTabs,false);else if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",setupAllTabs);window.attachEvent("onunload",disposeAllTabs)}else if(window.onload!=null){var oldOnload=window.onload;window.onload=function(a){oldOnload(a);setupAllTabs()}}else window.onload=setupAllTabs;

