	//  PaletteNav Constructor and Methods : Call this with a set of arguments that represent each palette in order
	//  Example: PaletteNav("community", "business", "sports")
		
		function PaletteNav(){
			this.seq = arguments
			for(i=0; i<this.seq.length; i++){
				this[this.seq[i]] = new Palette(this.seq[i],i)
			}
			if(is.ns){
				this.tailheight = paletteNavTail.css.document.height
			}
		}
		
		function getPosition(ordinal){
			if(is.ns){
				var theHeight = 0
				for(i=0; i<ordinal; i++){
					thePalette = this[this.seq[i]]
					theHeight += (thePalette.expanded) ? thePalette.expandedHeight : thePalette.collapsedHeight
				}
				return(theHeight)
			}
		}
		
		function refreshPaletteNav(){
			if(is.ns && isLoaded){
				for(i=0; i<this.seq.length; i++){
					thePaletteContainer = eval(this.seq[i] + "palette")
					thePaletteContainer.moveTo(thePaletteContainer.x, this.getPalettePosition(this[this.seq[i]].ordinal))
				}
				paletteNavTail.moveTo(paletteNavTail.x, this.getPalettePosition(this.seq.length))
				pStack.clipTo(0,145,this.getPalettePosition(this.seq.length) + this.tailheight,0)
			}
		}	
		
		
	function isInPaletteList(s){
			for(i=0; i<this.seq.length; i++){if(this.seq[i] == s){return(1);}}
			return(0)
		}	
		
	PaletteNav.prototype.isInList = isInPaletteList		
		
	function showOnly(paletteName){
		if((paletteName != "home") && isLoaded){
			for(x=0; x<this.seq.length; x++){
				if(this.seq[x] != paletteName){thePaletteNav[this.seq[x]].collapse();}
			}
		}
	}
	
	PaletteNav.prototype.hilite = showOnly		
		
		
		if(is.ns){
			PaletteNav.prototype.refresh = refreshPaletteNav	
			PaletteNav.prototype.getPalettePosition = getPosition	
		}
		
	//  Palette Constructor and Methods : This is built	by the PaletteNav Constructor
	
		expandedArrow = new Image(); expandedArrow.src="images/TabArrowUp.gif";
		collapsedArrow = new Image(); collapsedArrow.src="images/TabArrowDown.gif";
		
		function Palette(theName, ordinal){
			this.ordinal = ordinal
			this.expanded = true;
			this.tab = eval(theName + "tab")
			this.content = eval(theName + "content")
			if(is.ns){
				this.collapsedHeight = this.tab.css.document.height			
				this.expandedHeight = this.content.css.document.height + this.collapsedHeight
				this.arrowimgstr = "document.layers.pageDiv.document.layers.pStackDiv.";
				this.arrowimgstr += "document.layers." + theName + "paletteDiv.";
				this.arrowimgstr += "document.layers." + theName + "tabDiv.";
				this.arrowimgstr += "document.images." + theName + "arrowimg";
				if(!(document.layers && (navigator.appVersion.indexOf("4.0")!=-1))){
					this.arrowimg = eval(this.arrowimgstr)
				}
			}
			if(is.ie){
				this.arrowimg = eval("document.images." + theName + "arrowimg")
			}
		}

		function showCollapsedArrow(){
			if(isLoaded && !(document.layers && (navigator.appVersion.indexOf("4.0")!=-1))){
				this.arrowimg.src = collapsedArrow.src
			}
		}	
		
		function showExpandedArrow(){
			if(isLoaded && !(document.layers && (navigator.appVersion.indexOf("4.0")!=-1))){
				this.arrowimg.src = expandedArrow.src
			}
		}	
		
		Palette.prototype.collapseArrow = showCollapsedArrow;
		Palette.prototype.expandArrow = showExpandedArrow;
				

		function collapsePalette(){
			if(isLoaded){
				if(is.ns){
					this.content.hide();
					this.expanded = false;
					thePaletteNav.refresh();
				}
				if(is.ie){
					this.expanded = false;
					this.content.css.display = "none";
				}
				this.collapseArrow();
			}
		}
		
		function expandPalette(){
			if(isLoaded){
				if(is.ns){
					this.expanded = true;
					thePaletteNav.refresh();
					this.content.show();
				}
				if(is.ie){
					this.expanded = true;
					this.content.css.display = "block";
				}	
				this.expandArrow()	
			}	
		}
		
		function togglePalette(){
			if(isLoaded){
				if(this.expanded){this.collapse()}
				else{this.expand()}
			}
		}
		
		Palette.prototype.collapse = collapsePalette;
		Palette.prototype.expand = expandPalette;
		Palette.prototype.toggle = togglePalette;
		
	// StyleSheetBuilder
	
		s = new Object()
		
		s.pStackDiv = "#pStackDiv{position:absolute; left:4; top:180; width:140px;"
		s.pStackDiv += is.ns ? "clip:rect(0,145,1000,0);" : ""
		s.pStackDiv += "}"
		
		s.homeDiv = "#homeDiv{position:absolute; left:4; top:156; width:140px; height:20px;}"
		
		s.palette = ".palette{left:0; top:0px; width: 139px;"
		s.palette += "position:" + (is.ns ? "absolute" : "relative") + ";"
		s.palette += "}"
		
		s.paletteNavTailDiv = "#paletteNavTailDiv{left:4px; top:0px; width:140px; padding-left:0;"
		s.paletteNavTailDiv += "position:" + (is.ns ? "absolute" : "relative") + ";"
		s.paletteNavTailDiv += "}"
		
		s.palettearrow = ".palettearrow{position:absolute; left:123px; top:8px; width:8px; height:8px;}"
		
		s.palettetab = ".palettetab{left:0px; top:0px; width:140px; height:20px;"
		s.palettetab += "position:" + (is.ns ? "absolute" : "relative") + ";"
		s.palettetab += "}"
		
		s.palettecontent  = ".palettecontent {left:0px; width:139px; padding:0,0,0,0; background-color:#eeeeee; layer-background-color:#eeeeee; border-color: #666666;  border-style:solid; border-width:1px 1px 1px 1px;"
		s.palettecontent  += "position:" + (is.ns ? "absolute" : "relative") + ";"
		s.palettecontent  += "top:" + (is.ns ? "20" : "-4") + ";"
		s.palettecontent  += "}"
		
		
		theStyleSheet = "<style type='text/css'>"
		for (styleLine in s){
			theStyleSheet += s[styleLine] + "\r"
		}
		theStyleSheet += "</style>"
		
		document.write(theStyleSheet)	
	
	