// Diferenciar los navegadores....
ie=(navigator.appName.indexOf('Microsoft')!=-1)?true:false;
ns=(navigator.appName == "Netscape" && document.getElementById)?true:false;
version = navigator.appVersion;

if (version.indexOf('MSIE 5.0')> 0){
	ver = 5;
}
else{
	ver = 0;
}
//······································································································//
function abrepop(cual, na, ancho, alto, aux){
	if (ie){
		window.open(cual, na, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=auto, resizable='+aux+', copyhistory=no, width='+ancho+', height='+alto+', top=0, left=0');
	} 
	else if (ns){
		window.open(cual, na, 'left=0, top=0, width=740, height=500, location=no, toolbar=no, directories=no, menubar=no, resizable=no, scrollbars=yes, status=no');		
	} 
	else{
		window.open(cual, '', 'left=0, top=0, width='+ancho+', height='+(alto+5)+', location=no, toolbar=no, directories=no, menubar=no, resizable=no, scrollbars=no, status=no moveby(50,50)');
	}
}
//······································································································//
function popBuscador(cual){
var posX;
var posY;

	if (ie){
		posX = event.clientX + document.body.scrollLeft + window.left; 
		posY = event.clientY + document.body.scrollTop + window.top; 
		alert(posX);
		window.open(cual, 'pop', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, top='+(posY)+', left='+(posX)+', width=200, height=200');		
	}else{
		document.captureEvents(Event.MOUSEMOVE)
		window.open(cual, 'pop', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=200, height=200, top='+e.pagex+', left='+e.pagey+'');				
	}
}
//······································································································//
function recarga(){
	document.frmBuscador.submit();
}
//······································································································//
function buscar(boton, destino){
	document.frmBuscador.action="grabaSession.asp"+destino;
	if(boton==1){
		document.frmBuscador.submit();
	}
}
//······································································································//
function resaltaObra(tipo, id){
	switch(tipo){
	case 0:
		document.getElementById("titObra"+id).className="normal";
	break;
	case 1:
		document.getElementById("titObra"+id).className="negrita";
	break;
	}
}
//······································································································//
function esNumero(e) {
	var charCode;
	if (ns){
		charCode = e.which; // leo la tecla en ASCII que ingreso
	}else{
		charCode = e.keyCode; // leo la tecla en ASCII que ingreso
	}
	if (charCode > 31 && (charCode < 48 || charCode > 57)){
		return false;
	}else{
		return true;
	}
}
//······································································································//
function chkAno(e, campo) {
	var charCode;
	if (ns){
		charCode = e.which; // leo la tecla en ASCII que ingreso
	}else{
		charCode = e.keyCode; // leo la tecla en ASCII que ingreso
	}
	if(campo.value.length<4){;
		if (charCode == 95 || (charCode >= 48 && charCode <= 57)){
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}




