// TIENDA
var TIE_estilo_Nivel0=new Array("TIE_MenuNivel0_OUT","TIE_MenuNivel0_OVER","TIE_MenuNivel0_ACTIVO","TIE_MenuNivel0_OUT2","TIE_MenuNivel0_OVER2");
var TIE_estilo_Nivel1=new Array("TIE_MenuNivel1_OUT","TIE_MenuNivel1_OVER","TIE_MenuNivel1_ACTIVO","TIE_MenuNivel1_OUT2","TIE_MenuNivel1_OVER2");
var TIE_estilo_Nivel2=new Array("TIE_MenuNivel2_OUT","TIE_MenuNivel2_OVER","TIE_MenuNivel2_ACTIVO","TIE_MenuNivel2_OUT2","TIE_MenuNivel2_OVER2");
var TIE_estilo_Nivel3=new Array("TIE_MenuNivel3_OUT","TIE_MenuNivel3_OVER","TIE_MenuNivel3_ACTIVO","TIE_MenuNivel3_OUT2","TIE_MenuNivel3_OVER2");
var TIE_estilo_Nivel4=new Array("TIE_MenuNivel4_OUT","TIE_MenuNivel4_OVER","TIE_MenuNivel4_ACTIVO","TIE_MenuNivel4_OUT2","TIE_MenuNivel4_OVER2");
var TIE_estilo_Nivel5=new Array("TIE_MenuNivel5_OUT","TIE_MenuNivel5_OVER","TIE_MenuNivel5_ACTIVO","TIE_MenuNivel5_OUT2","TIE_MenuNivel5_OVER2");
var TIE_estilo_Nivel6=new Array("TIE_MenuNivel6_OUT","TIE_MenuNivel6_OVER","TIE_MenuNivel6_ACTIVO","TIE_MenuNivel6_OUT2","TIE_MenuNivel6_OVER2");
var TIE_estilo_Nivel7=new Array("TIE_MenuNivel7_OUT","TIE_MenuNivel7_OVER","TIE_MenuNivel7_ACTIVO","TIE_MenuNivel7_OUT2","TIE_MenuNivel7_OVER2");

var TIE_gruposEstilo=new Array(TIE_estilo_Nivel0,TIE_estilo_Nivel1,TIE_estilo_Nivel2,TIE_estilo_Nivel3,TIE_estilo_Nivel4,TIE_estilo_Nivel5,TIE_estilo_Nivel6,TIE_estilo_Nivel7);

// WEB
var estilo_Nivel0=new Array("WEB_MenuNivel0_OUT","WEB_MenuNivel0_OVER","WEB_MenuNivel0_ACTIVO","WEB_MenuNivel0_OUT2","WEB_MenuNivel0_OVER2");
var estilo_Nivel1=new Array("WEB_MenuNivel1_OUT","WEB_MenuNivel1_OVER","WEB_MenuNivel1_ACTIVO","WEB_MenuNivel1_OUT2","WEB_MenuNivel1_OVER2");
var estilo_Nivel2=new Array("WEB_MenuNivel2_OUT","WEB_MenuNivel2_OVER","WEB_MenuNivel2_ACTIVO","WEB_MenuNivel2_OUT2","WEB_MenuNivel2_OVER2");
var estilo_Nivel3=new Array("WEB_MenuNivel3_OUT","WEB_MenuNivel3_OVER","WEB_MenuNivel3_ACTIVO","WEB_MenuNivel3_OUT2","WEB_MenuNivel3_OVER2");
var estilo_Nivel4=new Array("WEB_MenuNivel4_OUT","WEB_MenuNivel4_OVER","WEB_MenuNivel4_ACTIVO","WEB_MenuNivel4_OUT2","WEB_MenuNivel4_OVER2");
var estilo_Nivel5=new Array("WEB_MenuNivel5_OUT","WEB_MenuNivel5_OVER","WEB_MenuNivel5_ACTIVO","WEB_MenuNivel5_OUT2","WEB_MenuNivel5_OVER2");
var estilo_Nivel6=new Array("WEB_MenuNivel6_OUT","WEB_MenuNivel6_OVER","WEB_MenuNivel6_ACTIVO","WEB_MenuNivel6_OUT2","WEB_MenuNivel6_OVER2");
var estilo_Nivel7=new Array("WEB_MenuNivel7_OUT","WEB_MenuNivel7_OVER","WEB_MenuNivel7_ACTIVO","WEB_MenuNivel7_OUT2","WEB_MenuNivel7_OVER2");

var gruposEstilo=new Array(estilo_Nivel0,estilo_Nivel1,estilo_Nivel2,estilo_Nivel3,estilo_Nivel4,estilo_Nivel5,estilo_Nivel6,estilo_Nivel7);

