function cMenue() {
									
	this.aMenueItems = new Array();
									
	this.showSubMenue = function(id) {
		this.aMenueItems[id].show = true;
		this.hideAllSubs(id);
		var ul = document.getElementById("submenue" + id);
		if(!ul)
			return;
		ul.className = "show";
	}
								
	this.hideAllSubs = function(id) {
		for(var i=0 ; i<this.aMenueItems.length ; i++)
		{
			if(i==id)
				continue;
			this.hide(i);
		}
	}
									
	this.hideSubMenue = function(id) {
		this.aMenueItems[id].show = false;
		setTimeout('oMenue.hide(' + id + ')', 500);
	}
								
	this.hide = function(id) {
		if(this.aMenueItems[id].show == true)
			return;
			
		var ul = document.getElementById("submenue" + id);
		if(!ul)
			return;
		ul.className = "hide";
	}
								
								
	this.addMenueItem = function(oMenueItem) {
		this.aMenueItems.push(oMenueItem);				
	}
		
	this.toHTML = function() {
		var html = '';
		
		if(this.aMenueItems.length > 0) { 
			for(var i=0; i<this.aMenueItems.length; i++)
			{
				html += this.aMenueItems[i].toHTML();
			}
			
		}
		return html;
	}
}
								
function cMenueItem(id, text, href, sitemapID) {
	this.id = id;
	this.text = text;
	this.href = href;
	this.sitemapID = sitemapID;
	this.show = false;
	this.active = false;
	this.printSeperator = true;
	this.imageFolder = "";
						
	this.aListItems = new Array();
	
	this.setImageFolder = function(imageFolder)
	{
		//LTRIM & RTRIM
		imageFolder = imageFolder.replace(new RegExp("^[ \\s\u00A0]+", "g"), '').replace(new RegExp("[ \\s\u00A0]+$", "g"), '');

		var temp = ((imageFolder.substr(0, 1) != "/") ? "/" : "") + imageFolder + ((imageFolder.substr((imageFolder.length - 1), 1) != "/") ? "/" : "");  
		this.imageFolder = temp;
	}
	
	this.getImageFolder = function()
	{
		return this.imageFolder;
	}
	
	this.addListItem = function(oListItem) {
		this.aListItems.push(oListItem);				
	}

	this.toHTML = function() {

		var html = '';
		
		if(this.active == true)
			html += '<td style="width:3px;"><img src="/img' + this.getImageFolder() + 'navi/navi_bg_active_left.gif" style="width:3px;height:22px;" alt=""/></td>';
		
		html += '<td><div class="menulist" onmouseover="oMenue.aMenueItems[' + this.id + '].show=true; oMenue.showSubMenue(' + this.id + ');" onmouseout="oMenue.hideSubMenue(' + this.id + ');" >';
		
		var options = "";
		if(this.active == true)
			options = 'class="active"';
		
		html += '<b><a href="' + this.href + '" target="_self" ' + options + '>' + this.text + '</a></b>';
			
		if(this.aListItems.length > 0) { 
			html += '<div class="hide" id="submenue' + this.id + '" onmouseover="oMenue.aMenueItems[' + this.id + '].show=true;" style="width:160px;z-index:999;">';
			html += '<table style="width:100%;">';
			html 	+= '<tr>';
			html 		+= '<td style="width:5px;height:1px;font-size:0px;background:url(/img' + this.getImageFolder() + 'navi/popupnav_shadow_left.png);">&nbsp;</td>';
			html 		+= '<td>';							
			
			for(var i=0; i<this.aListItems.length; i++)
			{
				html += this.aListItems[i].toHTML();
			}
			
			html 		+= '</td>';							
			html 		+= '<td style="width:5px;height:1px;font-size:0px;background:url(/img' + this.getImageFolder() + 'navi/popupnav_shadow_right.png);">&nbsp;</td>';
			html 	+= '</tr>';
			html 	+= '<tr>';
			html 		+= '<td style="height:5px;font-size:0px;background:url(/img' + this.getImageFolder() + 'navi/popupnav_shadow_bottom_left.png);">&nbsp;</td>';
			html 		+= '<td style="height:5px;font-size:0px;background:url(/img' + this.getImageFolder() + 'navi/popupnav_shadow_bottom.png);">&nbsp;</td>';
			html 		+= '<td style="height:5px;font-size:0px;background:url(/img' + this.getImageFolder() + 'navi/popupnav_shadow_bottom_right.png);">&nbsp;</td>';
			html 	+= '</tr>';
			html += '</table>';										
	
			html += '</div>';
		}
					
		html += '</div></td>';
		
		if(this.active == true)
			html += '<td style="width:3px;"><img src="/img/fw/navi_bg_active_right.gif" style="width:3px;height:22px;" alt=""/></td>';
		
		if(this.printSeperator == true && this.active == false)
			html += '<td style="width:1px;"><img src="img/fw/navi_seperator.gif" style="width:1px;height:22px;" alt=""/></td>';		
		
		return html;
	}
}
						
function cListItem(text, href) {
	this.text = text;
	this.href = href;
								
	this.toHTML = function() {
		var html = '<div class="listitem" style="width:100%;position:relative;">';
		html += '<a href="' + this.href + '" target="_self"><b>' + this.text + '</b></a>';
		html += '</div>';
		html += '';
		return  html;
	}
}
								
var oMenue = new cMenue();
