	function FolderTabMenu(tab)
	{
		this.startTab;
		this.centerTab;
		this.endTab;
		this.menuId;
		
		this.bgColorOn = '#330000';
		this.bgColorOff = '#D5CEAA';
		this.foreColorOn = '#ffffff';
		this.foreColorOff = '#ACA899';
		this.foreColorHoverOn = '#ffffff';
		this.foreColorHoverOff = '#ffffff';
		this.startTabOn = './images/left_brown.gif';
		this.startTabOff = './images/left_button.gif';
		this.centerTabOnLeft = './images/center_button_brown.gif';
		this.centerTabOnRight = './images/center_brown_button.gif';
		this.centerTabOffLeft = './images/center_button_left.gif';
		this.centerTabOffRight = './images/center_button_right.gif';
		this.endTabOn = './images/right_brown.gif';
		this.endTabOff = './images/right_button.gif';
		this.menuState = (tab>0)?tab:1;
		
		this.setBgColorOn = function(e)
		{
			this.bgColorOn = e;
		}
		this.setBgColorOff = function(e)
		{
			this.bgColorOff = e;
		}
		this.setForeColorOn = function(e)
		{
			this.foreColorOn = e;
		}
		this.setForeColorOff = function(e)
		{
			this.foreColorOff = e;
		}
		this.setHoverOn = function(e)
		{
			this.foreColorHoverOn = e;
		}
		this.setHoverOff = function(e)
		{
			this.foreColorHoverOff = e;
		}
		this.setStartTabOn = function(e)
		{
			this.startTabOn = e;
		}
		this.setStartTabOff = function(e)
		{
			this.startTabOff = e;
		}
		this.setCenterTabOnLeft = function(e)
		{
			this.centerTabOnLeft = e;
		}
		this.setCenterTabOnRight = function(e)
		{
			this.centerTabOnRight = e;
		}
		this.setCenterTabOffLeft = function(e)
		{
			this.centerTabOffLeft = e;
		}
		this.setCenterTabOffRight = function(e)
		{
			this.centerTabOffRight = e;
		}
		this.setEndTabOn = function(e)
		{
			this.endTabOn = e;
		}
		this.setEndTabOff = function(e)
		{
			this.endTabOff = e;
		}
		
		this.setMenuState = function(e)
		{
			this.menuState = (e)?e:1;
		}
		
		this.setMenu = function(e)
		{
			
			var countTabs = 1;
			if(e>0)this.menuState = e;
			while(document.getElementById("h"+this.menuId+countTabs))
			{
				if(countTabs == this.menuState)
				{
					this.startTab = this.startTabOn;
					//this.centerTab = this.centerTabOnLeft;
					this.endTab = this.endTabOn;
					this.backColor = this.bgColorOn;
					this.foreColor = this.foreColorOn; 
					this.foreColorHover = this.foreColorHoverOn;
				}
				else
				{
					this.startTab = this.startTabOff;
					//this.centerTab = this.centerTabOnRight;
					this.endTab = this.endTabOff;
					this.backColor = this.bgColorOff;
					this.foreColor = this.foreColorOff;
					this.foreColorHover = this.foreColorHoverOff;
				}
				if(countTabs < this.menuState)this.centerTab = this.centerTabOffLeft;
				if(countTabs == this.menuState)this.centerTab = this.centerTabOnRight;
				if((countTabs-1) == this.menuState)this.centerTab = this.centerTabOffRight;
				if((countTabs+1) == this.menuState)this.centerTab = this.centerTabOnLeft;

				var tabs = new Object(document.getElementById("t"+this.menuId+countTabs))
				if(tabs.style)
				{
					tabs.style.backgroundColor=this.backColor;
					tabs.style.backgroundImage="url("+this.startTab+")";
					tabs.style.width="3px";
					tabs.style.height="20px";
				}
				
				var head = new Object(document.getElementById("h"+this.menuId+countTabs));
				var a = new Object(document.getElementById("a"+this.menuId+countTabs));
				if(head.style)
				{
					head.style.backgroundColor=this.backColor;
					head.style.color=this.foreColor;
					a.style.color=this.foreColor;
					a.style.textDecoration='none';
					a["onmouseover"]=new Function("this.style.color='"+this.foreColorHover+"';");
					a["onmouseout"]=new Function("this.style.color='"+this.foreColor+"';");
				}
				
				var center = new Object(document.getElementById("c"+this.menuId+countTabs));
				if(center.style)
				{
					center.style.backgroundImage="url("+this.centerTab+")";
					center.style.backgroundColor=this.backColor;
					center.style.width="13px";
					center.style.height="20px";
				}
				var end = new Object(document.getElementById("e"+this.menuId+countTabs));
				if(end.style)
				{
					end.style.backgroundColor=this.backColor;
					end.style.backgroundImage="url("+this.endTab+")";
					end.style.width="3px";
					end.style.height="20px";
				}
				countTabs++;
			}
		}
		
		this.createMenu = function (e,h,hrefs,div)
		{
			this.menuId = div;
			var query = (hrefs.indexOf('?'))?'&':'?';
		
			var arrH = h.split("|");
			var hrefs = hrefs.split("|");
			var tblMenu = '';
			tblMenu += '<table border="0" cellpadding="0" cellspacing="0">';
			tblMenu += '	<tr>';
			for (i=1;i<=arrH.length;i++)
			{
				if(i==1)tblMenu += '		<td id="t'+this.menuId+i+'"></td>';
				
				tblMenu += '		<td id="h'+this.menuId+i+'"><a id="a'+this.menuId+i+'" href="'+hrefs[i-1]+query+'tab='+i+'">'+arrH[i-1]+'</a></td>';
				if(i<(arrH.length))tblMenu += '		<td id="c'+this.menuId+i+'"></td>';
				
				if(i==(arrH.length))tblMenu += '		<td id="e'+this.menuId+i+'"></td>';
			}
			tblMenu += '		</tr>';
			tblMenu += '</table>';
			
			if(div)
			{
				document.getElementById(div).innerHTML = tblMenu;
			}
			else
			{
				document.write(tblMenu);
			}
			
			this.setMenu();
		}
	}
	
/*
	var tabState = "tabmenu1";
	if(CPW_readCookie("tabState"))tabState = CPW_readCookie("tabState");
	if(QueryString("tab"))tabState = QueryString("tab");
	CPW_setCookie("tabState", tabState, 4, "/");
	
	var TabMenu = new FolderTabMenu();
	TabMenu.setMenuState(CPW_readCookie("tabState"));
	TabMenu.setBgColorOn('#330000');
	TabMenu.setBgColorOff = '#D5CEAA';
	TabMenu.setForeColorOn = '#ffffff';
	TabMenu.setForeColorOff = '#ACA899';
	TabMenu.setHoverOn = '#ffffff';
	TabMenu.setHoverOff = '#ffffff';
	TabMenu.setStartTabOn = './images/left_brown.gif';
	TabMenu.setStartTabOff = './images/left_button.gif';
	TabMenu.setCenterTabOnLeft = './images/center_brown_button.gif';
	TabMenu.setCenterTabOnRight = './images/center_button_brown.gif';
	TabMenu.setEndTabOn = './images/right_brown.gif';
	TabMenu.setEndTabOff = './images/right_button.gif';
	TabMenu.createMenu('','MAIL NEWSLETTERS,SENT NEWSLETTERS','tabmenu');
*/
