// JavaScript Document

function flashMovie(name){
	if(navigator.appName.indexOf("Microsoft") != -1){
		return window[name];
	}else{
		return document[name];
	}
}
function callASfunction(rutaXML){					
		rutaXML='http://multimedia.lacaixa.es/lacaixa/ondemand/obrasocial/video/config/programa/'+rutaXML+'.xml';
		flashMovie('flashcontent').changeXML(rutaXML);
		flashOn = false;	
}

var flashOn = false;

function resizeDivFlash(ancho, alto){
	if (flashOn ==false){
		flashOn = true;
		leftNuevo = (ancho - 570)/2;
		$('#header').append("<div id='fondo' class='transparent'></div>");
		alto= alto-1+35;
		$("#playerPrograma").animate({
			"margin-left": "-" + leftNuevo + "px",
			width: ancho+"px",
			height: alto+"px" 
			}, 1000, "" , "" );
		$('#flashcontent').attr("wmode", 'transparent');		
	}else{
		if (flashOn == true){
				flashOn = false;
				var navegador = navigator.appName
				if (navegador == "Microsoft Internet Explorer"){
					anchoDiv= "570px";
					altoDiv = "200px"
				}else{
					anchoDiv= "568px";
					altoDiv = "198px"					
				}
				$("#playerPrograma").animate({
					"margin-left": "0",
					width: anchoDiv,
					height: altoDiv 
				}, 1000, "" , "" );
				$("#fondo").remove();
				
		}
	}
}
