// Flash header Script
// Galenova 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();
	_checkDivAjax();
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
		_checkTabPositionFF();
	}
	else
	{
		_checkTabPosition();
	}
}

// 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(EcommercePageCulture == "fr-CA")
		{
			if(oDivLogo){oDivLogo.innerHTML = '<a id="logoGalenova" href="/" title="Galenova: Produits, matériel et équipements pharmaceutiques">Galenova: Produits, matériel et équipements pharmaceutiques</a>';}
		}
		else
		{
			if(oDivLogo){oDivLogo.innerHTML = '<a id="logoGalenova" href="/" title="Galenova: Pharmaceutical Products, Equipment and Supplies">Galenova: Pharmaceutical Products, Equipment and Supplies</a>';}
		}
	}
}

function _checkTabPosition()
{
	if(document.getElementById("oucProductDescription_oTabs"))
	{
		document.getElementById("oucProductDescription_oTabs").style.marginBottom = "-4px";
	}
}

function _checkTabPositionFF()
{
	if(document.getElementById("oucProductDescription_oTabs"))
	{
		document.getElementById("oucProductDescription_oTabs").style.marginBottom = "-1px";
	}
}

function _checkDivAjax()
{
	if(document.getElementById("oDivAjax"))
	{
		document.getElementById("oDivAjax").style.width = "";
	}
}