function replaceMenu(iElementId, iCountry, iLanguage, iBackgroundColorString, iPageType, iStartPageUrl) {
	switch(gTewonderGlobalFunctions["getUsedProgramIdName"]()) {
		case "ie":
		case "fx":
		case "sa":
			//MENOTE: do nothing
			break;
		default:
			return;
	}
	
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		"flash/menu.swf",
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: iBackgroundColorString},
		{},
		{
			country: iCountry,
			language: iLanguage,
			backgroundColor: iBackgroundColorString,
			pageType: iPageType,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent,
			startPage: iStartPageUrl
		}
	);
	replaceHtmlWithFlash(iElementId, idName, true);		
}

function replaceHeader(iElementId, iTextSize, iTextColorString) {
	switch(gTewonderGlobalFunctions["getUsedProgramIdName"]()) {
		case "ie":
		case "fx":
		case "sa":
			//MENOTE: do nothing
			break;
		default:
			return;
	}
	
	if(iTextSize == undefined) {
		iTextSize = 32;
	}
	if(iTextColorString == undefined) {
		iTextColorString = "#000000";
	}
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		"flash/headerTextReplacement.swf",
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: "#FFFFFF"},
		{},
		{
			textSize: iTextSize,
			textColor: iTextColorString,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent
		}
	);
	var theElement = document.getElementById(iElementId);
	replaceHtmlWithFlash(iElementId, idName, true);
}

function replacePushText(iElementId, iLinkUrl, iTextAlign, iHeaderTextSize, iBodyTextSize, iTextColorString) {
	switch(gTewonderGlobalFunctions["getUsedProgramIdName"]()) {
		case "ie":
		case "fx":
		case "sa":
			//MENOTE: do nothing
			break;
		default:
			return;
	}
	
	if(iTextAlign == undefined) {
		 iTextAlign = "center";
	}
	if(iHeaderTextSize == undefined) {
		iHeaderTextSize = 14;
	}
	if(iBodyTextSize == undefined) {
		iBodyTextSize = 12;
	}

	if(iTextColorString == undefined) {
		iTextColorString = "#000000";
	}
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		"flash/pushTextReplacement.swf",
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: "#FFFFFF"},
		{},
		{
			linkUrl: iLinkUrl,
			textAlign: iTextAlign,
			headerTextSize: iHeaderTextSize,
			bodyTextSize: iBodyTextSize,
			textColor: iTextColorString,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent
		}
	);
	replaceHtmlWithFlash(iElementId, idName, true);
}

function replaceProductPushText(iElementId, iLinkUrl, iTextAlign, iTextSize, iTextColorString) {
	switch(gTewonderGlobalFunctions["getUsedProgramIdName"]()) {
		case "ie":
		case "fx":
		case "sa":
			//MENOTE: do nothing
			break;
		default:
			return;
	}
	
	if(iTextAlign == undefined) {
		 iTextAlign = "center";
	}
	if(iTextSize == undefined) {
		iTextSize = 14;
	}
	if(iTextColorString == undefined) {
		iTextColorString = "#000000";
	}
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		"flash/productPushTextReplacement.swf",
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: "#FFFFFF"},
		{},
		{
			linkUrl: iLinkUrl,
			textAlign: iTextAlign,
			textSize: iTextSize,
			textColor: iTextColorString,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent
		}
	);
	replaceHtmlWithFlash(iElementId, idName, true);
}

function replacePush(iElementId, iFilePath, iLinkUrl, iExtraText1, iExtraText2) {
	switch(gTewonderGlobalFunctions["getUsedProgramIdName"]()) {
		case "ie":
		case "fx":
		case "sa":
			//MENOTE: do nothing
			break;
		default:
			return;
	}

	if(iExtraText1 == undefined) {
		iExtraText1 = "";
	}
	if(iExtraText2 == undefined) {
		iExtraText2 = "";
	}
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		"flash/pushLoader.swf",
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: "#FFFFFF"},
		{},
		{
			filePath: iFilePath,
			linkUrl: iLinkUrl,
			extraText1: iExtraText1,
			extraText2: iExtraText2,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent
		}
	);
	replaceHtmlWithFlash(iElementId, idName, true);	
}

function addFlashPageContent(iElementId, iFilePath, iSecondaryFilePath, iCountry, iLanguage, iBackgroundColorString) {
	var filePath;
	var lastSearchIndex;
	if(iFilePath.indexOf("?") != -1) {
		lastSearchIndex = iFilePath.indexOf("?");
	}
	else {
		lastSearchIndex = iFilePath.length;
	}
	var searchString = iFilePath.substring(0, lastSearchIndex);
	var flvIndex = searchString.lastIndexOf(".flv");
	if((flvIndex != -1) && (flvIndex == searchString.length-4)) {
		filePath = "flash/videoPlayer.swf";	
	}
	else {
		filePath = "flash/contentLoader.swf";
	}
	var idName = gTewonderGlobalObjects["idManager"].getIdName("flashObject");
	addFlashDataObject(
		idName,
		filePath,
		{width: "100%", height: "100%", version: "8.0.0", backgroundColor: iBackgroundColorString},
		{country: iCountry, language: iLanguage},
		{
			filePath: iFilePath,
			secondaryFilePath: iSecondaryFilePath,
			backgroundColor: iBackgroundColorString,
			currentProgram: gTewonderGlobalFunctions["getUsedProgramIdName"](),
			currentPage: document.location.href,
			userAgent: navigator.userAgent
		}
	);
	
	replaceHtmlWithFlash(iElementId, idName, true);
}