
/*cargar SWF */
var id_youtube = "";
var params = {
	quality: "high",
	scale: "noscale",
	wmode: "window",
	allowscriptaccess: "always",
	bgcolor: "#FFFFF"
};

var flashvars = {
	siteXML: "xml/site.xml"
};

var attributes = {
	id: "flashcontent",
	name: "flashcontent"
};
var min_width = 900;
var min_height = 600;

function getViewportSize() { 
	var size = [0, 0]; 
	if (typeof window.innerWidth != "undefined") { 
		size = [window.innerWidth, window.innerHeight];
	} 
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
	}
	else {
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
	}
	return size; 
}
function createFullBrowserFlash() {
	swfobject.createCSS("html", "height:100%;");
	swfobject.createCSS("body", "height:100%;");
	swfobject.createCSS("#alternateContent", "margin:0; width:100%; height:100%; min-width:"+min_width+"px; min-height:"+min_height+"px; top:0px; left:0px;");
	window.onresize = function(){
		var el = document.getElementById("flashcontent");
		var size = getViewportSize();
		el.style.width = size[0] < min_width ? min_width+"px" : "100%";
		el.style.height = size[1] < min_height ? min_height+"px" : "100%";
	};
	window.onresize();
}	




function embed_gaia_main()
{
	swfobject.embedSWF("main.swf", "flashcontent", "100%", "100%", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
	if (swfobject.hasFlashPlayerVersion("9.0.0")) {
		swfobject.addDomLoadEvent(createFullBrowserFlash);
	}
}

function embed_liquid_swf(ruta, $min_width, $min_height)
{
	if($min_width)
	{
		min_width = $min_width;
		min_height = $min_height;
	}
	swfobject.embedSWF(ruta, "flashcontent", "100%", "100%", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
	if (swfobject.hasFlashPlayerVersion("9.0.0")) {
		swfobject.addDomLoadEvent(createFullBrowserFlash);
	}
}

function embed_swf(ruta, width, height, flashvars, params, attributes)
{
	swfobject.embedSWF(ruta, "flashcontent", width, height, "10.0.0", "expressInstall.swf", flashvars, params, attributes);
}
function embedYoutubePlayer() {
    
    var videoID = id_youtube;
    var params = { allowScriptAccess: "always" };
    var atts = { id: "ytPlayer" };

    swfobject.embedSWF("http://www.youtube.com/v/" + videoID + "&enablejsapi=1&playerapiid=player1", 
                       "videoDiv", "379", "293", "8", null, null, params, atts);
  }

