// Validación de la Forma De soporte Técnico 

//Checar campos no vacíos , contador de caracteres.

function checkSupport(theForm){	  
	 
	  if (theForm.sistema.value == "Seleccione"){
	     alert('Debes seleccionar el sistema');
	     theForm.sistema.focus();
		 return false;
	  }  
	 
	  if(!theForm.Hotel.value){
	  	alert('Debes Proporcionar el Nombre del Hotel');
		theForm.Hotel.focus();
		return false;
	  	
	  }  
	
	  if(!theForm.Comentario.value){
	  	alert('Debes Proporcionar un Comentario');
		theForm.Comentario.focus();
		return false;
	  	
	  } 
	  
	  if(!theForm.reporta.value){
	  	alert('Debes proporcionar el Nombre de quien Reporta');
		theForm.reporta.focus();
		return false;
	  	
	  }  
	  
	  apos=theForm.email.value.indexOf("@")
	  dotpos=theForm.email.value.lastIndexOf(".")
	  if (apos<1||dotpos-apos<2){ 
		 alert("Debes proporcionar una dirección de correo válida");
		 theForm.email.focus();
		 return false;
			
	  }
	 
	  if(!theForm.email.value){
	  	alert('Debes proporcionar un Email');
		theForm.email.focus();
		return false;
	  	
	  } 
	  
	    return true;	  
  }
  
  
  //Caracter Count
  
  
  function update(){
      var old3 = document.form1.count.value;
      document.form1.count.value = document.form1.Comentario.value.length;
   
   	  if(document.form1.count.value > 400 && old3 <= 400) {
         alert('Demasiados Datos en Comentario ! Max Caracteres = 400');
         if(document.styleSheets) {
         document.form1.count.style.fontWeight = 'bold';
         document.form1.count.style.color = '#ff0000'; 
	     } 
      }
      else if(document.form1.count.value <= 400 && old3 > 400 && document.styleSheets ) {
       document.form1.count.style.fontWeight = 'normal';
       document.form1.count.style.color = '#000000'; 
	  } 
   }
   
   
   // File Upload
   
   
function fileupld(){
	if(document.form1.filechk.checked)
    	document.form1.userfile.disabled = false;

    else
		document.form1.userfile.disabled = true;
	
	}
