ns = (document.layers)? true : false;
ie = (document.all)? true: false;

	function donothing() {
	}

	function enviar(f) {
		f.submit();
	}

	function getIndex(obj, valor) {
		for (i = 0; i <= obj.options.length; i++) {
			if (obj.options[i].value == valor) {
				return i;
			}
		}
		return 0;
	}

	function mostrar(cadena) {
		window.location = cadena;
	}

	function abrir(cadena) {
		window.open(cadena, "", "width=800,height=600,resizable=yes,scrollbars=yes, toolbar=yes");
	}
	
	function mostrarCapa(nombreCapa){ 
		if(ns) {
			x = event.pageX;
			y = event.pageY;
		}
		if(ie) {
			x = window.event.clientX;
			y = window.event.clientY;
		}
		document.getElementById(nombreCapa).style.left = x+20; 
		document.getElementById(nombreCapa).style.top = y; 
		document.getElementById(nombreCapa).style.visibility="visible"; 
	} 
	function mostrarCapa2(nombreCapa){
		document.getElementById(nombreCapa).style.height = 'auto';
		document.getElementById(nombreCapa).style.visibility="visible";	
		document.getElementById(nombreCapa).style.display="block";	
	}
	
	function ocultarCapa(nombreCapa){ 
		document.getElementById(nombreCapa).style.height = '0';
		document.getElementById(nombreCapa).style.visibility="hidden";
		document.getElementById(nombreCapa).style.display="none";	
	}
	 
	function cambiarCapa(nombreCapa) {
		if(document.getElementById(nombreCapa).style.visibility == 'visible')
			ocultarCapa(nombreCapa);
		else
			mostrarCapa2(nombreCapa);
	}
	
	function atras(){
		history.go(-1);
	}
	
	function adelante(){
		history.go(1);
	}
	
	function cambiarFondo(theClass, value) {
		var cssRules;
		if (document.all) {
			cssRules = 'rules';
		} else if (document.getElementById) {
			cssRules = 'cssRules';
		}
		for (var S = 0; S < document.styleSheets.length; S++){
			for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
				if (document.styleSheets[S][cssRules][R].selectorText!= null && document.styleSheets[S][cssRules][R].selectorText.toUpperCase() == theClass.toUpperCase()) {
					document.styleSheets[S][cssRules][R].style.backgroundColor = value;
				}
			}
		}
	}
	
	function marcarBoja() {
		cambiarFondo('div.normativaBoja', '#b1c2c2');
		cambiarFondo('div.normativaBoe', '#ffffff');
		cambiarFondo('div.normativaDoce', '#ffffff');

		cambiarFondo('div.normativaBojaMarcada', '#b1c2c2');
		cambiarFondo('div.normativaBoeMarcada', '#dfe6e6');
		cambiarFondo('div.normativaDoceMarcada', '#dfe6e6');
	}
	
	function marcarBoe() {
		cambiarFondo('div.normativaBoja', '#ffffff');
		cambiarFondo('div.normativaBoe', '#b1c2c2');
		cambiarFondo('div.normativaDoce', '#ffffff');

		cambiarFondo('div.normativaBojaMarcada', '#dfe6e6');
		cambiarFondo('div.normativaBoeMarcada', '#b1c2c2');
		cambiarFondo('div.normativaDoceMarcada', '#dfe6e6');
	}
	
	function marcarDoce() {
		cambiarFondo('div.normativaBoja', '#ffffff');
		cambiarFondo('div.normativaBoe', '#ffffff');
		cambiarFondo('div.normativaDoce', '#b1c2c2');

		cambiarFondo('div.normativaBojaMarcada', '#dfe6e6');
		cambiarFondo('div.normativaBoeMarcada', '#dfe6e6');
		cambiarFondo('div.normativaDoceMarcada', '#b1c2c2');
	}
	
	function desmarcarTodos() {
		cambiarFondo('div.normativaBoja', '#ffffff');
		cambiarFondo('div.normativaBoe', '#ffffff');
		cambiarFondo('div.normativaDoce', '#ffffff');

		cambiarFondo('div.normativaBojaMarcada', '#dfe6e6');
		cambiarFondo('div.normativaBoeMarcada', '#dfe6e6');
		cambiarFondo('div.normativaDoceMarcada', '#dfe6e6');
	}
	
	function cambiarAmbito() {
		if(document.getElementById("ambito").options[document.getElementById("ambito").selectedIndex].value==0)
			desmarcarTodos();
		if(document.getElementById("ambito").options[document.getElementById("ambito").selectedIndex].value==175)
			marcarDoce();
		if(document.getElementById("ambito").options[document.getElementById("ambito").selectedIndex].value==176)
			marcarBoe();
		if(document.getElementById("ambito").options[document.getElementById("ambito").selectedIndex].value==178)
			marcarBoja();
	}			
	
	
	function getFlashMovieObject(movieName) {
	  if (window.document[movieName]) 
	  {
	      return window.document[movieName];
	  }
	  if (navigator.appName.indexOf("Microsoft Internet")==-1)
	  {
	    if (document.embeds && document.embeds[movieName])
	      return document.embeds[movieName]; 
	  }
	  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
	  {
	    return document.getElementById(movieName);
	  }
	}

	function cambiar(movie, variable, valor) {
		var flashMovie=getFlashMovieObject(movie);
	    flashMovie.SetVariable(variable, valor);
	}
	


