/* Inicio funciones Procesando...*/   

	var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

    var m_iFppCallCount=0;

    function getElem(Ih){
        return document.getElementById(Ih);
    }

    function Zu(){
        if(m_iFppCallCount>0){
            var oElem=getElem("cLoadingIndicator");
//            oElem.style.top=document.body.clientHeight-oElem.clientHeight-2+document.body.scrollTop;
            oElem.style.top=document.body.clientHeight-oElem.clientHeight-2;

            oElem.style.visibility="visible";
        }
    }

    function av(){
     m_iFppCallCount--; 
            if(m_iFppCallCount==0){
                var oElem=getElem("cLoadingIndicator");
                oElem.style.visibility="hidden";
                document.body.style.cursor = "auto";
            }
    }

    function Yu(delay){
		alert("paso");
		return;
  		if(m_iFppCallCount==0){
	   		m_iFppCallCount++;
            document.body.style.cursor = "wait";
   			Zu();
   			if (delay>0)
       			window.setTimeout(av,delay);
     	}
    }

/* Fin funciones Procesando...*/   

	function fecha(){
		mes = new Array();
		diasem = new Array();
		fechas = new Date();
		diasemana = fechas.getDay();
		diasem[0] = "Domingo";
		diasem[1] = "Lunes";
		diasem[2] = "Martes";
		diasem[3] = "Miercoles";
		diasem[4] = "Jueves";
		diasem[5] = "Viernes";
		diasem[6] = "Sabado";
		dia = fechas.getDate();
		nomes = fechas.getMonth();
		anio = fechas.getYear();
		mes[0] = 'Enero';
		mes[1] = 'Febrero';
		mes[2] = 'Marzo';
		mes[3] = 'Abril';
		mes[4] = 'Mayo';
		mes[5] = 'Junio';
		mes[6] = 'Julio';
		mes[7] = 'Agosto';
		mes[8] = 'Septiembre';
		mes[9] = 'Octubre';
		mes[10] = 'Noviembre';
		mes[11] = 'Diciembre';
		if (anio < 1000) anio = anio + 1900;
		document.write(diasem[diasemana]+" "+ dia +" de "+ mes[nomes] +" de "+ anio);
	}

	function SoloNumeroK(){
		var Press=event.keyCode;
 		if ((Press>=48 && Press<=57) || Press==13 || Press==8 || Press==75 || Press==107)
 			event.keyCode=Press;
 		else
 			event.keyCode=0;
 	}

	function SoloNumerosEntero(){
		var Press=event.keyCode;
		if(Press==46)Press=44;
	 		if ((Press>=48 && Press<=57) || Press==13 || Press==8)
				event.keyCode=Press;
			else
				event.keyCode=0;
	}

	function autoTab(input,len,next) {
		if(input.value.length >= len){
			try{
				eval('document.f.'+next+'.focus()');
				eval('document.f.'+next+'.select()');
			}catch(e){}
		}
	}

	function isEmpty(s) {
		return ((s == null) || (s.length == 0))
	}

	function campoObligatorio(obj,campo){
		if (isEmpty(obj.value)){
			alert("Debe indicar '" + campo +"'");
			try{
				obj.focus();
			}catch(e){}
			return false;
		} 
		return true;
	}
	
	function EvalRegExpAlertFocus(regexp,campo,nombre,formato){
		var re = new RegExp(regexp);
		if (re.test(campo.value)) return true;
		alert("El campo "+ nombre +" ("+campo.value+")\n no cumple con el formato "+ formato);
		campo.focus();
		campo.select();
		return false;
	}

	function EvalRegExpAlert(regexp,valor,nombre,formato){
		var re = new RegExp(regexp);
		if (re.test(valor)) return true;
		alert("El campo "+ nombre +" ("+valor+")\n no cumple con el formato "+ formato);
		return false;
	}

	function EvalRegExp(regexp,valor,nombre,formato){
		var re = new RegExp(regexp);
		if (re.test(valor)) return true;
		return false;
	}

	function modulo11(chrcadena){ 
	   var digitoverificador=""; 
	   var digitos= new Array(12);
	   var acum=0;
	   var modulo=0;
	   var valido=-1;
	   chrcadena=darformato_RUT(chrcadena);
	   if (chrcadena.substring(9,9+1) =="k" || chrcadena.substring(9,9+1) =="K"){digitoverificador="K";}
	   else{ digitoverificador=chrcadena.substring(9,9+1);}
	   for (acum=0;acum<10;acum++){digitos[acum]=chrcadena.substring(acum,acum+1);}
	   acum=0; digi=0;
	   acum=digitos[0]*4+digitos[1]*3+digitos[2]*2+digitos[3]*7+digitos[4]*6+digitos[5]*5+digitos[6]*4+digitos[7]*3+digitos[8]*2;
	   modulo = 11 - (acum % 11);
	   if (modulo==10){digi="K";}else{if(modulo==11){digi="0";}else{digi=modulo;}}
	   if (digi==digitoverificador){valido=0;}
	   return(valido);
	}	
	function isEmail(email) {
	
	//  alert(email);
	  var str = email.value;	
	  var supported = 0;
	  if (window.RegExp) {
	    var tempStr = "a";
	    var tempReg = new RegExp(tempStr);
	    if (tempReg.test(tempStr)) supported = 1;
	  }
	  if (!supported) 
	    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	  if  (!(!r1.test(str) && r2.test(str))){
	  		alert('Correo electr\u00F3nico no v\u00E1lido. Ingrese nuevamente'); 
			email.focus();
			email.select();
			return false;
	  }else{
			return true;
	  }
	}


	function darformato_RUT(chrcadena){
		if (chrcadena.length <10){ii=10-chrcadena.length;for (i= 1;i<=ii;i++){chrcadena="0"+chrcadena;}}
		return (chrcadena);
	}

	function SoloFecha(){
		var Press=event.keyCode;
//		if(Press==46)Press=44;
	 		if ((Press>=45 && Press<=57) || Press==13 || Press==8)
				event.keyCode=Press;
			else
				event.keyCode=0;
	}


function prueba(){
	alert(1);
}