function cambiarDisplay(div,numID,nivel_estilo) 
{
//            alert(div.getAttribute('id')+'::'+numID+'::'+nivel_estilo);
    var id=div.getAttribute('id');
    if (!document.getElementById) return false;
    fila = document.getElementById(numID);
    filaActiva = document.getElementById(id);
    if(fila!=null){ 
        if (fila.style.display != "none") {
            fila.style.display = "none"; //ocultar div
            div.className=gruposEstilo[nivel_estilo][0];
            filaActiva.onmouseout=function(){
	            this.className=gruposEstilo[nivel_estilo][0];
            }
            filaActiva.onmouseover=function(){
	            this.className=gruposEstilo[nivel_estilo][1];
            }
        } else {
            fila.style.display = ""; //mostrar div
            div.className=gruposEstilo[nivel_estilo][2];
            filaActiva.onmouseout=function(){
	            this.className=gruposEstilo[nivel_estilo][2];
            }
            filaActiva.onmouseover=function(){
	            this.className=gruposEstilo[nivel_estilo][2];
            }
        }
    } else {
        div.className=gruposEstilo[nivel_estilo][4];
        filaActiva.onmouseout=function(){
            this.className=gruposEstilo[nivel_estilo][4];
        }
        filaActiva.onmouseover=function(){
            this.className=gruposEstilo[nivel_estilo][4];
        } 
    }                
}

function validarRecomendar() 
{	
    hayvalidacion=true;
    document.forms[0].txt_Nombre.value = trim(document.forms[0].txt_Nombre.value);
	document.forms[0].txt_Email.value = trim(document.forms[0].txt_Email.value);
	document.forms[0].txt_NombreAmigo.value = trim(document.forms[0].txt_NombreAmigo.value);
	document.forms[0].txt_EmailAmigo.value = trim(document.forms[0].txt_EmailAmigo.value);
	document.forms[0].avstr_Captcha.value = trim(document.forms[0].avstr_Captcha.value.toLowerCase());

	if (noVacio(document.forms[0].txt_Nombre) == false) {
		alert("Ingrese un nombre por favor!!");
		document.forms[0].txt_Nombre.focus();
		return false;
	}

	if(esEmail(document.forms[0].txt_Email) == false){
		alert("Ingrese un email correcto por favor!!");
		document.forms[0].txt_Email.focus();
		return false;
	}
	
	if (noVacio(document.forms[0].txt_NombreAmigo) == false) {
		alert("Ingrese el nombre de su amigo por favor!!");
		document.forms[0].txt_NombreAmigo.focus();
		return false;
	}
	
	if(esEmail(document.forms[0].txt_EmailAmigo) == false){
		alert("Ingrese el email correcto de su amigo por favor!!");
		document.forms[0].txt_EmailAmigo.focus();
		return false;
	}	
	
	if(noVacio(document.forms[0].avstr_Captcha) == false){
		alert("Ingrese el codigo que se muestra en la imagen correctamente!!");
		document.forms[0].avstr_Captcha.focus();
		return false;
	}	

    var textoCaptcha=window.frames.ifr_Captcha.document.getElementById('captcha_hid_TextoCaptcha').value;
    if(document.forms[0].avstr_Captcha.value!=textoCaptcha){
		alert("No coinciden los caracteres ingresados!!");
		document.forms[0].avstr_Captcha.focus();
		return false;
    }

    return true;
}

function Eventos(div,nivel_estilo,estado)
{
    div.className=gruposEstilo[nivel_estilo][estado];
}

function EnlaceMenuPricipal(url,target)
{
    target=target.toLowerCase();
    if(target=='_blank')window.open(url);
    if(target=='_self')self.location.href=url;
    if(target=='_top')top.location.href=url;
    if(target=='_parent')parent.location.href=url;
}

