if(typeof sendColors == 'function') {sendColors('308586','a7d4cd','61adaa'); }var cblock_id = 'content4';
if(window.run_19_051 == undefined)
{	
	function run_19_051(container_id)
	{		
		var container = getContainer(container_id);
		document.getElementById(container_id).parentNode.svgstyle = this;
		var ul = container.getElementsByTagName('ul')[0];
		if(ul == undefined) return;
		
		var color = window.styleColors[0];
		var colorLight = new Color(color).lighten(-50).toHex();
		var colorLighter = new Color(color).lighten(100).toHex();
		var colorText = new Color(color).getTextColor().toHex();
		
		var colorActive = window.styleColors[1];
		var colorActiveLight = new Color(colorActive).lighten(100).toHex();
		var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();
		
			/*
			cell
				link
				div (abs)
					div (rel)
						div (raphael)
						table
		*/
		
		this.convertSubMenu =  function(ul)
		{
			var tbl = document.createElement("table");
			tbl.setAttribute("cellpadding", "0");
			tbl.setAttribute("cellspacing", "0");
			tbl.setAttribute("border", "0");
			tbl.style.position = "relative";
			
			var color = window.styleColors[0];
			var colorLight = new Color(color).lighten(-50).toHex();
			var colorLighter = new Color(color).lighten(100).toHex();
			var colorText = new Color(color).getTextColor().toHex();
			
			var colorActive = window.styleColors[1];
			var colorActiveLight = new Color(colorActive).lighten(100).toHex();
			var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();
					
			for(var i = 0; i < ul.children.length; i++)
			{
				var li = ul.children[i];
				var a = li.getElementsByTagName('a')[0];
				with(a.style)
				{
					textDecoration = "none";
					fontFamily = "Helvetica,Arial,sans-serif";
					fontSize = "11px";
					display = "block";
					padding = navigator.isIE ? "2px" : "5px";
					textAlign = "left";
				}
				a.style.color = colorText;
				var row = tbl.insertRow(-1);
				var cell = row.insertCell(-1);
				cell.setAttribute("align", "left");
				cell.style.backgroundColor = 'transparent';
				cell.onmouseover = function()
				{
					var colorActive = window.styleColors[1];
					var colorActiveLight = new Color(colorActive).lighten(100).toHex();
					var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();
					
					this.parentNode.rc.attr({fill:"90-#fff-" + colorActive});
					this.children[0].style.color = colorTextActive;
					if(this.getElementsByTagName('table').length > 0)
					{
						var submenu = this.getElementsByTagName('table')[0];
						submenu.parentNode.parentNode.style.visibility = "visible";
						submenu.parentNode.style.left = (this.clientWidth - (navigator.isIE ? 3 : 0)) + 'px';
						submenu.parentNode.style.top = (-this.clientHeight - (navigator.isIE ? 1 : 0)) + 'px';
					}
				}
				cell.onmouseout = function()
				{
					var color = window.styleColors[0];
					var colorLight = new Color(color).lighten(-50).toHex();
					var colorLighter = new Color(color).lighten(100).toHex();
					var colorText = new Color(color).getTextColor().toHex();
					
					this.parentNode.rc.attr({fill:"90-" + color + "-" + colorLight, stroke:color});

//					this.parentNode.rc.attr({fill:"90-" + color + "-#" + color});
					this.children[0].style.color = colorText;
					if(this.getElementsByTagName('table').length > 0)
					{
						var submenu = this.getElementsByTagName('table')[0];
						submenu.parentNode.parentNode.style.visibility = "hidden";
					}
				}
				cell.appendChild(a);
				
				var subUL = li.getElementsByTagName('ul');
				if(subUL.length > 0)
				{
					var divAbs = document.createElement('div');
					with(divAbs.style)
					{
						position = 'absolute';
						width = '0px';
						height = '0px';
						visibility = "hidden";
						border = '0px solid red';
					}
					
					var divRel = document.createElement('div');
					with(divRel.style)
					{
						position = 'relative';
						width = '0px';
						height = '0px';
						border = '0px solid green';
					}
					divAbs.appendChild(divRel);
					
					var submenu = this.convertSubMenu(subUL[0]);
					divRel.appendChild(submenu);
					
					cell.appendChild(divAbs);
				}
			}
			return tbl;
		}
	
		//create a table
		var tbl = document.createElement("table");
		tbl.setAttribute("cellpadding", "0");
		tbl.setAttribute("cellspacing", "0");
		tbl.setAttribute("border", "0");
		tbl.setAttribute("width", "100%");
		tbl.setAttribute("height", "100%");
		tbl.style.position = 'relative';
		tbl.style.backgroundColor = "transparent";
		
		var row = tbl.insertRow(0);
		
		for(var i = 0; i < ul.children.length; i++)
		{
			var li = ul.children[i];
			var a = li.getElementsByTagName('a')[0];
			a.style.textDecoration = "none";
			var cell = row.insertCell(-1);
			
			with(a.style)
			{
				fontFamily = "Helvetica,Arial,sans-serif";
				fontSize = "12px";
				color = colorText;
				display = "block";
				padding = navigator.isIE ? "2px" : "5px";
			}
			a.raphaelStyle = this;
			a.index = i;
			var diva = document.createElement('div');
			diva.style.width = '100%';
			diva.style.textAlign = 'center';
			diva.appendChild(a);
			cell.appendChild(diva);
			
			cell.onmouseover = function()
			{
				var color = window.styleColors[0];
				var colorLight = new Color(color).lighten(-50).toHex();
				var colorLighter = new Color(color).lighten(100).toHex();
				var colorText = new Color(colorLighter).getTextColor().toHex();
				
				var colorActive = window.styleColors[1];
				var colorActiveLight = new Color(colorActive).lighten(100).toHex();
				var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();

				var a = this.children[0].children[0];
				var rc = a.raphaelStyle.rCells[a.index];
				rc.un.animate({opacity: 1}, 200);
				//rc.un.attr("opacity", 1);
				
				if(this.getElementsByTagName('table').length > 0)
				{
					this.children[1].style.visibility = 'visible';
					this.children[1].style.top = (this.clientHeight - a.parentNode.clientHeight - a.parentNode.offsetTop) + 'px';
				}
			}
			cell.onmouseout = function()
			{
				var color = window.styleColors[0];
				var colorLight = new Color(color).lighten(-50).toHex();
				var colorLighter = new Color(color).lighten(100).toHex();
				var colorText = new Color(color).getTextColor().toHex();
				
				var colorActive = window.styleColors[1];
				var colorActiveLight = new Color(colorActive).lighten(100).toHex();
				var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();
				
				var a = this.children[0].children[0];
				var rc = a.raphaelStyle.rCells[a.index];
				//if(a.isActive) { rc.un.attr("opacity", 1); } else { rc.un.attr("opacity", 0); }
				if(a.isActive) { rc.un.animate({opacity: 1}, 400); } else { rc.un.animate({opacity: 0}, 400); }
				rc.attr({fill:color, stroke:colorLight});
				if(this.getElementsByTagName('table').length > 0)
				{
					this.children[1].style.visibility = 'hidden';
				}
			}
			
			if(li.className.substr(li.className.length - 3, 3) == "act")
			{
				a.isActive = true;
			}
			
			var subUL = li.getElementsByTagName('ul');
			if(subUL.length > 0) //submenu exists
			{
				var subtable = this.convertSubMenu(subUL[0]);
				subtable.style.position = 'absolute';
				var subTopDiv = document.createElement('div');
				subTopDiv.className = 'subTopDiv';
				subTopDiv.style.position = 'relative';
				subTopDiv.style.visibility = 'hidden';
				subTopDiv.style.zIndex = '100';
				subTopDiv.appendChild(subtable);
				cell.appendChild(subTopDiv);
			}
		}
		container.removeChild(container.children[0]);
		container.appendChild(tbl);

		var canvas = document.createElement('div');
		canvas.style.position = "absolute"; //to exclude from piling up
		var g = Raphael(canvas, tbl.clientWidth, tbl.clientHeight + 5);

		this.rCells = new Array();
		for(var i = 0; i < row.cells.length; i++)
		{
			var x = row.cells[i].offsetLeft + 0.5;
			var w = i != row.cells.length - 1 ? row.cells[i + 1].offsetLeft - row.cells[i].offsetLeft : tbl.clientWidth - row.cells[i].offsetLeft;
			var h = tbl.clientHeight - 1;
			
			if(navigator.isIE)
			{
				var rc = g.rect(x, -1, w, h + 4, 0);
				rc.un = g.rect(x, h - 5, w, h + 5, 0);
			}
			else
			{
				var rc = g.rect(x + 0.5, -1.5, w, h + 5, 0);
				rc.un = g.rect(x, h - 5.5, w, h + 5, 0);
			}
			this.rCells.push(rc);
		}
		container.insertBefore(canvas, container.children[0]);
		
		for(var i = 0; i < row.cells.length; i++)
		{
			if(row.cells[i].getElementsByTagName('a')[0].isActive) 
				this.rCells[i].un.attr("opacity", 1);
			else
				this.rCells[i].un.attr("opacity", 0);

			this.rCells[i].attr({ fill:color, stroke:colorLight });				
			this.rCells[i].un.attr({ fill:colorActive, stroke:colorActive });				
		}
		
		//add Raphael to submenu tables
		var subtables = tbl.getElementsByTagName('table');
		for(var i = 0; i < subtables.length; i++)
		{
			var subtbl = subtables[i];
			var div = document.createElement('div');
			with(div.style)
			{
				position = 'absolute';
				width = subtbl.clientWidth;
				height = subtbl.clientHeight;
				border = '0px solid black';
			}
			subtbl.parentNode.insertBefore(div, subtbl);
			
			var gSub = Raphael(div, subtbl.clientWidth + 1, subtbl.clientHeight + 1);
			for(var j = 0; j < subtbl.rows.length; j++)
			{
				if(navigator.isIE)
				{
					var y = subtbl.rows[j].offsetTop;
					var h = subtbl.rows[j].clientHeight + 1;
					var rc = gSub.rect(0, y, subtbl.clientWidth - 4, h + 1, 0);
					rc.attr({fill:"90-" + color + "-" + colorLight, stroke:color});
					subtbl.rows[j].rc = rc;
				}
				else
				{
					var y = subtbl.rows[j].offsetTop;
					var h = subtbl.rows[j].clientHeight;
					var rc = gSub.rect(0.5, 0.5 + y, subtbl.clientWidth, h, 0);
					rc.attr({fill:"90-" + color + "-" + colorLight, stroke:color});
					subtbl.rows[j].rc = rc;
				}
			}
		}
		
		///////////// RESIZING ////////////////////////////////////////
		this.onResize = function(width, height)
		{
			this.g.setSize(width, height);
			var tbl = this.resizer;
			var h = tbl.clientHeight - 1;
			var row = tbl.rows[0];
			for(var i = 0; i < row.cells.length; i++)
			{
				var x = row.cells[i].offsetLeft;
				if(navigator.isIE) x -= 0.5;
				var w = i != row.cells.length - 1 ? row.cells[i + 1].offsetLeft - row.cells[i].offsetLeft : tbl.clientWidth - row.cells[i].offsetLeft;
				var rc = this.rCells[i];

				rc.attr("x", x + 0.5);
				rc.attr("width", w);
				rc.attr("height", h + 5);
				rc.un.attr("x", x + 1.5);
				rc.un.attr("width", w - 2);
				rc.un.attr("y", h - 5);
			}
			this.g.safari();
		}
				
		window.objectsToResize.push(this);
		this.g = g;
		this.resizer = tbl;
		updateSize(this);
		
		///////////////////////////////////////// UPDATE COLORS ////////////////////////////////////////////////
		this.updateSubmenuColors = function(tbl)
		{
			var color = window.styleColors[0];
			var colorLight = new Color(color).lighten(50).toHex();
			var colorLighter = new Color(color).lighten(100).toHex();
			var colorText = new Color(color).getTextColor().toHex();
			
			for(var i = 0; i < tbl.rows.length; i++)
			{
				var a = tbl.rows[i].cells[0].children[0];
				tbl.rows[i].cells[0].parentNode.rc.attr({fill:"90-" + color + "-" + colorLight, stroke:color});
				a.style.color = colorText;
				if(tbl.rows[i].cells[0].getElementsByTagName('table').length > 0)
				{
					this.updateSubmenuColors(tbl.rows[i].cells[0].getElementsByTagName('table')[0]);
				}
				
			}
		}
		
		this.updateColors = function()
		{
			return;
			
			var color = window.styleColors[0];
			var colorLight = new Color(color).lighten(-50).toHex();
			var colorLighter = new Color(color).lighten(100).toHex();
			var colorText = new Color(color).getTextColor().toHex();
			
			var colorActive = window.styleColors[1];
			var colorActiveLight = new Color(colorActive).lighten(100).toHex();
			var colorTextActive = new Color(colorActiveLight).getTextColor().toHex();
			
			var tbl = this.resizer;
			var row = tbl.rows[0];
			for(var i = 0; i < row.cells.length; i++)
			{
				var rc = this.rCells[i];
				var a = row.cells[i].children[0].children[0];
				if(a.isActive)
					rc.attr({fill:"90-" + colorActive + "-#fff", stroke:colorActive});
				else
				{
					rc.attr({fill:"90-" + color + "-" + colorLight, stroke:color});
					a.style.color = colorText;
				}
				
				//update submenu colors
				if(row.cells[i].getElementsByTagName('table').length > 0)
				{
					this.updateSubmenuColors(row.cells[i].getElementsByTagName('table')[0]);
				}
			}
		}
	}
}
new run_19_051(cblock_id);


