

tabSystem.makeGlobalProps = function( e ) {
tabSystem.classTrigger = "tabsystem";tabSystem.tabPageClass = "tabpage";tabSystem.activeTabClass = "tab-active";tabSystem.hoverTabClass = "tab-hover";tabSystem.normalTabClass = "tab";tabSystem.startIndex = 0;tabSystem.removeHeadings=true;tabSystem.styleSheetUri="/style/jwb.css";tabSystem.tabContainerClass="tabcontainer";tabSystem.tabSelectedKeyword="tdefault";tabSystem.invertOrder=0;tabSystem.firstHeadingClass="firstHeading";tabSystem.firstHeadingKeepTrigger="keepheading";tabSystem.style_changeEvent="onstylechange";tabSystem.buildEvent="onbuild";tabSystem.unbuildEvent="onunbuild";tabSystem.tab_mouseoverEvent="onmouseover";tabSystem.tab_mouseoutEvent="onmouseout";tabSystem.tab_clickEvent="onclick";tabSystem.onloadEvent="onload";tabSystem.Dependancies = ( document&& document.getElementById&& document.getElementsByTagName&& document.createElement&& document.getElementsByClassName 
&& window )?1:0;tabSystem.addEventHandler=function _glo_tabSystem_addEventHandler_( evt, fn, obj, once ) { Listener.add( ((obj)?obj:tabSystem), evt, fn, this, once ) };tabSystem.removeEventHandler=function _glo_tabSystem_removeEventHandler_( evt, fn, obj ) { Listener.remove( ((obj)?obj:tabSystem), evt, fn, this ) };tabSystem.fireEventHandler=function _glo_tabSystem_fireEventHandler_( evt, obj, args ) { if( ((obj)?obj:this)[evt] )((obj)?obj:tabSystem)[evt](args) };}tabSystem.takeOutOfMemory = function _tabSystem_takeOutOfMemory_( e ) {for(var x=0;x<tabSystem.instances.length;x++) {tabSystem.instances[x].takeOutOfMemory( );}}tabSystem.construct = function tabSystem_construct_( e ) { 
var ts = document.getElementsByClassName(document, tabSystem.classTrigger)for(var x=0;x<ts[ tabSystem.classTrigger ].length;x++) {var el=ts[ tabSystem.classTrigger ][ x ];tabSystem.instances.push( new tabSystem( el, true ) );}tabSystem.fireEventHandler( tabSystem.onloadEvent );}tabSystem.genericStyleSheet = function tabSystem_genericStyleSheet_( e ) { 
if(!tabSystem.styleSheet) {var head=document.getElementsByTagName("head").item( 0 );var s=document.createElement("link");s.rel="stylesheet";s.type="text/css";s.media="screen";head.appendChild( s );tabSystem.styleSheet=s;}tabSystem.styleSheet.href=((e)?e:tabSystem.styleSheetUri);}tabSystem.getTabsetByDivision = function _tabSystem_getTabsetByDivision_( el ) {for(var x=0;x<tabSystem.instances.length;x++) {if(tabSystem.instances[x].el==el) return( tabSystem.instances[x] )}}
tabSystem.tab = function _tabSystem_tab_( member ) {this.ts=member;this.index=null;this.tabPage=null;this.hClone=null;this.event={};this.heading=null;this.addEventHandler=function _tab_addEventHandler_( evt, fn, obj, once ) { Listener.add( ((obj)?obj:this), evt, fn, this, once ) };this.removeEventHandler=function _tab_removeEventHandler_( evt, fn, obj ) { Listener.remove( ((obj)?obj:this), evt, fn, this ) };this.fireEventHandler=function _tab_fireEventHandler_( evt, obj, args ) { if( ((obj)?obj:this)[evt] )((obj)?obj:this)[evt](args) };this.notReady="Like the Grolsh, we only let you drink it... when it's ready. This tab is not (ready that is)."this.readyStateCheck = function _tabSystem_tab_readyStateCheck_( e ) {return (this.hClone&&this.tabPage&&this.ts) ?1:0;}this.addTabPage=function _tabSystem_tab_addTabPage_( e ) { this.tabPage=e; }this.createListItem = function _tabSystem_tab_createListItem_( e ) {if(this.hClone) {this.li = document.createElement("li");this.li.appendChild( this.hClone );} 
}this.addHeading = function _tabSystem_tab_addHeading_( dom_node ) {this.hClone=dom_node;if(this.hClone.style.display=="none") this.hClone.style.display="block";}this.styletab = function _tabSystem_tab_styletab_( e ) {if( this.readyStateCheck( ) ) {this.hClone.style.cursor=document.all?"hand":"pointer";this.hClone.className=this.ts.normalTabClass+" "+this.ts.backupClassName||this.ts.className;} 
}this.removeEvents = function _tabSystem_tab_removeEvents_( tab ) {if( this.readyStateCheck( ) ) {this.removeEventHandler( "onmouseout", this.event._mou_, this.hClone );this.removeEventHandler( "onclick", this.event._click_, this.hClone );this.removeEventHandler( "onmouseover", this.event._mov_, this.hClone );} 
}this.addEvents = function _tabSystem_addevents_( tab ) {if( this.readyStateCheck( ) ) {this.backupClassName=this.hClone.className;var index=this.index, obj=this.ts;this.event._mov_ = function ( e ) {obj.tabs[ index ].hClone.className+=" "+obj.hoverTabClass;obj.fireEventHandler( tabSystem.tab_mouseoverEvent, obj.tabs[ index ] );}this.event._mou_ = function ( e ) {obj.tabs[ index ].hClone.className=obj.tabs[ index ].backupClassName;obj.fireEventHandler( tabSystem.tab_mouseoutEvent, obj.tabs[ index ] );}this.event._click_ = function( e ) {obj.switchtab( index );obj.fireEventHandler( tabSystem.tab_clickEvent, obj.tabs[ index ] );}this.addEventHandler( "onmouseout", this.event._mou_, this.hClone );this.addEventHandler( "onclick", this.event._click_, this.hClone);this.addEventHandler( "onmouseover", this.event._mov_, this.hClone );}
}this.remove = function _tabSystem_removePage_( ) {if( this.readyStateCheck( ) ) {this.tabPage.parentNode.removeChild( this.tabPage );this.ts.rebuild( );}}}
function tabSystem( el, genericCapture ) {if(!genericCapture)tabSystem.instances.push(this);this.classTrigger=tabSystem.classTrigger;this.tabPageClass=tabSystem.tabPageClass;this.activeTabClass=tabSystem.activeTabClass;this.tabContainerClass=tabSystem.tabContainerClass;this.hoverTabClass=tabSystem.hoverTabClass;this.normalTabClass=tabSystem.normalTabClass;this.startIndex=tabSystem.startIndex;this.genericCapture=genericCapture;this.removeHeadings=tabSystem.removeHeadings;this.styleSheetUri=tabSystem.styleSheetUri;this.tabSelectedKeyword=tabSystem.tabSelectedKeyword;this.invertOrder=tabSystem.invertOrder;this.firstHeadingClass=tabSystem.firstHeadingClass;this.firstHeadingKeepTrigger=tabSystem.firstHeadingKeepTrigger;this.el = el;this.tabs=[];this.id=this.el.getAttribute("id");this.getTabIndexByTab=function _tabSystem_getTabIndexByTab_( e ) {for(var x=0;x<this.tabs.length;x++)if (this.tabs[x]==e) return(x)}
this.addEventHandler=function _tabSystem_addEventHandler_( evt, fn, obj, once ) { Listener.add( ((obj)?obj:this), evt, fn, this, once ) };this.removeEventHandler=function _tabSystem_removeEventHandler_( evt, fn, obj ) { Listener.remove( ((obj)?obj:this), evt, fn, this ) };this.fireEventHandler=function _tabSystem_fireEventHandler_( evt, obj, args ) { if( ((obj)?obj:this)[evt] )((obj)?obj:this)[evt](args) };this.rebuild = function _tabSystem_rebuild_( e ) {
var si=this.selected.index;this.deconstruct( );this.build( );this.switchtab(si);}
this.addTab = function _tabSystem_addTab_( div, insertBefore ) {
div.className=this.tabPageClass;this.el.insertBefore( div, (insertBefore)?insertBefore:this.tabs[0].tabPage );this.rebuild();}
this.takeOutOfMemory = function _tabSystem_takeOutOfMemory_( e ) { 
for(x in this) {try{this[x]=null}catch(ex){;;;}}}this.addStyleSheet=function _tabSystem_addStyleSheet_( stURI ) {if(!this.genericCapture) { 
if(!this.styleSheet) {var head=document.getElementsByTagName("head").item( 0 );this.styleSheet=document.createElement("link");this.styleSheet.rel="stylesheet";this.styleSheet.type="text/css";this.styleSheet.media="screen";this.styleSheet.href=stURI;head.appendChild( this.styleSheet );}else {this.styleSheet.disabled=0;this.styleSheet.href=stURI;}}else tabSystem.genericStyleSheet( stURI );this.fireEventHandler( tabSystem.style_changeEvent );}this.backup=function _tabSystem_backup_( e ) {
this.bDocFrag=this.el.cloneNode( 1 );}this.deconstruct=function _tabSystem_restore_( e ) {if(this.rendered==0) throw new Error("This tab set is not built.");this.tabContainer.style.display="none";for(var x=0;x<this.tabs.length;x++) {
this.tabs[x].tabPage.style.display="block";if( this.removeHeadings ) this.tabs[x].heading.style.display="block";}
this.rendered=0;this.fireEventHandler( tabSystem.unbuildEvent );var s=this.styleSheet||tabSystem.styleSheet;if(s)s.disabled=1;}this.build = function _tabSystem_build_( e ) { 
if(this.rendered==1) throw new Error("This tab set is already built.");if(this.tabs.lengh>0) for(var x=0;x<this.tabs.length;x++) {for(x in this.tabs[x]) if(this.tabs[x]!=this) this.tabs[x]=null;}
this.tabs=[];this.addStyleSheet( this.styleSheetUri );if( !this.hasBeenBuiltOnce &&this.el.className.search(new RegExp( this.firstHeadingKeepTrigger ) )!=-1) this.removeHeadings=0;this.tabContainer = document.createElement("div");this.el.insertBefore( this.tabContainer, this.el.firstChild );this.tabContainer.style.display="block";this.tabContainer.className=this.tabContainerClass;this.ul=document.createElement( "ul" );this.tabContainer.appendChild( this.ul );var d=this.el.getElementsByTagName("div");var z=0;for(var x=0;x<d.length;x++) {if(d[x].className.search(this.tabPageClass)!=-1 && d[x].parentNode==this.el) {var t = new tabSystem.tab( this );t.index=z;if( !this.hasBeenBuiltOnce&& d[x].className .search( this.tabSelectedKeyword ) != -1 )this.startIndex=z;var h=d.item( x ).firstChild.style?d.item( x ).firstChild:d.item( x ).childNodes.item( 1 );if( this.removeHeadings ) {
h.style.display="none";} else h.style.display="block";t.addTabPage( d[x] );t.addHeading( h.cloneNode( 1 ) );h.className=this.firstHeadingClass +=" "+h.className;t.styletab( );t.createListItem( );if( this.invertOrder && this.ul.firstChild ) this.ul.insertBefore( t.li, this.ul.firstChild );else this.ul.appendChild( t.li );t.heading=h;t.addEvents( );this.tabs[ z ]=t;z++ 
}}
this.switchtab( this.startIndex, 1 );this.rendered=1;this.hasBeenBuiltOnce=1;this.fireEventHandler( tabSystem.buildEvent );}this.switchTabToId = function _tabSystem_switchtab_( id ) { 
for(var x=0;x<this.tabs.length;x++) {if( this.tabs[x].hClone.id && this.tabs[x].hClone.id==id ) {this.switchtab( this.tabs[x].index );}}}this.switchtab = function _tabSystem_switchtab_( e, firstTime ) { 
if(!this.tabs[e]) throw new Error("tab does not exist..");var t=this.tabs[e]; if( this.selected ) {this.selected.styletab( );this.selected.addEvents( );this.selected.tabPage.style.display="none";}if( firstTime ) { 
for(var x=0;x<this.tabs.length;x++) {this.tabs[x].tabPage.style.display="none";}}t.hClone.className +=" "+ this.activeTabClass;t.removeEvents( );t.tabPage.style.display="block";this.selected=null; this.selected=t;}if ( this.genericCapture ) this.build( );this.addEventHandler( "onunload", this.takeOutOfMemory, 0, 1 );}
if(document.all || document.getElementsByTagName) {document.getElementsByClassName = function (el) {var searchObj, nodeList;searchObj = n = new Object();for (var i = 1; i < arguments.length; i++) {searchObj[arguments[i]] = new Array();}nodeList = el.all || el.getElementsByTagName("*");for (var i = 0, c = null, cn; (el.all ? c = nodeList(i) : c = nodeList.item(i)); i++) {if (c.nodeType == 1) {cn = c.className.split(" ");for (j = 0; j < cn.length; j++) {
if (searchObj[cn[j]]) {searchObj[cn[j]][searchObj[cn[j]].length] = c;}}}}return ( searchObj );}}if(!Array.prototype.push) {Array.prototype.push = function( e ) {var i;for(i=0; j=arguments[i]; i++) this[this.length] = j;return ( this.length );}}if(!window.Error) { 
function Error( message ) {this.message=message;this.name=new String;}}
tabSystem.instances = [ ];tabSystem.makeGlobalProps( );if( window && tabSystem.Dependancies && Listener) Listener.add( window, "onload", tabSystem.construct, tabSystem, 1 )else window.status="Standards-Check failed for tab system";