//
// Muestra el gif de esfera en la capa  y llama la funcion
//
function MuestraGifEspera( funcion, capa ) {
	//document.all[capa].innerHTML ="";
	document.getElementById(capa).innerHTML = "";
	Img = "<img src='loading.gif' align='absmiddle'>";
	document.getElementById(capa).innerHTML ="<center>"+ Img + "</center>";
	//document.all[capa].innerHTML ="<center>"+ Img + "</center>";
	//alert (funcion());
	//funcion();
//	return false;	
}

//
// Oculta el gif de esfera en la capa
//
function OcultaGifEspera( capa ) {
	document.getElementById(capa).innerHTML ="";
	//document.all[capa].innerHTML ="";
}

//
// Valida si un número en estero
//
function ValidaInt ( valor ){
	
	valor = parseInt(valor);
	
    if (isNaN( valor )) {
		alert("introduzca un número");
		return valor;
    }
	else{
	     if (valor > 0){ return valor; }
		else {  alert("introduzca un número mayor"); return false;}
     } 
 }
 
//
// Elimina espaios en blanco, nuevalina, tabulaciones, etc
//
  function trim10 (str) {
	var whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
	for (var i = 0; i < str.length; i++) {
		if (whitespace.indexOf(str.charAt(i)) === -1) {
			str = str.substring(i);
			break;
		}
	}
	for (i = str.length - 1; i >= 0; i--) {
		if (whitespace.indexOf(str.charAt(i)) === -1) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}


//
// abre una ventana y envia como argumento el nombre de la capa que se desea mostrar
//
function VistaPrevia( div, t ){
	   window.open ('reportes.php?t='+t+'&capa='+ div, 'Resportes_PROGACAD','resizable = yes, toolbar=no, scrollbars=yes, width = 800'); 
       
		return false;
}


//
// Imprime el contenido de una página
//
function Imprimir( div ){
    //desaparece el boton
	
     document.getElementById( 'btnOk' ).style.display='none';
	 document.getElementById( 'word' ).style.display ='none';
     //se imprime la pagina
     window.print();
      //reaparece el boton
    document.getElementById( 'btnOk').style.display='inline';
	document.getElementById( 'word').style.display ='inline';
	
	
	 return false;
}

//
// Muestra los datos del que se envuentran en div en la pagina nueva
//
function MuestraDatos( div_src, div_dest, t ){
	     texto = window.opener.document.getElementById(div_src).innerHTML;
		// alert (texto);
		 if (t==1){		 
			 for( i=0; i<7; i++){
				 pos = texto.search(/<BR>/i);
				 texto = texto.substring(pos+4) ;
				// alert( texto);  
				 }
				 texto = texto.replace(unescape("%AB volver"), "");
//				  texto = texto.replace(/volver/g,'');
		 }		 
	     document.getElementById(div_dest).innerHTML = texto  ;
		 document.getElementById("ParaImprimir").value =  texto;
	return false;  
}

function NoBoton(){
	document.getElementById( 'btnOk' ).style.display='none';
	}
	
function SiBoton(){
	document.getElementById( 'btnOk' ).style.display='inline';
	}


function tipoEstu() {
   	objck = document.getElementById('hTipoEstu');
		//alert (document.frmAula.TipoEstu[0].value);
	//alert (objck.value);
	
	
	return objck.value;
  
}


//tomado de:
//Modificado por: Ing. Mónica Saettone
// modificado al: 08/07/2009

function bderecho(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
    return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
	//alert(" Las teclas no funcionan ");
    return false;
}
return true;
}
if (document.layers) window.captureEvents(Event.MOUSEDOWN);

window.onmousedown=bderecho;

function keypressed() {
//alert(" Las teclas no funcionan ");
return false;
}


document.onmousedown=bderecho;








