function AddDominioDir(d,t){
  var cat = document.getElementById("Id"+t).value;
  if (cat){
  if (document.getElementById("sel_extracat_"+d).checked == true){
	xajax_processDominioCatDir(t,d,cat,'1');  
  }else{
	xajax_processDominioCatDir(t,d,cat,'2');  
  }
  }else{
	document.getElementById("sel_extracat_"+d).checked = false;  
	document.getElementById("IdMensaje").innerHTML = "<font color=red>Debe seleccionar una categoria...</font>" ;  
  }
}


function AddCategoriaDir(t){
  var inp = "<input type='text' name='catnombre'  size='30' value='' id='Idcatnombre'>&nbsp;<input type='button'  value='Go' id='IdBottomSubmitCat' class='sbvv' onclick=\"xajax_addCategoriaDir(xajax.getFormValues('IdFormAdminConfiguracion'),'"+t+"')\">&nbsp;<span id='mensajecat'></span>";
  document.getElementById('IdAddCategoria').innerHTML = inp;
  //xajax_processViewCategoria('directorio_categoria','','1')
}

function OnchangeVarDominio(){
  var ed = document.getElementById("Idvardominio").value;
  xajax_processVD(ed);
}
function addselectdom(id,d){
	var ed = document.getElementById("Ideliminar_dominio").value;
	if (document.getElementById(id).checked == true){
		var ee = ed.substring(1, ed.length);
		var ef = ee.split(",");
		var el = ef.length;
		var ev = "";
		for (a=0;a<el;a++){
			if (ef[a]){
			  if (ef[a] != d){
				if (a==0){
				  ev = "," + ef[a];
				}else{
				  ev = ev + "," + ef[a];
				}
			  }
			}
		}
		//document.getElementById("IdMensaje").innerHTML = ev ;
		document.getElementById("Ideliminar_dominio").value = ev;
	}else{
		 //document.getElementById("IdMensaje").innerHTML = ed + "," +d;
		 document.getElementById("Ideliminar_dominio").value = ed + "," +d;
	}
}

function popus(tabla,id,text){
    document.getElementById('popup'+id).style.display = "block";
    document.getElementById('popup'+id).innerHTML = '<div id="poppDiv" class="inline-warning" style="height:60px; "><div><p><strong>&iquest;Realmente desea eliminar esta imagen?</strong>  <a href="#" onclick="xajax_processEliminarImagen(\''+tabla+'\',\''+id+'\',1); return false;">SI</a> o <a href="#" onclick="unpoppem('+id+'); return false;">NO</a> </p><a href="#" onclick="unpoppem('+id+'); return false;"><img src="/images/close2.gif" class="close" width="22" height="22" alt="Cerrar" border="0"/></a></div></div>'; 
}

function unpoppem(id){
	document.getElementById('popup'+id).style.display = "none"; 
}

function QuitarVariablePlantilla(id,tabla,accion){
  var v = accion+id;	
  if(document.getElementById(v).checked){
	  var idv = document.getElementById(v).value; 	
  }else{
	  var idv = ""; 	
  }
  xajax_QuitarVariablePlantilla(xajax.getFormValues("IdFormAdminConfiguracion"),id,tabla,""+idv+"");
}

function OpenPopup(titulo,tabla,accion){
   document.getElementById("IDwesq").style.display="block";
   document.getElementById("IDwesq").style.width="530px";
   document.getElementById("wcontbl").innerHTML="<div style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></div>";
   document.getElementById("hc-window").innerHTML=titulo;
   document.getElementById("hc-window").style.width="510px";
   document.getElementById("wcenter").style.width="528px";
   document.getElementById("w-header-title").style.width="520px";
   document.getElementById("dwindowcontent").style.height="398px";
   document.getElementById("dbodycontent").style.height="398px";
   document.getElementById("dbodycontent").style.width="510px";
   var i = 400;
   var a = 500;
   var e = 310;
   var x = 235;
   var h = 100;
   
   if (navigator.appVersion.indexOf("MSIE 6.0") != -1){ 
   	ADivSetVisible(i,a,e,x,h);
   }
   if (tabla != "directorio_mensajes_dominio" && tabla != "foro_mensajes_dominio"){
  	xajax_processPopup(tabla,accion);
   }else{
	var id = document.getElementById("Idid").value;
	xajax_processPopupDirMsn(id,tabla,accion);
   }
}

