﻿  <!--  
  
	function CheckPage()
	{
	   var nResult = 0;

		nResult += NotEmpty( nResult, 'first_name','Nombre' );			
		if(nResult == 1)
		{
			return;
		}
		
		nResult += NotEmpty( nResult, 'last_name','Apellidos' );		
		if(nResult == 1)
		{
			return;
		}
		
		nResult += NotEmpty( nResult, 'mobile','Telefono Movil' );																
		if(nResult == 1)
		{
			return;
		}	
	
		
		nResult += NotEmpty( nResult, 'city','Ciudad' );																									  																														  
		if(nResult == 1)
		{
			return;
		}

/*
  if (  document.getElementById('surgeon').selectedIndex == 0 )
    {
        alert ( "Por favor seleccione uno de nuestros Cirujanos Plasticos." );
		return;        
    }

*/
	    nResult += NotEmpty( nResult, 'description','Cuentenos su caso, sea por favor especifico' );
		if(nResult == 1)
		{
			return;
		}
	    
	    nResult += Email( nResult, 'email','Email' );
		if(nResult == 1)
		{
			return;
		}
	    
/*
		if(document.getElementById('interested').checked == false)
		{
			alert('Por favor, seleccione la opción: Estoy interesado(a) en el procedimiento ');
			return;
		}	
		if(document.getElementById('sendinfo').checked == false)
		{
			alert('Por favor, seleccione la opción: Me pueden llamar y enviar información');
			return;										
		}								
*/
																								
		  if (1)
		  {		
			 var el = document.getElementById( 'formCandidate' );
			 if ( typeof(el)=='object' && el != null ) el.submit();
		  }

	}



  function NotEmpty( old_res, id, field_title )
  {
     if ( old_res==0 )
     {
        var el = document.getElementById( id );
        if ( typeof(el)=='object' && el!=null )
          if ( el.value=='' )
          {
             alert( 'Usted debe escribir "' + field_title + '"' );
             return 1;
          }
     }
     return 0;
  }
  function Email( old_res, id, field_title )
  { 
     if ( old_res==0 )
     {
        var el = document.getElementById( id );
        if ( typeof(el)=='object' && el!=null && el.value!='' )
        {
           var re = /^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9][a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/;
                                                        
           if (el.value.search(re) != -1 )  return 0;
           else
           {
              alert( '"'+field_title+'" debe ser un email' );
              return 1;
           }
        }
     }
     return 0;
  }                                                                                                                 

function nothing() {}
  -->

