/////////////////////////////////////
function AniadirFavoritos() {
 window.external.AddFavorite("http://www.ayto-fuenlabrada.es", "Ayuntamiento de Fuenlabrada");
}
/////////////////////////////////////
function imprimir(){
	window.print();
}
/////////////////////////////////////
function irA(idMenu,idRecurso) {
 if (idRecurso==0) {
  location.href="index.do";
 } else {
  var direccion="index.do?MP="+idMenu;
  location.href=direccion;
 }
}
/////////////////////////////////////
function volver() {
 history.back(-1);
}

function vaciar(esto) {
	esto.value="";
}

function ActivexOn(){
		var xmlDoc;
		
		try{
			xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		}
		catch(e){
			try{xmlDoc=document.implementation.createDocument("","",null);}
			catch(e){}
		}
		
		if(xmlDoc){
			return true;
		}else{
			return false;
		}
}

function escribirMultimedia(sRuta,sRutaVideo,sAncho,sAlto, sCampo) {

	//sRuta = "/inc/multimedia/reproductor_video.swf";	
			
	if(navigator.appName=="Microsoft Internet Explorer") {
		var sGenerado = '<object type="application/x-shockwave-flash" width="' + sAncho + '"  height="' + sAlto + '" >';
	} else {
		var sGenerado = '<object type="application/x-shockwave-flash" data="' + sRuta + '" width="' + sAncho + '"  height="' + sAlto + '" >';
	}

	sGenerado += '<param name="movie" value="' + sRuta + '" />';
	sGenerado += '<param name="allowScriptAccess" value="sameDomain" />';
	sGenerado += '<param name="quality" value="high" />';
	sGenerado += '<param name="bgcolor" value="#000000" />';
	sGenerado += '<param name="flashVars" value="' + sRutaVideo + '&idioma=es" />';

	sGenerado += '</object>';

	// Validamos que esté activado el activex
	var bActiveX = ActivexOn();
	document.getElementById(sCampo).style.display = 'block';
	if (bActiveX) document.getElementById(sCampo).innerHTML = sGenerado;

}