function OpenPopupDir(titulo,tabla,id,accion){
  document.getElementById('IDwesq').style.display = "block";
  document.getElementById("hc-window").innerHTML= titulo ;
  document.getElementById("wcontbl").innerHTML="<span style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></span>";
  document.getElementById("wcontbl").style.width="510px";
  xajax_processPopupDir(xajax.getFormValues("IdFormAdminConfiguracion"),tabla,id,accion);
}


function menuIni() {
            var menuModel5 = new DHTMLSuite.menuModel();
			menuModel5.addItemsFromMarkup('menuModel5');
			menuModel5.init();

			var menuBar5 = new DHTMLSuite.menuBar();
			menuBar5.addMenuItems(menuModel5);
			menuBar5.setTarget('fifthMenu');
			menuBar5.init();
}
function validarFormObj(i,t,c) {
	 document.getElementById("IdactionPubBoton").value = c;
	 validarForm(i,t);
}
function validarForm(i,t) {
	var msn = "";
	var rd = "";
	var num = xajax.$(i).elements.length;
	for (a = 0; a < num;a++){
	  var nmt = xajax.$(i).elements[a].name;	
	  if (document.getElementById('ast_'+nmt)){
	    var djb = document.getElementById('ast_'+nmt).innerHTML;
	  }else{
		var djb = ""; 
	  }

       if (djb=="*"){
		 var vlt = xajax.$('Id'+nmt).value; 
		 if (vlt=="" || vlt==0){
			 var msn = "<font color=#FF9900>Datos Requeridos</font>";
			 var error = 1;
			 document.getElementById('cl_'+nmt).style.color = "#FF9900";
		 }else{
			 document.getElementById('cl_'+nmt).style.color = "#000000";
		 }
	  }
	  
	}
	if (!msn){
		
	  if (i != "IdFormAdminConfiguracion"){	
		if (t=="articulos_categoria"){
			var a = document.getElementById("IdactionPub").value;
			xajax_processAccionPopup(xajax.getFormValues(i),t,a);
			//msn = "articulos categoria"+a;
		}
		if (t=="dominio"){
			var a = document.getElementById("IdactionPub").value;
			xajax_processAccionPopup(xajax.getFormValues(i),t,a);
		}
	  }else{
		  ProcessForm(t);
	      

	  }
	 
	}
	
	
	document.getElementById('IdMensaje').innerHTML = msn;
}

function mensajeView(t){
	document.getElementById('IdMensaje').innerHTML = t;
}

function contadorView(l,t){
	document.getElementById('IdMensaje').innerHTML = "Total de Item: "+l+" van: "+t;
}

function addform(a){
  document.getElementById('IdFormAdminConfiguracion').action = "blogdbtxt.php";
  document.getElementById('IdFormAdminConfiguracion').encoding = "multipart/form-data";
  document.getElementById('IdFormAdminConfiguracion').target = "iframea";
  document.getElementById('IdFormAdminConfiguracion').method = "POST";
  document.getElementById('IdFormAdminConfiguracion').submit();
  document.getElementById('IdMensaje').innerHTML = "Cargando archivo al servidor... Espere por favor...";
}

function viewBc(a){
 if (a==1){
	var d = "block"
	var t = "<span onclick=\"viewBc('2')\" >Ocultar Busqueda -</span>";
 }else{
	var d = "none"  
	var t = "<span onclick=\"viewBc('1')\" >Buscar Comprobante +</span>";
 }
 document.getElementById('idbuscar').style.display = d;
 document.getElementById('Bctexto').innerHTML = t;
}

