 <!--
function trimAll(sString){
while (sString.substring(0,1) == ' '){
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' '){
sString = sString.substring(0,sString.length-1);
}
return sString;
}
function checkformsurgeon(){
var form = document.getElementById( 'formCandidate' );
var firstname = document.getElementById( 'first_name' );
var lastname = document.getElementById( 'last_name' );
var company_new =document.getElementById('company');
document.getElementById('company').value=firstname.value + ' ' + lastname.value;
}
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('estatura') != null){

nResult += isNumeric( nResult, 'estatura','Estatura','centimetros'); 
if(nResult == 1){
return;
}
nResult += isNumeric( nResult, 'peso','Peso','Kilogramos'); 
if(nResult == 1){
return;
}
}



nResult += Email( nResult, 'email','Email' );
if(nResult == 1){ 
return;
}
if (1){
var el = document.getElementById('formCandidate');
if (typeof(el)=='object' && el != null ) el.submit();
}
}



function isNumeric(old_res,id,field_title,medida) {
if (old_res==0){
var el = document.getElementById( id );
if (typeof(el)=='object' && el!=null)
if (trimAll(el.value) == ''){
alert('Por favor llena el campo "' + field_title + '"' );
return 1;
}if ( isNaN(el.value) == true){
alert('Ingrese su ' + field_title + ' en ' + medida)	;
return 1; 
}
if ( isNaN(el.value) == false){
el.value=Math.round(el.value);
}	
}	
return 0;
}


function NotEmpty(old_res, id, field_title){
if (old_res==0){
var el = document.getElementById( id );
if (typeof(el)=='object' && el!=null)
 	if (trimAll(el.value) == ''){
 alert( 'Por favor llena el campo "' + field_title + '"' );
 	return 1;
}
}
return 0;
}
function Email(old_res, id, field_title){
if ( old_res==0 ){
        var el = document.getElementById( id );

        if (el != null && trimAll(el.value) == '' )
        {
           alert( 'Por favor llena el campo email correctamente' );
           return 1;
        }

        if (el != null && trimAll(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( 'Por favor llena el campo email correctamente' );
              return 1;
           }
        }
     }
     return 0;
  }
function nothing() {}
