if(typeof sIFR == "function"){
	var fonts = named({ sFlashSrc:"swf/flash-font-helvetica.swf", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"});
	sIFR.replaceElement("h2.sifr", fonts, "#2d2d2d");
};
function ieHover()
{
	var nav = document.getElementById("menu");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i=0; i<nodes.length; i++)
		{
			nodes[i].onmouseover = function() 
			{
				this.className += " hover";
			}
			nodes[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}

if (window.attachEvent && !window.opera){
	window.attachEvent("onload", ieHover);
}

var _sliders = new Array();
var duration = 600;


function initSlide()
{
	var nav = document.getElementById("q-nav");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("a");
		for (var i=0; i<nodes.length; i++)
		{

			nodes[i]._navdiv = document.getElementById(nodes[i].className);

			if(nodes[i]._navdiv)
			{

				nodes[i]._navdiv.style.overflow = 'hidden';
				nodes[i].moofx = new Fx.Styles(nodes[i].className,{duration:duration});	
				nodes[i]._navdiv._startHeight = nodes[i]._navdiv.offsetHeight;

				if(nodes[i]._navdiv.className.indexOf('active') != -1)
				{
					nodes[i]._navdiv.style.display = 'block';
					nodes[i].isopen = true;
					
				}
				else
				{
					nodes[i]._navdiv.style.display = 'none';
					nodes[i].isopen = false;					
				}

				nodes[i]._navdiv.style.visibility = 'visible';
				
				nodes[i].onclick = function()
				{
					if(!this.isopen)
					{
						close_all();
						this._navdiv.style.display = 'block';
						this.moofx.custom({'height': [0,this._navdiv._startHeight]});	
						this.isopen = true;
					}
					else
					{
						close_all();						
					}
				}
			}
			
			_sliders[i] = nodes[i];
			
		}
	}
}

function close_all()
{	
	for (var i=0; i<_sliders.length; i++)
	{
		if(_sliders[i]._navdiv)
		{
			_sliders[i].moofx.set({'height': 0});
			_sliders[i]._navdiv.style.display = 'none';
			_sliders[i].isopen = false;
		}
	}
}


if (window.attachEvent){
	window.attachEvent("onload", initSlide);
	}
else if (window.addEventListener){
	window.addEventListener("load", initSlide, false);
	}