function clearbc(a,b){
	if (a){
	  document.getElementById(a).value = "";
	}
	if (b){
	  document.getElementById(b).value = "";
	}
}

function redirect() {
	xajax_processredirect();
}

function timer() {
    time1=window.setTimeout("redirect()",500000); 
}

function detime() {
      window.clearTimeout(time1);
      timer();
}


function ProcessForm(t) {
    var a = document.getElementById("IdactionPub").value;
	
	if ((t=="articulos")||(t=="directorio_categoria")||(t=="foro_categoria")){
	  if (t=="articulos"){	
	  	document.getElementById("idcontenido").value = tinyMCE.getContent();
	  	cargadearticulos("IdFormAdminConfiguracion");
		document.getElementById('IdMensaje').innerHTML = "pasa de process form";
	  }
	  
	  if ((t=="directorio_categoria")||(t=="foro_categoria")){	
	  	cargadecategoria("IdFormAdminConfiguracion");
	  }
	}else{
		if (a == 1){
			xajax_processAdicionar(xajax.getFormValues("IdFormAdminConfiguracion"),t);
		}
		if (a == 2){
		  	xajax_processEditar(xajax.getFormValues("IdFormAdminConfiguracion"),t);
		}
		if (a == 3){
			xajax_processDelete(xajax.getFormValues("IdFormAdminConfiguracion"),t);
		}
		document.getElementById("IdMensaje").innerHTML = "";
	}
}

function inputpaginador(t,v){
    var p = (document.getElementById("IdPagetp").value);
    xajax_processPaginador(xajax.getFormValues("IdFormAdminConfiguracion"),t,p,v);
	  
  }

function enviarhtml(f){
  document.getElementById(f).action = "enviar_html.php";
  document.getElementById(f).target = "fmhtml";
  document.getElementById(f).method = "post";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
  //xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
  
}

function cargadearticulos(f){
  msn="pasa cargar articulo";
  document.getElementById(f).action = "cargar_articulos.php";
  document.getElementById(f).target = "iframe1";
  document.getElementById(f).method = "POST";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
 // xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
 document.getElementById('IdMensaje').innerHTML = msn;
  
}

function cargadecategoria(f){
  document.getElementById(f).action = "cargar_categoria.php";
  document.getElementById(f).target = "iframe1";
  document.getElementById(f).method = "POST";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
 // xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
  
}

function cargadecatart(f){
  document.getElementById(f).action = "cargar_categoria_articulos.php";
  document.getElementById(f).target = "iframe2";
  document.getElementById(f).method = "POST";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
 // xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
  
}
function cargadedirmsn(f){
  document.getElementById(f).action = "cargar_directorio_mensajes.php";
  document.getElementById(f).target = "iframe2";
  document.getElementById(f).method = "POST";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
 // xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
  
}

function cargadedominio(f){
  document.getElementById(f).action = "cargar_dominio.php";
  document.getElementById(f).target = "iframe2";
  document.getElementById(f).method = "POST";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
 // xajax.$('IdImagenMsn').innerHTML="Imagen Cargada";
  
}


function BottomSubmit(f,n,a){
	xajax.$(f).disabled=a;
    xajax.$(f).value=n;
}
function actualizarreservacion(d,i,a,e)
  {
	var x = 430;
	var wh = a-10;
	var p = parseFloat(a) + 30;
	var h = parseFloat(e) + 3;
	var eh = parseFloat(e) + 12;
	var me = parseFloat(e) - 12;
	var ma = parseFloat(a) + 20;
	var mh = parseFloat(ma) - 1;
	var x = 430;
	var l = 170;
	if (d == "v"){
	  var t = "Validar Pago";
	}
	if (d == "s"){
	  var t = "Actualizar Salida";
	}
	if (d == "l"){
	  var t = "Actualizar Llegada";
	}
	
              //x=event.x;
			  //x=event.x+document.body.scrollLeft;
              y=event.y+document.body.scrollTop-200;
     
	document.getElementById('IDwesq').style.display = "block";
	document.getElementById("wcontbl").innerHTML="<span style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></span>";
	document.getElementById("hc-window").innerHTML= t ;
    document.getElementById("IDwesq").style.width=a+"px";
	document.getElementById("hc-window").style.width=mh+"px";
	document.getElementById("wcenter").style.width=p+"px";
	document.getElementById("wcenter").style.height=eh+"px";
    document.getElementById("dwindowcontent").style.height=e+"px";
	document.getElementById("dwindowcontent").style.width=a+"px";
    document.getElementById("dbodycontent").style.height=h+"px";
	document.getElementById("dbodycontent").style.width=ma+"px";
	document.getElementById("IDwesq").style.padding= y+"px 0px 0px "+x+"px";
	//ADivSetVisible(i,a,e,x,'0');
	xajax_ProcessActualizarReservacion(i,d);
	
  }
  