function ExpandTreeMagic(variable) 
{
    try 
    {
        var regexS = "[\\?&]"+variable+"=([^&#]*)";
        var valor="";
        var regex = new RegExp( regexS );
        var tmpURL = window.location.href;
        var results = regex.exec( tmpURL.toUpperCase());
        if( results == null )
            valor="";
        else
            valor="jsJerarquia"+results[1];
            
        var classnamejer;
        if (document.getElementById) 
        {
            e=document.getElementById(valor);
            if(e!=null)
            {		   
                classnamejer=e.className;
                //alert(classnamejer);
                if(classnamejer=='WEB_MenuNivel0_OUT'||classnamejer=='WEB_MenuNivel0_OUT2')
                {
                    //alert(e.className);  
                    e.className="WEB_MenuNivel0_OVER2";
                    cambiarDisplay(e,'WEB_N1_'+e.getAttribute('id').substring(11),0);
                }
                if(classnamejer=='WEB_MenuNivel1_OUT'||classnamejer=='WEB_MenuNivel1_OUT2')
                {
                    var id_nivel0=e.parentNode.getAttribute('id').substring(7);
                    var div=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div!=null)
                    {
                        cambiarDisplay(div,'WEB_N1_'+id_nivel0,0);
                        cambiarDisplay(e,'WEB_N2_'+e.getAttribute('id').substring(11),1);
                    }
                }
                if(classnamejer=='WEB_MenuNivel2_OUT'||classnamejer=='WEB_MenuNivel2_OUT2')
                {
                    var id_nivel0=e.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            cambiarDisplay(e,'WEB_N3_'+e.getAttribute('id').substring(11),2);
                        }
                    }
                }
                if(classnamejer=='WEB_MenuNivel3_OUT'||classnamejer=='WEB_MenuNivel3_OUT2')
                {
                    var id_nivel0=e.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            var id_nivel2=e.parentNode.getAttribute('id').substring(7);
                            var div_nivel2=document.getElementById('jsJerarquia'+id_nivel2);
                            if(div_nivel2!=null)
                            {
                                cambiarDisplay(div_nivel2,'WEB_N3_'+id_nivel2,2);                                        
                                cambiarDisplay(e,'WEB_N4_'+e.getAttribute('id').substring(11),3);                                        
                            }
                        }
                    }
                }
                if(classnamejer=='WEB_MenuNivel4_OUT'||classnamejer=='WEB_MenuNivel4_OUT2')
                {
                    var id_nivel0=e.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            var id_nivel2=e.parentNode.parentNode.getAttribute('id').substring(7);
                            var div_nivel2=document.getElementById('jsJerarquia'+id_nivel2);
                            if(div_nivel2!=null)
                            {
                                cambiarDisplay(div_nivel2,'WEB_N3_'+id_nivel2,2);                                        
                                var id_nivel3=e.parentNode.getAttribute('id').substring(7);
                                var div_nivel3=document.getElementById('jsJerarquia'+id_nivel3);
                                if(div_nivel3!=null)
                                {
                                    cambiarDisplay(div_nivel3,'WEB_N4_'+id_nivel3,3);                                        
                                    cambiarDisplay(e,'WEB_N5_'+e.getAttribute('id').substring(11),4);
                                }                                        
                            }
                        }
                    }
                }
                if(classnamejer=='WEB_MenuNivel5_OUT'||classnamejer=='WEB_MenuNivel5_OUT2')
                {
                    var id_nivel0=e.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            var id_nivel2=e.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                            var div_nivel2=document.getElementById('jsJerarquia'+id_nivel2);
                            if(div_nivel2!=null)
                            {
                                cambiarDisplay(div_nivel2,'WEB_N3_'+id_nivel2,2);                                        
                                var id_nivel3=e.parentNode.parentNode.getAttribute('id').substring(7);
                                var div_nivel3=document.getElementById('jsJerarquia'+id_nivel3);
                                if(div_nivel3!=null)
                                {
                                    cambiarDisplay(div_nivel3,'WEB_N4_'+id_nivel3,3);                                        
                                    var id_nivel4=e.parentNode.getAttribute('id').substring(7);
                                    var div_nivel4=document.getElementById('jsJerarquia'+id_nivel4);
                                    if(div_nivel4!=null)
                                    {
                                        cambiarDisplay(div_nivel4,'WEB_N5_'+id_nivel4,4);                                        
                                        cambiarDisplay(e,'WEB_N6_'+e.getAttribute('id').substring(11),5);
                                    }
                                    
                                }
                            }
                        }
                    }
                }
                if(classnamejer=='WEB_MenuNivel6_OUT'||classnamejer=='WEB_MenuNivel6_OUT2')
                {
                    var id_nivel0=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            var id_nivel2=e.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                            var div_nivel2=document.getElementById('jsJerarquia'+id_nivel2);
                            if(div_nivel2!=null)
                            {
                                cambiarDisplay(div_nivel2,'WEB_N3_'+id_nivel2,2);                                        
                                var id_nivel3=e.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                                var div_nivel3=document.getElementById('jsJerarquia'+id_nivel3);
                                if(div_nivel3!=null)
                                {
                                    cambiarDisplay(div_nivel3,'WEB_N4_'+id_nivel3,3);                                        
                                    var id_nivel4=e.parentNode.parentNode.getAttribute('id').substring(7);
                                    var div_nivel4=document.getElementById('jsJerarquia'+id_nivel4);
                                    if(div_nivel4!=null)
                                    {
                                        cambiarDisplay(div_nivel4,'WEB_N5_'+id_nivel4,4);                                        
                                        var id_nivel5=e.parentNode.getAttribute('id').substring(7);
                                        var div_nivel5=document.getElementById('jsJerarquia'+id_nivel5);
                                        if(div_nivel5!=null)
                                        {
                                            cambiarDisplay(div_nivel5,'WEB_N6_'+id_nivel5,5);                                        
                                            cambiarDisplay(e,'WEB_N7_'+e.getAttribute('id').substring(11),6);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if(classnamejer=='WEB_MenuNivel7_OUT'||classnamejer=='WEB_MenuNivel7_OUT2')
                {
//		                    alert(e.getAttribute('id'));
                    var id_nivel0=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                    var div_nivel0=document.getElementById('jsJerarquia'+id_nivel0);
                    if(div_nivel0!=null)
                    {
                        cambiarDisplay(div_nivel0,'WEB_N1_'+id_nivel0,0);
                        var id_nivel1=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                        var div_nivel1=document.getElementById('jsJerarquia'+id_nivel1);
                        if(div_nivel1!=null)
                        {
                            cambiarDisplay(div_nivel1,'WEB_N2_'+id_nivel1,1);
                            var id_nivel2=e.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                            var div_nivel2=document.getElementById('jsJerarquia'+id_nivel2);
                            if(div_nivel2!=null)
                            {
                                cambiarDisplay(div_nivel2,'WEB_N3_'+id_nivel2,2);                                        
                                var id_nivel3=e.parentNode.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                                var div_nivel3=document.getElementById('jsJerarquia'+id_nivel3);
                                if(div_nivel3!=null)
                                {
                                    cambiarDisplay(div_nivel3,'WEB_N4_'+id_nivel3,3);                                        
                                    var id_nivel4=e.parentNode.parentNode.parentNode.getAttribute('id').substring(7);
                                    var div_nivel4=document.getElementById('jsJerarquia'+id_nivel4);
                                    if(div_nivel4!=null)
                                    {
                                        cambiarDisplay(div_nivel4,'WEB_N5_'+id_nivel4,4);                                        
                                        var id_nivel5=e.parentNode.parentNode.getAttribute('id').substring(7);
                                        var div_nivel5=document.getElementById('jsJerarquia'+id_nivel5);
                                        if(div_nivel5!=null)
                                        {
                                            cambiarDisplay(div_nivel5,'WEB_N6_'+id_nivel5,5);                                        
                                            var id_nivel6=e.parentNode.getAttribute('id').substring(7);
                                            var div_nivel6=document.getElementById('jsJerarquia'+id_nivel6);
                                            if(div_nivel6!=null)
                                            {
                                                cambiarDisplay(div_nivel6,'WEB_N7_'+id_nivel6,6);                                        
                                                cambiarDisplay(e,'WEB_N8_'+e.getAttribute('id').substring(11),7);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                //.....
            }        		   
        } 
    } 
    catch(er) 
    {
        //alert(er.message);
    }
}


//******************************************************************************************************************
// ENCUESTAS
//******************************************************************************************************************

function ValidaEncuesta(obj_lista, encuesta)
{
    var ctrls=obj_lista.getElementsByTagName('input');
    var Selecciono=false;
	for(var i=0; i<ctrls.length; i++)
	{
		var temp = ctrls[i].type;
		if(((temp == "radio")) && (ctrls[i].checked)) { 
		    Selecciono=true;
		    break;
		}
	}
    
	if(!Selecciono){
	    alert('Seleccione una alternativa para votar la encuesta "'+ encuesta +'".');
	    return false;
    }

    return true;
}

//******************************************************************************************************************
// POSTALES
//******************************************************************************************************************
function ValidarPostal()
{
    theForm.ctl00_PortalPlaceHolder_txt_NombreRemitente.value=trim(theForm.ctl00_PortalPlaceHolder_txt_NombreRemitente.value);
    if (noVacio(theForm.ctl00_PortalPlaceHolder_txt_NombreRemitente) == false) {
	    alert('Por favor, ingrese el nombre del remitente.');
	    theForm.ctl00_PortalPlaceHolder_txt_NombreRemitente.focus();
	    return false;
	}
    theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente.value=trim(theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente.value);
    if (noVacio(theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente) == false) {
	    alert('Por favor, ingrese el e-mail del remitente.');
	    theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente.focus();
	    return false;
	}
    if (esEmail(theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente) == false) {
	    alert('Por favor, ingrese correctamente el e-mail del remitente.');
	    theForm.ctl00_PortalPlaceHolder_txt_EmailRemitente.focus();
	    return false;
	}
    theForm.ctl00_PortalPlaceHolder_txt_NombreDestinatario.value=trim(theForm.ctl00_PortalPlaceHolder_txt_NombreDestinatario.value);
    if (noVacio(theForm.ctl00_PortalPlaceHolder_txt_NombreDestinatario) == false) {
	    alert('Por favor, ingrese el nombre del destinatario.');
	    theForm.ctl00_PortalPlaceHolder_txt_NombreDestinatario.focus();
	    return false;
	}
    theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario.value=trim(theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario.value);
    if (noVacio(theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario) == false) {
	    alert('Por favor, ingrese el e-mail del destinatario.');
	    theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario.focus();
	    return false;
	}
    if (esEmail(theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario) == false) {
	    alert('Por favor, ingrese correctamente el e-mail del destinatario.');
	    theForm.ctl00_PortalPlaceHolder_txt_EmailDestinatario.focus();
	    return false;
	}
    theForm.ctl00_PortalPlaceHolder_txt_Mensaje.value=trim(theForm.ctl00_PortalPlaceHolder_txt_Mensaje.value);
    if (noVacio(theForm.ctl00_PortalPlaceHolder_txt_Mensaje) == false) {
	    alert('Por favor, ingrese el mensaje.');
	    theForm.ctl00_PortalPlaceHolder_txt_Mensaje.focus();
	    return false;
	}

    return true;
}

var facultadesMenuOff=new Array("","WEB_FacultadesMenuEnlace1","WEB_FacultadesMenuEnlace2","WEB_FacultadesMenuEnlace3","WEB_FacultadesMenuEnlace4","WEB_FacultadesMenuEnlace5","WEB_FacultadesMenuEnlace6","WEB_FacultadesMenuEnlace7","WEB_FacultadesMenuEnlace8","WEB_FacultadesMenuEnlace9","WEB_FacultadesMenuEnlace10");

var facultadesMenuOn=new Array("","WEB_FacultadesMenuEnlaceOver1","WEB_FacultadesMenuEnlaceOver2","WEB_FacultadesMenuEnlaceOver3","WEB_FacultadesMenuEnlaceOver4","WEB_FacultadesMenuEnlaceOver5","WEB_FacultadesMenuEnlaceOver6","WEB_FacultadesMenuEnlaceOver7","WEB_FacultadesMenuEnlaceOver8","WEB_FacultadesMenuEnlaceOver9","WEB_FacultadesMenuEnlaceOver10");

//var facultadesEnlaces=new Array("","/5/fac_hoteleria_turismo","/6/fac_arquitectura","/7/fac_ciencias_salud","/8/fac_ciencias_humanas","/9/fac_comunicacion","/10/fac_derecho","/11/fac_economia","/12/fac_estudios_empresa","/13/fac_ingenieria")

/* Menu Carreras facultades */
function EnlaceMenuOn(n)
{
	var fila = document.getElementById('WEB_Facultades'+n);
	var menu = document.getElementById('WEB_MenuEnlace'+n);
	if(fila!=null) fila.className=facultadesMenuOn[n];
	if(menu!=null) menu.style.display="block";
}
function EnlaceMenuOff(n)
{
	var fila = document.getElementById('WEB_Facultades'+n);
	var menu = document.getElementById('WEB_MenuEnlace'+n);
	if(fila!=null) fila.className=facultadesMenuOff[n];
	if(menu!=null) menu.style.display="none";
}

function EnlaceMenu(url,target)
{
    target=target.toLowerCase();
    if(target=='_blank')window.open(url);
    else if(target=='_top')top.location.href=url;
    else if(target=='_parent')parent.location.href=url;
    else self.location.href=url;
}
//******************************************************************************************************************
function Imprimir(cod_area,cod_perfil,print_area,print_navegacion,print_titulo,estilos)
{	
	var pp = window.open();
	pp.document.writeln('<HTML>')
	pp.document.writeln('<HEAD><title>Vista previa</title>')
	pp.document.writeln(estilos)
	pp.document.writeln('<LINK href="/estilos/PrintStyle.css"  type="text/css" rel="stylesheet" media="print"><base target="_self">')
	pp.document.writeln('</HEAD>')
	pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
	pp.document.writeln('<form  method="post">');
	pp.document.writeln(' <div id="TBL_Cabecera">');
	pp.document.writeln(' <input name="button" type="button" id="PRINT" onclick="javascript:location.reload(true);window.print();" value="Imprimir" />');
	pp.document.writeln(' <input name="button2" type="button" id="CLOSE" onclick="window.close();" value="Cerrar" />');
	pp.document.writeln(' </div>');
    pp.document.writeln(' <div id="IMP_Cabecera">');
    pp.document.writeln('   <table width="100%" border="0" cellspacing="0" cellpadding="0">');
    pp.document.writeln('     <tr>');
    pp.document.writeln('       <td style="width: 50%"><img src="/images/'+cod_area+'/print_logo_principal.gif" /></td>');
    pp.document.writeln('       <td width="50%" align="right"><img src="/images/'+cod_area+'/'+cod_perfil+'/print_logo_derecha.gif" /></td>');
    pp.document.writeln('     </tr>');
    pp.document.writeln('   </table>');
    pp.document.writeln(' </div>');
    pp.document.writeln(' <div class="IMP_BarraGris"></div>');
    pp.document.writeln(' <div class="IMP_BarraModulo"></div>');
    pp.document.writeln(' <div class="IMP_contenedorContenido">');
    pp.document.writeln('   <div class="IMP_Navegacion">'+document.getElementById(print_navegacion).innerHTML+'</div>');
    pp.document.writeln('   <div class="IMP_Titulo">'+document.getElementById(print_titulo).innerHTML+'</div>');
    pp.document.writeln('   <div class="IMP_Contenido">'+document.getElementById(print_area).innerHTML+'</div>');
    pp.document.writeln(' </div>');
	pp.document.writeln('</form></body></HTML>');			
}	


function trim(str) {
  while (str.charAt(0) == ' ') str = str.substring(1);
  while (str.charAt(str.length - 1) == ' ') str = str.substring(0, str.length - 1);
  return str;
}

// Chequeo para el e-mail: buscando [@] y [.] 
/*
function esEmail(elm) {
    var indiceArroba=elm.value.indexOf('@');
    var longitud=elm.value.length;
    if (indiceArroba<1 || longitud<5) return false;
    for (i=0;i<longitud;i++)
     if (elm.value.charAt(i) < '!' || elm.value.charAt(i) > '~') return false;

    if (elm.value.indexOf(' ') == -1 &&
        elm.value.indexOf(';') == -1 &&
        elm.value.indexOf(',') == -1 &&
        elm.value.indexOf('/') == -1 &&
        elm.value.indexOf('?') == -1 &&
        elm.value.indexOf('*') == -1 &&
        elm.value.indexOf(':') == -1 &&
        elm.value.indexOf('<') == -1 &&
        elm.value.indexOf('>') == -1 &&
        elm.value.indexOf('(') == -1 &&
        elm.value.indexOf(')') == -1 &&
        elm.value.indexOf('[') == -1 &&
        elm.value.indexOf(']') == -1 &&
        elm.value.indexOf('{') == -1 &&
        elm.value.indexOf('}') == -1 &&
        elm.value.indexOf('«') == -1 &&
        elm.value.indexOf('`') == -1 &&
        elm.value.indexOf('\'') == -1 &&
        elm.value.indexOf('.') != -1 &&
        elm.value != '' &&
        indiceArroba < (longitud-5))
        {dominioEmail=elm.value.substring(indiceArroba+1,longitud);
         if (dominioEmail.indexOf('@') == -1 &&
             dominioEmail.indexOf('.') > 0 &&
             dominioEmail.charAt(dominioEmail.length - 1) != '.')
             return true;
         else return false;
         }
    else return false;
}
*/
function esEmail(txt_email)
{
    txt_email.value=trim(txt_email.value);
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(txt_email.value)){
        return true;
    }else{
        return false;
    }
}

function consisfec(day, month, year)
{
  //month(0-11)
  var isValid = true;
  var enteredDate = new Date(year,month,day);
  if (enteredDate.getDate() != day)
  {
    isValid = false;
  }
  return isValid;
}

function alfanumericocaptcha(elm) {
var estado=true;
var longitud=0;
    if (elm !='') {
       longitud=elm.length;
       for (i=0;i<longitud;i++)
        estado = (estado &&
              (((elm.substr(i,1).toUpperCase() >= 'A') && (elm.substr(i,1).toUpperCase() <= 'Z')) || ((elm.substr(i,1) >= '0') && (elm.substr(i,1) <= '9'))));
       return estado; }
    else return false;
}

function alfanumerico(elm) {
var estado=true;
var longitud=0;
    if (elm !='') {
       longitud=elm.length;
       for (i=0;i<longitud;i++)
        estado = (estado &&
              (((elm.substr(i,1).toUpperCase() >= 'A') && (elm.substr(i,1).toUpperCase() <= 'Z')) || (elm.substr(i,1)=='-') || (elm.substr(i,1)=='_') || ((elm.substr(i,1) >= '0') && (elm.substr(i,1) <= '9'))));
       return estado; }
    else return false;
}

function solodigitos(elm) {
var estado=true;
var longitud=0;
    if (elm !='') {
       longitud=elm.length;
       for (i=0;i<longitud;i++)
        estado = (estado && ((elm.substr(i,1) >= '0') && (elm.substr(i,1) <= '9')));
       return estado; }
    else return false;
}

// Chequeando nulos y vacIos

function noVacio(elm) {
    if (elm.value == '' ||
        elm.value == null) 
    return false;
    else return true;
}
/**/
function actualizaContador(obj, max) 
{
	longitud=obj.value.length;
	if (longitud>max) obj.value=obj.value.substr(0,max);
	obj.form.Contador.value=obj.value.length;
}

function bNavegador() {
  if( navigator.appName )
  {
    if( navigator.appName == "Microsoft Internet Explorer")  return 1;
    if( navigator.appName == "Netscape")  return 2;
  }
  return 0;
}

bNombre = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ( (bNombre == 'Netscape' && bVer >= 3 ) ||
    (bNombre == 'Microsoft Internet Explorer' && bVer >= 4))
     braunser = 'n3';
else braunser = 'n2';

var IE4=(document.all) && (braunser=='n3');
var anchoPantalla=(window.screen.availWidth);
function imgAct(imgNombre) {
  if (braunser == "n3")
    document.images[imgNombre].src = eval( imgNombre + "on.src" );
}

function imgInact(imgNombre) {
  if (braunser == "n3")
    document.images[imgNombre].src = eval(imgNombre + "off.src");
}

function abreVentana(pUrl, pWindowName, pWidth, pHeight, pAttrib, pCuadrante) 
{
    var anchoDisponibleVentana=window.screen.availWidth;
    var altoDisponibleVentana=window.screen.availHeight;
    // '1 si, 2 sd, 3 ii, 4 id, 5 c [pCuadrante]
    var lngX =0;
    var lngY =0;
    if (pCuadrante==1) {lngX =0;lngY=0;}
    else if (pCuadrante==2) {lngX=(anchoDisponibleVentana - pWidth -15);lngY=0;}
    else if (pCuadrante==3) {lngX=0;lngY=(altoDisponibleVentana -30 - pHeight);}
    else if (pCuadrante==4) {lngX=(anchoDisponibleVentana - pWidth -15);lngY=(altoDisponibleVentana -30 - pHeight);}
    else {lngX =((anchoDisponibleVentana - pWidth)/2);lngY = ((altoDisponibleVentana - pHeight)/2);}

    var attrib = 'left=' + lngX + ',top=' + (lngY-30) + ',';
	    attrib += 'screenX=' + lngX + ',screenY=' + lngY + ',width='+pWidth+',height='+pHeight;
	//attrib += 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,maximize=no';}
	attrib += pAttrib;
    window.open (pUrl, pWindowName, attrib);
}

function cierraventana(zero) {
window.close();
}

function RedirectPageOther(p){
	document.location.href=p;
}

function ByPassOther(p){
	parent.RedirectPageOther(p);
}

function ByPassOtherOpener(p){
    window.opener.RedirectPageOther(p);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function invocaPintadaJS(paramE){
document.write(paramE);
}

//When the page loads: 
function preparaObjetos() {
	if (document.getElementsByTagName) {
		var objs = document.getElementsByTagName("object"); //Get all the tags of type object in the page.
		for (i=0; i<objs.length; i++) objs[i].outerHTML = objs[i].outerHTML; //Get the HTML content of each object tag and replace it with itself.
	}
}

//When the page unloads: 
function liberaObjetos() {
	if (document.getElementsByTagName) {
		var objs = document.getElementsByTagName("object"); //Get all the tags of type object in the page.
		for (i=0; i<objs.length; i++) objs[i].outerHTML = ""; //Clear out the HTML content of each object tag to prevent an IE memory leak issue.
	}
}

function SetEstilo(obj,back,fore) {
	obj.style.backgroundColor=back;
	obj.style.color=fore;
	obj.style.cursor='hand';
}
function toggledisplay(ee) {
	if (document.getElementById) {
		e=document.getElementById(ee);
		e.style.display =(e.style.display == 'none'?'block':'none');
	} else {
		if (document.layers) {
			document.ee.display=(document.ee.display=='none'?'block':'none');
		} else {
			document.all.ee.style.display = (document.all.ee.style.visibility=='none'?'block':'none');
		}
	}
}

	
//******************************************************************************************************************
// POPUPS
//******************************************************************************************************************
function CerrarPopup(id)
{
	//var POP_ContenedorCerrar='POP_Contenedor_'+id;
	var POP_ContenedorCerrar='POP_Contenedor_1';
	var capa = document.getElementById(POP_ContenedorCerrar);
	capa.style.display = "none";
}

function ConstruirPopup(pId,pTitulo,pContenido,pAncho,pAlto,pCuadrante,pCorX,pCorY,pTransparente,pEsFlash)
{
    pTitulo = '&nbsp;';
    var div_pop=document.getElementById('POP_Contenedor_'+pId);
    
    if(div_pop.style.display == "none"){ 
	    if(pCuadrante!=6){
		    var anchoDisponibleVentana=window.screen.availWidth;
		    var altoDisponibleVentana=window.screen.availHeight;
		    // '1 si, 2 sd, 3 ii, 4 id, 5 c [pCuadrante]
		    var lngX =0;
		    var lngY =0;
		    if (pCuadrante==1) {lngX =0;lngY=0;}
		    else if (pCuadrante==2) {lngX=(anchoDisponibleVentana - pAncho -15);lngY=0;}
		    else if (pCuadrante==3) {lngX=0;lngY=(altoDisponibleVentana -30 - pAlto);}
		    else if (pCuadrante==4) {lngX=(anchoDisponibleVentana - pAncho -15);lngY=(altoDisponibleVentana -30 - pAlto);}
		    else {lngX =((anchoDisponibleVentana - pAncho)/2);lngY = ((altoDisponibleVentana - pAlto)/2);}
		    pCorX=lngX;
		    pCorY=lngY;
	    }
    	
	    var Id_Contendor='POP_Contenedor_'+pId;
    	
	    var Id_Info='POP_Contenedor_Info_'+pId;
    	var Id_Arrastrar='POP_Contenedor_Arrastrar_'+pId;
	   
		    var Id_Titulo='POP_Contenedor_Titulo_'+pId;
		    var	popupDiv='<div id="'+Id_Contendor+'" '+ (pTransparente=='true'?'class="POP_Contenedor_ST"':'class="POP_Contenedor_CT"') +'>';


				popupDiv+='<div id="'+Id_Titulo+'" class="POP_ContenedorTitulo"' + (pTransparente=='true'?'style="display:none;"':'"style="display:block;"') + '><p>'+pTitulo+'</p></div>';
				popupDiv+='<div class="POP_ContenedorCerrar"'+ (pTransparente=='true'?'style="display:none;"':'"style="display:block;"') +'><a href="javascript:CerrarPopup('+pId+')";>X</a></div>';


				popupDiv+='<div id="'+Id_Info+'" class="POP_Contenido">';


				popupDiv+='<div id="'+Id_Arrastrar+'" '+ (pTransparente=='false'?'style="display:none;"':'"style="display:block;"') +' >'+pContenido+'</div>';

				if(pTransparente=='false' ){
					popupDiv+=pContenido;					
				}
				

				popupDiv+='</div></div>';
		     

		    document.getElementById(Id_Contendor).style.display="block";
		    document.getElementById(Id_Contendor).style.position='absolute';
 		    document.getElementById(Id_Contendor).innerHTML = popupDiv;
		    document.getElementById(Id_Info).style.height=pAlto+'px';
    		
		    if(pEsFlash=='true'){
			    document.getElementById(Id_Info).style.width=pAncho+'px';
			    document.getElementById(Id_Info).style.padding ="0px";
		    }else{
			    document.getElementById(Id_Info).style.width=pAncho-20+'px';
    			
		    }
		    document.getElementById(Id_Info).style.overflow="auto";
		    document.getElementById(Id_Contendor).style.width = pAncho+'px';
		    document.getElementById(Id_Contendor).style.left = pCorX+'px';
		    document.getElementById(Id_Contendor).style.top = pCorY+'px';
    		
	        if(pTransparente=='false'){
		        if (window.XMLHttpRequest) {
			        var alturaTitulo=document.getElementById(Id_Titulo).maxHeight;
			        document.getElementById(Id_Titulo).style.width= pAncho+'px';
		        } else {
		            var alturaTitulo=document.getElementById(Id_Titulo).offsetHeight;
			        document.getElementById(Id_Titulo).style.width= pAncho+'px';
		        }
		        var Cabecera = document.getElementById(Id_Titulo);
		        var Contenedor = document.getElementById(Id_Contendor);
		        Drag.init(Cabecera, Contenedor);
	        }else{
		        if(pEsFlash=='false'){
			        document.getElementById(Id_Contendor).style.height = pAlto+'px';
			        document.getElementById(Id_Contendor).style.border="0 none black";
			        var Arrastrar = document.getElementById(Id_Arrastrar);
			        var Contenedor = document.getElementById(Id_Contendor);
			        Drag.init(Arrastrar, Contenedor);
		    }
	    }
    }
}
	
//******************************************************************************************************************
// BUSQUEDA
//******************************************************************************************************************
function SelectorTipoBusqueda(obj)
{
    if(obj.value=='rdo_ContenidoDB'){	
        if (document.all) document.getElementById("ctl00_PortalPlaceHolder_tr_Topicos").style.display=''; 
		else document.getElementById("ctl00_PortalPlaceHolder_tr_Topicos").style.visibility='visible';
    }else{
        if (document.all) document.getElementById("ctl00_PortalPlaceHolder_tr_Topicos").style.display='none'; 
		else document.getElementById("ctl00_PortalPlaceHolder_tr_Topicos").style.visibility='collapse';
    }
    
    var txt_criterio=document.getElementById("ctl00_PortalPlaceHolder_txt_TextoBuscarAvanzada");
    if(txt_criterio!=null)txt_criterio.focus();
}