  <!--



function changeOffline2()

{

  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 CheckPage2()

	{

	   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.toUpperCase() + ' ' + lastname.value.toUpperCase();

       
		nResult += NotEmpty( nResult, 'Mobile','Telefono Movil' );

		if(nResult == 1)

		{

			return;

		}





		nResult += NotEmpty( nResult, 'City','Ciudad' );

		if(nResult == 1)

		{

			return;

		}
var city = document.getElementById( 'City' );	
		city.value = city.value.toUpperCase();

var country = document.getElementById( 'Country' );	
		country.value = country.value.toUpperCase();


	    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( 'formCandidate2' );

			 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() {}

  -->