function DeleteColor(i)
  {
	document.getElementById("idRow"+i).style.background = "#FFFFFF"; 
	document.getElementById("IdmsnTxt").innerHTML = "";
  }
function ProcessDelete(i,t,o,d)
  {
  var aVarHidden = document.getElementById("Idid").value;
  if (aVarHidden){
   document.getElementById("idRow"+aVarHidden).style.background = "#FFFFFF";
  }
  document.getElementById("Idid").value = i;
  document.getElementById("idRow"+i).style.background = "#FFFFCC";
  document.getElementById("IdmsnTxt").innerHTML = "&iquest;Desea eliminar este item? <strong onclick=\"xajax_ProcessDelete(xajax.getFormValues('IdFormAdminConfiguracion'),"+i+",'vuelos','','IdFormAdminConfiguracion')\" style=\"cursor:hand\">SI</strong> o <strong onClick=\"DeleteColor("+i+")\" style=\"cursor:hand\">NO</strong>"; 
  
  }
  
function ADivSetVisible(i,w,h,l,t)
  {
   var DivRef = document.getElementById('IDwesq');
   var IfrRef = document.getElementById('DivShim');
   if(i)
   {
    DivRef.style.display = "block";
    IfrRef.style.width = w+"px" ;
    IfrRef.style.height = h+"px";
    IfrRef.style.top = t;
    IfrRef.style.left = l;
	//IfrRef.style.zIndex = DivRef.style.zIndex -3;
    IfrRef.style.display = "block";
	
   }
   else
   {
    DivRef.style.display = "none";
    IfrRef.style.display = "none";
   }
 }
 

function bloPopup(){
	var i = document.getElementById("Idid").value;
	if (i){
	  document.getElementById(i).style.background = "";
	  document.getElementById("Idid").value = "";
	}
}

function modificar(i){
	
	document.getElementById(i).className = "TextInputEdt";
	document.getElementById("Idid").value = i;
	document.getElementById(i).readOnly = false;
	document.getElementById(i).focus();
	
}

function bloquear(a,c){
	var i = document.getElementById("Idid").value;
	var m = document.getElementById(i).value;
		
	if (i){
	 document.getElementById(i).readOnly = true;
	 document.getElementById(i).className = "TextInput";
	 document.getElementById("Idid").value = "";
	 document.getElementById("IdmsnTxt").innerHTML="<span style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></span>";	
	 xajax_ProcessModificarVuelos(m,a,c);
   }
}



