// dummy js functions to stop errors from the DIMG framework
function hideAdPanels() {}
function addAdPanel() {}
function addAdTracking() {}
function changeBackgroundColor() {}
function setWmode() {}
function getWmode() {}
function resizeDXD() {}
function scrollToTop() {}

//fix for missing console functions when firebug is not present...
window["console"] = {log:function(value){}, error:function(value){}, info:function(value){}, warn:function(value){}};

function embedBroadBandPlayer(host,lang) {
	//should the firebug log be visible?
	var hasDebugParam = window.location.href.indexOf("debug")>0;
	var isDevPlatform = (host.indexOf("dev.")>=0)||(host.indexOf("localhost.")>=0)
	var debug = (hasDebugParam||isDevPlatform)?"true":"false";

	//select the correct config
	var configURL = escape("data/config."+lang+".xml");

	var flashVars="xmlPath=/DisneyChannel/binary/cd_dvd/cd_dvd.xml&imagePath=/DisneyChannel/binary/cd_dvd/&";

	var fvars = false;
	var flashparams = {
		menu: "false",
		scale: "noscale",
		menu: "false",
		quality: "best",
		salign: "tl",
		base: ".",
		align: "t",
		bgcolor: "#000000",
		flashVars: flashVars,
		allowFullScreen: "true",
		wmode : "transparent",
		allowScriptAccess: "always"
	};

	var attributes = {id: "flashcontent", name:"flashcontent"};
	swfobject.embedSWF("swf/news_cd_dvd.swf", "flashcontent", "974", "700", "9.0.115","", fvars, flashparams, attributes);
}

function makeSynergyNavTransparent() {
// find embed tags within the chrome holder
   	var embeds = document.getElementById('chrome-holder').getElementsByTagName("embed");
	if (embeds.length > 0){
		var embed = embeds[0];
		embed.wmode = 'transparent';
		embed.setAttribute("wmode", "transparent");
		var parent = embed.parentNode;
		var sister = embed.nextSibling;
		parent.removeChild(embed);
		parent.insertBefore(embed, sister);

	}

    // find object tags within the chrome holder
   	var objects = document.getElementById('chrome-holder').getElementsByTagName("object");
	if (objects.length > 0){
		object = objects[0];
		object.wmode = 'transparent';
		var params = object.getElementsByTagName("param");
		for (i=0; i<params.length; i++){
			if (params[i].name.toLowerCase() == "wmode"){
				params[i].value = "transparent";
			}
		}

		var parent = object.parentNode;
		var sister = object.nextSibling;
		parent.removeChild(object);
		parent.insertBefore(object, sister);
	}
}