			function main() {
				/*
				*	Función Main()
				*	Alcance global 
				*	Llamada en el onload del cuerpo
				* 	Sirve para asociar en el menú desplegable las funciones correspondientes al
				*	onmouseover, onmouseout y onclick
				*/
				init();	
				var TDs=new Array();	
				TDs=document.getElementById("menuSecciones").getElementsByTagName("td");

				//	TDs (colección, alcance privado): celdas que contienen las opciones.
				//	En el siguiente bucle las recorremos. Si son las celdas que nos interesan 
				//	(aquellas cuyo className es "opcionMenuSecciones") les asignamos los 
				//	enventos correspondientes como metodos de los objetos td.

				for (var i=0; i<TDs.length;i++) {
					if (TDs[i].className=="opcionMenuSecciones") {
						TDs[i].onmouseover=CeldaOpcionesOnMouseOver;
						TDs[i].onmouseout=CeldaOpcionesOnMouseOut;
					}
				}

				var DIVs=document.getElementById("menuSecciones").getElementsByTagName("div");

				//	DIVs (colección, alcance privado): Capas que contienen los elementos
				//	En el siguiente bucle, se busca la imagen y se hace que al pulsarse 
				//	se muestre o esconda los elementos de su interior asignandole 
				//	la función correspondiente como método de img
				
				for (var i=0; i<DIVs.length; i++) {
					if (DIVs[i].getElementsByTagName("img").length>0 && DIVs[i].getElementsByTagName("img")[0].getAttribute("src").indexOf("seccion")!=-1) {
						DIVs[i].getElementsByTagName("img")[0].onclick=elementoMenuSeccionesOnClick;
						DIVs[i].getElementsByTagName("img")[0].style.cursor="hand";
					}
				}
			}

			function VentanaPU(ventana,ruta) {
			
				var ie = (navigator.appName.indexOf("Explorer") > -1) ? true : false;

				var centerX = screen.availWidth / 2;
				var centerY = screen.availHeight / 2;

				var venueWinLeft = parseInt(centerX - (650/2)) ;
				var venueWinTop = parseInt(centerY - (427/2)) ;

				if (ie) {
					var innerWidth = document.body.clientWidth;
					var innerHeight = document.body.clientHeight;
				} else {
					var innerWidth = window.innerWidth;
					var innerHeight = window.innerHeight;
				}

				window.open( ruta + 'Modelo06C.asp?CodPag='+ ventana ,'','scrollbars=yes, width=510,height=400');				
				
			}
			
			
			function CeldaOpcionesOnMouseOver() {
				//this.style.backgroundColor='#840002';
				this.style.color="#FFAE00";
			}
			function CeldaOpcionesOnMouseOut() {
				//this.style.backgroundColor='transparent';
				this.style.color="white";
			}
			function elementoMenuSeccionesOnClick() {
				if (this.nextSibling && this.nextSibling.className=="OpcionesElemento") {
					if (this.nextSibling.style.display=="none") {
						var DIVsOpciones=this.parentElement.parentElement.getElementsByTagName("div");
						for (var i=0; i<DIVsOpciones.length; i++) {
							if (DIVsOpciones[i].className=="OpcionesElemento") {
								DIVsOpciones[i].style.display="none";
							}
						}
						this.nextSibling.style.display="block";
					} else {
						this.nextSibling.style.display="none"
					}
				}
			}
			
			function init() {
				//Función que da comienzo al ticker de noticias
				if (document.getElementById("noticiasTicker"))
				ticker.activate()
			}

			function menuDesplegable(donde) {
				var TRs=donde.parentNode.getElementsByTagName("tr");
				for (var i=0;i<TRs.length; i++) {
					if (TRs[i].className=="desplegable" && TRs[i]!=donde.nextSibling) {
						TRs[i].style.display="none";	
					}
				}
				if (donde.nextSibling.style.display=="none")
				donde.nextSibling.style.display="block";
				else 
				donde.nextSibling.style.display="none";
			}
			function despliega3Nivel(cual) {
				var hid=cual.nextSibling.style.display;
				var TRs=cual.parentElement.getElementsByTagName("tr");
				for (var i=0; i<TRs.length; i++) {
					if (TRs[i].className=="desplegableNivel3") TRs[i].style.display="none";
				}
				recorre(cual,hid);
			}
			function recorre(cual,hid) {
				if (cual.nextSibling) {
					if (cual.nextSibling.className=="desplegableNivel3") {
						cual.nextSibling.style.display=(hid=="none")?"block":"none";
						recorre(cual.nextSibling,hid)
					}
				}
			}
			
			window.onload=main;
			
function ActionBuscar()
{
	if (trim(window.document.frmBuscador.palabrasClave.value) != "")
	{
		window.document.frmBuscador.action = "../Buscador/Buscador.asp?PalabraBusqueda=" + trim(window.document.frmBuscador.palabrasClave.value);
		window.document.frmBuscador.submit();
	}
}

function trim(strText) { 
    // Eliminamos espacios por la izquierda
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // Eliminamos espacios por la derecha
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 

/*-------------------------------------------------------------------------------
| Nombre		: EsEmail														|
| Descripción	: Comprueba si la cadena recibida es una direcc. de mail válida	|
--------------------------------------------------------------------------------*/

function EsEmail(string) 
{
	// Comprueba que la estructura de la cadena corresponda a la de una dirección de email
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

/*-------------------------------------------------------------------------------
| Nombre		: replace														|
| Descripción	: Comprueba si la cadena recibida es una direcc. de mail válida	|
--------------------------------------------------------------------------------*/

function replace(string,text,by) {
	// Reemplaza en la cadena string, la cadena text por by
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

/*-------------------------------------------------------------------------------
| Nombre		: EntrarUsuario													|
| Descripción	: Control de la entrada en el menú	
--------------------------------------------------------------------------------*/

function EntrarUsuario()
{
	if (document.LoginIn.tipoUsu.selectedIndex==0)
		document.LoginIn.action = "../cmes.asp?CodPag=MedioComunicacion&ccsForm=Login%3AEdit";
	else
		document.LoginIn.action = "../cmes.asp?ccsForm=Login%3AEdit";
	document.LoginIn.submit();
}

/*-------------------------------------------------------------------------------
| Nombre		: RegistrarUsuario												|
| Descripción	: Abre ventana de registro en el menú	
--------------------------------------------------------------------------------*/

function RegistrarUsuario()
{
	window.open('../Home/no_registrado.asp','','scrollbars=yes,width=510,height=420');
}