function checkFields(){
	var error = 0;
	var n0 = document.getElementById("Idzonas").value;
	var n1 = document.getElementById("Id1").value;
	var n2 = document.getElementById("Id2").value;
	var n3 = document.getElementById("Id3").value;
	if (n0 == ""){
	  document.getElementById("tid0").style.color = "#ff0000";
	  error = 1;
	}
	if (n1 == ""){
	  document.getElementById("tid1").style.color = "#ff0000";
	  error = 1;
	}
	if (n2 == ""){
	  document.getElementById("tid2").style.color = "#ff0000";
	  error = 1;
	}
	if (n3 == ""){
	  document.getElementById("tid3").style.color = "#ff0000";
	  error = 1;
	}
		
	
	if (error == 1){
		    document.getElementById("IdImagenMsg").innerHTML = "Datos obligatorios";
		    document.getElementById("IdImagenMsg").style.color = "#ff0000";
            return false;
    }else{
           return true;
    }
   

}
function InputSelect(i,o,n,f,d) {
 var zn = document.getElementById("Idzonas").value;
 if(zn != ""){
  document.getElementById("nId"+o).innerHTML = "Espere por favor..."; 	
  xajax_ProcessSelectZonas(xajax.getFormValues('idformcantidades'),i,o,n,f,d);
 }else{
	document.getElementById("nId1").innerHTML = "&nbsp;";
	document.getElementById("Id1").value = "";
	document.getElementById("Div1").value = "";
	document.getElementById("nId2").innerHTML = "&nbsp;";
	document.getElementById("Id2").value = "";
	document.getElementById("Div2").value = "";
	document.getElementById("nId3").innerHTML = "&nbsp;";
	document.getElementById("Id3").value = "";
	document.getElementById("Div3").value = "";
 }
}


function InputDir(n,i,en,ou,nt,f) {
 var zn = document.getElementById("Idzonas").value; 	
 if (ou < 3){
   document.getElementById("nId"+ou).innerHTML = "Espere por favor ..."; 		
 }
  document.getElementById("nId"+en).innerHTML = n;
  document.getElementById("Id"+en).value = i;
  document.getElementById("IDwesq").style.display="none";
  xajax_ProcessSelectZonas2(i,en,ou,nt,f,'');
 
}

function enviarPopUp(f,u,w,h,s,r){
  document.getElementById(f).action = r+"_previo.php";
  document.getElementById(f).method = "POST";
  document.getElementById(f).target="nueva";
  openWin(u,w,h,s,'nueva');
  document.getElementById(f).submit();
}

function openWin(URL,w,h,s,t) {
	window.open(URL,t,"top=0,left=0,toolbar=no,width="+w+",height="+h+",status=yes,scrollbars="+s+",resize=no,menubars=no");
}

function ViewDetalle(w,h,d,i,f){
   var vTitulo = f;
   var VInput = document.getElementById("IdInputForm").value;
   
   document.getElementById("IDwesq").style.display="block";
   document.getElementById("wcontbl").innerHTML="<div style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></div>";
   document.getElementById("hc-window").innerHTML= vTitulo;
   document.getElementById("IDwesq").style.width=w+"px";
   document.getElementById("dwindowcontent").style.height=h+"px";
   document.getElementById("dbodycontent").style.height=h+"px";
    if (VInput==1){
		document.getElementById("IDwesq").style.padding="0px 0px 0px 310px";
		document.getElementById("wcontbl").innerHTML = document.getElementById("Div"+i).value;
		
	}else{
      xajax_ProcessViewDetalle(xajax.getFormValues("IdFormAdminConfiguracion"),i,d);
	}

}

function ContenidoEdt(i,t){
 document.getElementById("idtrarget").innerHTML = "<textarea name=\"texto_menusV\" cols=\"85\" rows=\"25\" id=\"idtexto_menusV\" style=\"border:1px #FFFFFF solid; width:444px;overflow:hidden\"></textarea>";
 xajax_processEditarView(xajax.getFormValues('IdFormAdminConfiguracion'),t,i,'2')
}

function addarchivo(MDuse,VNumOpt){
   
  // Vimg =  document.getElementById("IdCenitem").value;
   document.getElementById("IDwesq").style.display="block";
   document.getElementById("IDwesq").className= "centrar";
   document.getElementById("wcontbl").innerHTML="<div style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></div>";
   document.getElementById("IDwesq").style.width="328px";
   document.getElementById("hc-window").innerHTML="Adicionar "+MDuse;
   document.getElementById("hc-window").style.width="310px";
   document.getElementById("wcenter").style.width="328px";
   document.getElementById("dwindowcontent").style.height="98px";
   document.getElementById("dbodycontent").style.height="98px";
   document.getElementById("dbodycontent").style.overflow="hidden";
   xajax_AgregarArchivo(xajax.getFormValues("IdFormAdminConfiguracion"),VNumOpt,'');
}



