//validacion envio email de comentario o requerimiento principal
function validar()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
  	document.getElementById('email').value="";
	document.getElementById('email').focus();
	}
	if (document.getElementById('comentario').value == "") 
    {
    error += "- Comentario o Requerimiento es obligatorio no puede quedar vacio\n";
	document.getElementById('comentario').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//validacion formulario de contratacion de servicio hosting
function validar1()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('plan').value == "") 
    {
    error += "- Debe seleccionar un plan de hosting\n";
	document.getElementById('plan').focus();
    } 
	if (document.getElementById('dominio').value == "") 
    {
    error += "- Nombre de dominio es Obligatorio\n";
	document.getElementById('dominio').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 


//validacion formulario de contratacion de servicio resseller
function validar2()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
   	if (document.getElementById('username').value == "") 
    {
    error += "- Campo Username es obligatorio no puede quedar vacio\n";
	document.getElementById('username').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('plan').value == "") 
    {
    error += "- Debe seleccionar un plan de resseller\n";
	document.getElementById('plan').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//validacion formulario de contratacion diseño web
function validar3()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	  	document.getElementById('email').value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('plan').value == "") 
    {
    error += "- Debe seleccionar un plan de diseño web\n";
	document.getElementById('plan').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//validacion formulario de contratacion emailing
function validar4()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
    if (document.getElementById('empresa').value == "") 
   {
       error += "- Nombre de su Empresa es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('empresa').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('plan').value == "") 
    {
    error += "- Debe seleccionar un plan de Emaling\n";
	document.getElementById('plan').focus();
    } 
		if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//validar ingreso para accder a servicios server
function validar5() {
 if (document.getElementById('user').value == "") 
	{
	alert ("Debe Ingresar Su Nombre de Usuario");
	document.form2.user.focus();return;
	}
 if (document.getElementById('pass').value == "") 
	{
	alert ("Debe Ingresar Su Clave Personal");
	document.form2.pass.focus();return;
	} 
document.form2.submit();
} 


//validacion formulario de contratacion de servicio hosting
function validar6()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('modulo').value == "") 
    {
    error += "- Debe seleccionar un módulo extra\n";
	document.getElementById('modulo').focus();
    } 
	if (document.getElementById('dominio').value == "") 
    {
    error += "- Nombre de dominio es Obligatorio\n";
	document.getElementById('dominio').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//validacion envio email para activacion de streaming
function validar15()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
   	if (document.getElementById('radio').value == "") 
    {
    error += "- Campo nombre radio es obligatorio no puede quedar vacio\n";
	document.getElementById('radio').focus();
    } 
   	if (document.getElementById('web').value == "") 
    {
    error += "- Campo dirección web es obligatorio no puede quedar vacio\n";
	document.getElementById('web').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
  	document.getElementById('email').value="";
	document.getElementById('email').focus();
	}
	if (document.getElementById('comentario').value == "") 
    {
    error += "- Comentario o Requerimiento es obligatorio no puede quedar vacio\n";
	document.getElementById('comentario').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 

//FUNCION PARA ACEPTAR EL INGRESO SOLO DE NUMEROS
function validarNum( e ) {
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
//    patron =/[A-Za-z\s]/; // solo letras
	patron = /\d/; // Solo acepta números
//	patron = /\w/; // Acepta números y letras
//	patron = /\D/; // No acepta números
//	patron =/[A-Za-zñÑ\s]/; // acepta letras y también las letras ñ y Ñ
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
} 

//VALIDA PARA ACEPTAR EL INGRESO SOLO LETRAS
function validarLetras(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
//    patron =/[A-Za-z\s]/; // solo letras
//	patron = /\d/; // Solo acepta números
//	patron = /\w/; // Acepta números y letras
//	patron = /\D/; // No acepta números
	patron =/[A-Za-zñÑ\s]/; // acepta letras y también las letras ñ y Ñ
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
} 

//detectar mayusculas activado
function capLock1(e){
  kc=e.keyCode?e.keyCode:e.which;
  sk=e.shiftKey?e.shiftKey:((kc==16)?true:false);
  if(((kc>=65&&kc<=90)&&!sk)||((kc>=97&&kc<=122)&&sk))
    document.getElementById('caplock').style.visibility = 'visible';
  else document.getElementById('caplock').style.visibility = 'hidden';
}


//valicacion formulario contacto para publicidad

function validarf()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
  	document.getElementById('email').value="";
	document.getElementById('email').focus();
	}
	if (document.getElementById('comentario').value == "") 
    {
    error += "- Comentario o Requerimiento es obligatorio no puede quedar vacio\n";
	document.getElementById('comentario').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
	return true;
} 

//valida formulario de suscripcion a boletines
function validarg()
{
   var error="";
   if (document.getElementById('txtnombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio \n"; 
	   document.getElementById('txtnombre').focus();
   }
   if (document.getElementById('txtemail').value == "") 
   {
       error += "- Email es obligatorio \n"; 
	   document.getElementById('txtemail').focus();
   }
	if (document.getElementById('txtemail').value.indexOf('@', 0) == -1 ||
        document.getElementById('txtemail').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
  	document.getElementById('txtmail').value="";
	document.getElementById('txtemail').focus();
	}
	if(error !="") 
   {
	   alert(error);
	   return false;
   }
	return true;
} 

//valida formulario de desususcripcion a boletines
function validarh()
{
   var error="";
   if (document.getElementById('txtemail1').value == "") 
   {
       error += "- Email es obligatorio \n"; 
	   document.getElementById('txtemail1').focus();
   }
	if (document.form2.txtemail1.value.indexOf('@', 0) == -1 ||
    document.form2.txtemail1.value.indexOf('.', 0) == -1)
	{ 
	alert("Dirección de Email Inválida debe contener @ @ y la Extensión 3 Caracteres"); 
	document.form2.txtemail1.value="";
	document.form2.txtemail1.focus();
	}
	if(error !="") 
   {
	   alert(error);
	   return false;
   }
	return true;
} 


window.onload=menu;

function menu() {
  if (document.all&&document.getElementById && !window.opera) {
    
	navRoot = document.getElementById("menu");
    if (navRoot) {
      for (i=0; i<navRoot.childNodes.length; i++) {
   	    node1 = navRoot.childNodes[i];
       	if (node1.nodeName=="UL") {
	      for (j=0; j<node1.childNodes.length; j++) {
    	    node2 = node1.childNodes[j];
        	if (node2.nodeName=="LI") {
	          node2.onmouseover=function() {
    	        this.className+=" over";
        	  }
	          node2.onmouseout=function() {
    	        this.className=this.className.replace(" over", "");
        	  }
    } } } } }
	
} }


//validacion formulario compra computador
function validar7()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('equipo').value == "") 
    {
    error += "- Debe seleccionar un Tipo de Computador\n";
	document.getElementById('equipo').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 



//validacion formulario compra laptop
function validar8()
{
   var error="";
   if (document.getElementById('nombre').value == "") 
   {
       error += "- Nombre y Apellido es obligatorio no puede quedar vacio\n"; 
	   document.getElementById('nombre').focus();
   }
   if (document.getElementById('ciudad').value == "") 
   {
    error += "- Ciudad es obligatorio no puede quedar vacio\n";
	document.getElementById('ciudad').focus();
   }
   	if (document.getElementById('telefono').value == "") 
    {
    error += "- Campo Número Telefónico es obligatorio no puede quedar vacio\n";
	document.getElementById('telefono').focus();
    } 
	if (document.getElementById('email').value == "") 
    {
    error += "- Campo Email es obligatorio no puede quedar vacio\n";
	document.getElementById('email').focus();
    }
	if (document.getElementById('email').value.indexOf('@', 0) == -1 ||
        document.getElementById('email').value.indexOf('.', 0) == -1)
	{
    error += "- Dirección de Email Inválida debe Contener @ y la Extensión 3 caracteres\n";
	document.form1.email.value="";
		document.getElementById('email').focus();
	}
	if (document.getElementById('equipo').value == "") 
    {
    error += "- Debe seleccionar una Laptop\n";
	document.getElementById('equipo').focus();
    } 
	if (document.getElementById('code').value == "") 
    {
    error += "- Código de Seguridad es obligatorio no puede quedar vacio\n";
	document.getElementById('code').focus();
    } 
   if(error !="") 
   {
	   alert(error);
	   return false;
   }
document.form1.submit();
} 
