<!--
// objeto para la deteccion de navegador
function checkBrowser(){
this.navVer=navigator.appVersion;
this.navName=navigator.appName;
this.navUserAgent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.moz=(this.dom && this.navName.lastIndexOf('Netscape')!=-1 && parseInt(this.navVer) >= 5)?1:0;
this.ie=(this.dom && this.navName.lastIndexOf('Microsoft Internet Explorer')!=-1 && this.navUserAgent.lastIndexOf('Opera')==-1)?1:0;
this.op=(this.dom && this.navUserAgent.lastIndexOf('Opera')!=-1)?1:0
this.bw=(this.ie || this.moz || this.op)
return this;
}
var bw=new checkBrowser();

// muestra los segundos estados del menu (en evento ONLOAD)
function selMenu(opcnivel0,opcnivel1,opcnivel2){
if (document.getElementById){
	var clase;
	if(opcnivel0!=null){
		var strId='nivel0_'+opcnivel0;
		clase=document.getElementById(strId).className;
		clase=(clase!="")?clase+" ":clase;
		clase+="activo";
		document.getElementById(strId).className=clase;
		document.getElementById(strId).style.cursor="default";
		}
	if(opcnivel1!=null){
		var strId='nivel1_'+opcnivel1;
		clase=document.getElementById(strId).className;
		clase=(clase!="")?clase+" ":clase;
		clase+="activo";
		document.getElementById(strId).className=clase;
		document.getElementById(strId).style.cursor="default";
		}
	if(opcnivel2!=null){
		
		}
	}

// mostramos la busqueda avanzada si se ha utilizado en la sesion
mostrarBusqueda();
}

// Muestra y oculta la busqueda avanzada
var visible=false;
function busquedaAdv(){
if (document.getElementById("busquedaavanzada") && !visible){
	document.getElementById("busquedaavanzada").style.display="block";
	document.getElementById("bannerentradas").style.display="none";
	visible=true;
	}
	else if (document.getElementById("busquedaavanzada") && visible){
	resetBusqueda();
	document.getElementById("busquedaavanzada").style.display="none";
	document.getElementById("bannerentradas").style.display="block";
	visible=false;
	}
}

function borrar_ddmmaaaa(control){
	control.value='';
}

function resetField(field){
	if (field.value=='') field.value='dd/mm/aaaa';
}

function resetBusqueda(){
	if (document.getElementById("BuscadorColumnadcha_ActividadesDropDownList")) document.getElementById("BuscadorColumnadcha_ActividadesDropDownList").value=0;
	if (document.getElementById("BuscadorColumnadcha_ProvinciasDropDownList")) document.getElementById("BuscadorColumnadcha_ProvinciasDropDownList").value=0;
	if (document.getElementById("BuscadorColumnadcha_txtfechadesde")) document.getElementById("BuscadorColumnadcha_txtfechadesde").value="dd/mm/aaaa";
	if (document.getElementById("BuscadorColumnadcha_txtfechahasta")) document.getElementById("BuscadorColumnadcha_txtfechahasta").value="dd/mm/aaaa";
	if (document.getElementById("BuscadorColumnadcha_txtpclave")) document.getElementById("BuscadorColumnadcha_txtpclave").value="";	
}

function mostrarBusqueda(){
var desdeValue=document.getElementById("BuscadorColumnadcha_txtfechadesde").value;
var hastaValue=document.getElementById("BuscadorColumnadcha_txtfechahasta").value;
var pclaveValue=document.getElementById("BuscadorColumnadcha_txtpclave").value;
if (desdeValue!="dd/mm/aaaa" || hastaValue!="dd/mm/aaaa" || pclaveValue!="") busquedaAdv();
}

// lanza una ventana flotante (popup) centrada en la pantalla
function abrePopup(url,dimX,dimY,posX,posY,barraScroll) {
var dimXInterface=10
var dimYInterface=29
if ((posX==-1) && (posY==-1)){
	var resX=screen.width;
	var resY=screen.height;
	posX=(resX-(dimX+dimXInterface))/2;
	posY=(resY -(dimY+dimYInterface))/2;
	}

        
        var inicioNombre = url.lastIndexOf('/')+1;
        var nombre_ventana = url.substring(inicioNombre,url.lastIndexOf('.'));
                
	var cadena_opciones="width=" + dimX + ",height=" + dimY + ",left=" + posX + ",top=" + posY +((barraScroll)?",scrollbars=yes":"");
	var vent= window.open(url,'ventana',cadena_opciones);
	
	// deteccion de bloqueo de popup
        if (vent==null || vent==undefined) alert('Su sistema bloqueó una ventana emergente.\n\nDurante la navegación en esta Web, debe permitir temporalmente\nla apertura de ventanas emergentes.');
}
//-->