function addimagen(MDuse,VNumOpt){
   
  // Vimg =  document.getElementById("IdCenitem").value;
   document.getElementById("IDwesq").style.display="block";
   document.getElementById("IDwesq").style.width="330px";
   document.getElementById("wcontbl").innerHTML="<div style='background-color:red;width:78px; padding: 2px 2px 2px 2px;' align=left><font color=#ffffff><b>Cargando...</b></font></div>";
   document.getElementById("hc-window").innerHTML="Adicionar "+MDuse;
   document.getElementById("hc-window").style.width="310px";
   document.getElementById("wcenter").style.width="328px";
   document.getElementById("w-header-title").style.width="320px";
   document.getElementById("dwindowcontent").style.height="98px";
   document.getElementById("dbodycontent").style.height="98px";
   document.getElementById("dbodycontent").style.width="310px";
   document.getElementById("dbodycontent").style.overflow="hidden";
   xajax_AgregarImagen('',VNumOpt,'');
}

function enviarArchivo(f){
  document.getElementById("IdFormAdminPago").action = "insertar_archivo.php";
  document.getElementById("IdFormAdminPago").target = "Iaimagen";
  document.getElementById("IdFormAdminPago").method = "POST";
  document.getElementById("IdFormAdminPago").enctype = "multipart/form-data";
  document.getElementById("IdFormAdminPago").submit();
}

function enviarimagen(f){
  document.getElementById(f).action = "insertar_imagen.php";
  document.getElementById(f).target = "Iaimagen";
  document.getElementById(f).method = "post";
  document.getElementById(f).enctype = "multipart/form-data";
  document.getElementById(f).submit();
}


function closeit(CT){
 document.getElementById("wcontbl").innerHTML = "";	
 if (CT=="AL"){
	var IfrRef = document.getElementById('DivShim');
	var m = document.getElementById("IdvvDominio").value;
	var i = document.getElementById("Idid").value;
	IfrRef.style.display = "none";
    document.getElementById("IDwesq").style.display="none";
	
  if (!m){    
	if (i){
	  document.getElementById(i).style.background = "#ffffff";
	  document.getElementById("Idid").value = "";
	}
  }
  //xajax_ValidarImagen(xajax.getFormValues("IDFormViseteca"));
 }
 
 if (CT=="IM"){
     document.getElementById("IDwesq").style.display="none";
	  if (navigator.appVersion.indexOf("MSIE 6.0") != -1){ 
   	     document.getElementById("DivShim").style.display="none";
      }
     //xajax_AgregarLocalidad(xajax.getFormValues("IDFormLocalidad"),CT);   
 }
 
 if (CT=="salir"){
   //xajax_processSalir();
 }
}  


function esNum(e) {
var charCode
if (navigator.appName == "Netscape") // Veo si es Netscape o Explorer (mas adelante lo explicamos)
charCode = e.which // leo la tecla que ingreso
else
charCode = e.keyCode // leo la tecla que ingreso
status = charCode
if (charCode > 31 && (charCode < 48 || charCode > 57)) { // Chequeamos que sea un numero comparandolo con los valores ASCII
  alert("Caracter no permitido...")
  return false
}

return true
}

function esEspacio(e) {
var charCode
if (navigator.appName == "Netscape") // Veo si es Netscape o Explorer (mas adelante lo explicamos)
charCode = e.which // leo la tecla que ingreso
else
charCode = e.keyCode // leo la tecla que ingreso
status = charCode
if (charCode == 32 ) { // Chequeamos que No sea espacio
  alert("Caracter no permitido...")
  return false
}

return true
}

