// Flash header Script
/******************** Event registration ********************/
if(window.attachEvent) //IE
{
	window.attachEvent("onload", _initPageFunction);
}
else if(window.addEventListener) //DOM
{
	window.addEventListener("load", _initPageFunction, false);
}


function _initPageFunction()
{
	_initLogo();
_initHeader();
}

// function that insert a link over the logo in the header of the page for SEO
function _initLogo()
{
	var oDivLogo = document.getElementById('contentLogo');
	if(oDivLogo){oDivLogo.innerHTML = '<a id="insoleLogo" href="/default.aspx" title="The Insole Shop">The Insole Shop</a>';}
}

function _initHeader(){
	
	var oFlashObject = new FlashObject("/img/Medias/Insoles-ca/header.swf", "oFlashHeader", "609", "179", "6", "FFFFFF");
	oFlashObject.addParam("wmode", "transparent");
	oFlashObject.addParam("menu", "false");
	oFlashObject.addParam("quality", "high");
	oFlashObject.addParam("swLiveConnect", "true");
	oFlashObject.addParam("allowScriptAccess", "sameDomain");
	oFlashObject.addVariable("CurrentLang", EcommercePageCulture);
	oFlashObject.addVariable("FolderName", "Insoles-ca/");
	oFlashObject.write("contentHeader"); 
}

/*
function _initFlashInstaller()
{
	
	_initDivInstaller();

	var oFlashInstaller = new FlashObject("/ecom_theme/img/medias/test.swf", "oFlashInstaller", "609", "179", "6", "FFFFFF");
	oFlashInstaller.addParam("wmode", "transparent");
	oFlashInstaller.addParam("menu", "false");
	oFlashInstaller.addParam("quality", "high");
	oFlashInstaller.addParam("swLiveConnect", "true");
	oFlashInstaller.addParam("allowScriptAccess", "sameDomain");
	oFlashInstaller.write("flashInstaller"); 

	oDivInstaller = document.getElementById('flashInstaller');
	oDivInstaller.style.display = "block";
}
*/

/*
function _initDivInstaller()
{
	if(document.getElementById('flashInstaller') == null)
	{
		var divInstaller = document.createElement('div');
		divInstaller.setAttribute('id', 'flashInstaller');
		document.getElementsByTagName('body')[0].appendChild(divInstaller);
			
		_initDivInstallerSettings();
	}
}
*/

/*
function _initDivInstallerSettings()
{
	oDivInstaller = document.getElementById('flashInstaller');
	
	oDivInstaller.style.display = "none";
	oDivInstaller.style.position = "absolute";
	oDivInstaller.style.width = 609;
	oDivInstaller.style.height = 179;
	oDivInstaller.style.zIndex = 998;
	//oDivInstaller.style.lineHeight = 2;
	//oDivInstaller.style.backgroundColor = "FFFFFF";
	oDivInstaller.style.left = (((getScreenWidth() + getScrollingDistanceHorizontal()) / 2) - (609/2));
	oDivInstaller.style.top = (((getScreenHeight() + getScrollingDistanceVertical()) / 2) - (179/2));
}
*/


/*
====================================================================
	FLASH DETECTION
====================================================================
*/

/*
document.write('<script type="text/javascript" src="/ecom_theme/javascript/flashdetect.js"></script>');

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	
	
function _initFlashDetection()
{
	
	//	
	// Major version of Flash required
	var requiredMajorVersion = 8;

	//
	// Minor version of Flash required
	var requiredMinorVersion = 0;

	//
	// Minor version of Flash required
	var requiredRevision = 0;

	// -----------------------------------------------------------------------------

	// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
	var hasProductInstall = DetectFlashVer(6, 0, 65);
	//
	// Version check based upon the values defined in globals
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	//
	// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
	if ( hasProductInstall && !hasReqestedVersion ) 
	{
		// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
				
		_initFlashInstaller();

	} 
	else if (hasReqestedVersion) 
	{
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
		
		_initHeader();	
	} 
	else
	{
		// flash is too old or we can't detect the plugin
	}

}
*/
