  <!--

function changeOffline()
{
  var isOffline = document.getElementById('LiveHelpStatus_1').height;
  if(isOffline == 75)
  {
    document.getElementById( 'livechatLink' ).href="http://www.doctorbarbato.com/contacto/cirujano-plastico-cali/doctor-carlos-barbato.html";
    document.getElementById( 'livechatLink' ).target="";
    document.getElementById( 'livechatLink' ).onclick="";
  }
 setTimeout( function(){ changeOffline(); }, 4000 );
  
}

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 CheckPage()
	{
	   var nResult = 0;

		nResult += NotEmpty( nResult, 'first_name','Nombre' );
		if(nResult == 1)
		{
			return;
		}

		nResult += NotEmpty( nResult, 'last_name','Apellidos' );
		if(nResult == 1)
		{
			return;
		}
		
		var name = document.getElementById( 'first_name' );
		var lastname = document.getElementById( 'last_name' );	
		var company = document.getElementById( 'company' );	
		company.value = name.value + ' ' + lastname.value;

		nResult += NotEmpty( nResult, 'mobile','Telefono Movil' );
		if(nResult == 1)
		{
			return;
		}


		nResult += NotEmpty( nResult, 'city','Ciudad' );
		if(nResult == 1)
		{
			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 (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 ( trimAll(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 (el != null && trimAll(el.value) == '' )
        {
           alert( '"'+field_title+'" debe ser un email' );
           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( '"'+field_title+'" debe ser un email' );
              return 1;
           }
        }
     }
     return 0;
  }

function nothing() {}
  -->

