/**
 *  this connect to the webservice via ajax and 
 *  display result on the form frontend
 */

//function that starts the ajax process:
function processlogout(itemcount,userresponse)
{	
		
			//call the php script
			//use the get method
			//pass the totalitem in the url	
			var theurl = 'logout.php?toclear='+userresponse;
			
			
			$.ajax({   
				  type: "GET",   
				  url: theurl,     
				  success: function() {   
					  window.location.href="logout.php";
				  }   
				});   
				return true; 			
}



//function that handles the response
function handle_logout()
{
	//if everything is ok
	if((ajax.readyState == 4)&& (ajax.status == 200))
	{		
		//assign the returned value to a document
		var logoutresult = ajax.responseText;	
		var data = eval('(' + logoutresult + ')');
		
		//log user out
		window.location.href="logout.php";
	}
}



