// JavaScript Document
var t;
var prof;
var msg;
$(document).ready(function() {
	prof = $("#ajax_professional_holder");
	msg = $("#loadingMsg");
	t=setTimeout("ajax(null)", 5000);
	$("#nextProfessional").click(ajax);


 }); //document.ready


function ajax(e){
	clearTimeout(t);
	if(e) e.preventDefault();
	prof.fadeOut("slow",function(){
		
		var newHtml = $.ajax({
		  async:false,
		  url: "/en/js/ajaxProfessional.aspx",
		  cache: false,
			error: function(){
				alert('Error loading XML document');
			},
		 beforeSend: function(){
		  	msg.html("<div class=\"loader\"><img src=\"/images/loading.gif\" width=\"32\" height=\"32\" /></div>");
		  },		  
		  success: function(html, status){
			
			prof.html(html);
			msg.html("");
			prof.fadeIn("slow");
			t=setTimeout("ajax(null)", 5000);
		  }
		}).responseText;
	
	}); // prof.fadeOut
 }