function submitLogin()
  {
    missinginfo = "";
	text = document.getElementById('adlogin').value;
	text = text.replace (/ /g, '');
	numCharacters = text.length;
	
	text2 = document.getElementById('adpassword').value;
	text2 = text2.replace (/ /g, '');
	numCharacters2 = text2.length;

	if ((text == "")||(text2 == "")) {
  		missinginfo += "\n Estos campos no debe estar en blanco";
 	}else{
   		if((numCharacters < 5)||(numCharacters2 < 5)){
     		missinginfo += "\n El numero de caracteres escrito no es correcto";
   		}

	}

	if (missinginfo != "") {
 		document.getElementById('IDmensajeForm').innerHTML = "<font color='red'>"+missinginfo+"</font>";
	}else{ 
	    submitLoginVal();
	}
	
  }


function submitLoginVal()
  {
    xajax.$('submitButton').disabled=true;
    xajax.$('submitButton').value="por favor espere...";
	xajax_processLogin(xajax.getFormValues('IdFormAdminConfiguracion'));
	
  }
  
function IsNumeric(valor) 
{ 
var log=valor.length; var sw="S"; 
for (x=0; x<log; x++) 
{ v1=valor.substr(x,1); 
v2 = parseInt(v1); 
//Compruebo si es un valor numérico 
if (isNaN(v2)) { sw= "N";} 
} 
if (sw=="S") {return true;} else {return false; } 
} 

var primerslap=false; 
var segundoslap=false; 
function formateafecha(fecha) 
{ 
var long = fecha.length; 
var dia; 
var mes; 
var ano; 

if ((long>=2) && (primerslap==false)) { dia=fecha.substr(0,2); 
if ((IsNumeric(dia)==true) && (dia<=31) && (dia!="00")) { fecha=fecha.substr(0,2)+"/"+fecha.substr(3,7); primerslap=true; } 
else { fecha=""; primerslap=false;} 
} 
else 
{ dia=fecha.substr(0,1); 
if (IsNumeric(dia)==false) 
{fecha="";} 
if ((long<=2) && (primerslap=true)) {fecha=fecha.substr(0,1); primerslap=false; } 
} 
if ((long>=5) && (segundoslap==false)) 
{ mes=fecha.substr(3,2); 
if ((IsNumeric(mes)==true) &&(mes<=12) && (mes!="00")) { fecha=fecha.substr(0,5)+"/"+fecha.substr(6,4); segundoslap=true; } 
else { fecha=fecha.substr(0,3);; segundoslap=false;} 
} 
else { if ((long<=5) && (segundoslap=true)) { fecha=fecha.substr(0,4); segundoslap=false; } } 
if (long>=7) 
{ ano=fecha.substr(6,4); 
if (IsNumeric(ano)==false) { fecha=fecha.substr(0,6); } 
else { if (long==10){ if ((ano==0) || (ano<1900) || (ano>2100)) { fecha=fecha.substr(0,6); } } } 
} 

if (long>=10) 
{ 
fecha=fecha.substr(0,10); 
dia=fecha.substr(0,2); 
mes=fecha.substr(3,2); 
ano=fecha.substr(6,4); 
// Año no viciesto y es febrero y el dia es mayor a 28 
if ( (ano%4 != 0) && (mes ==02) && (dia > 28) ) { fecha=fecha.substr(0,2)+"/"; } 
} 
return (fecha); 
} 

function checkdisclaimer(){
   var allok=true;
   var radgrp1=document.login.cond1;
   var alertext="";
   if (document.login.email.value.length<1) {alertext=alertext+"- Por favor, escribe tu dirección de correo electrónico \n"; allok= false;}
   if (document.login.pass.value.length<1) {alertext=alertext+"- Por favor, escríbe tu contraseña \n"; allok= false;}
   if (allok==false){alert("Atención: \n"+alertext);}
   return allok;
}


function uno(src,color_entrada) { 
    src.bgColor=color_entrada;src.style.cursor="hand"; 
} 
function dos(src,color_default) { 
    src.bgColor=color_default;src.style.cursor="default"; 
} 

