// Flash header Script
// Megawatt theme

if(window.attachEvent) //IE
{
	window.attachEvent("onload", _initPageFunction);
}
else if(window.addEventListener) //DOM
{
	window.addEventListener("load", _initPageFunction, false);
}

// Function used to initialize all functions used in page
function _initPageFunction()
{
	_initLogo();
	_initLeftMenu();
	
		if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
		_checkTabPosition();
		_checkLeftMenuOrder();
	}
}

// function that insert a link over the logo in the header of the page for SEO
function _initLogo()
{
	if(document.getElementById('contentLogo'))
	{
		var oDivLogo = document.getElementById('contentLogo');
		if(oDivLogo){oDivLogo.innerHTML = '<a id="megawattLogo" href="/" title="Megawatt">Megawatt</a>';}
	}
}

function _checkTabPosition()
{
	if(document.getElementById("oucProductDescription_oTabs"))
	{
		document.getElementById("oucProductDescription_oTabs").style.marginBottom = "-1px";
	}
}

function _checkLeftMenuOrder(){
	if(document.getElementById("oucLeftMenu_oucMenuMyAccount_trCheckout"))
	{
		document.getElementById("oucLeftMenu_oucMenuMyAccount_trCheckout").style.display = "table-row";
	}
}

function _initLeftMenu()
{
	if(navigator.userAgent.indexOf("MSIE 6") > -1)
{
	if(document.getElementById("leftMenu"))
{
	document.getElementById("leftMenu").style.marginLeft = "6px";
}
}
}
