/* The following function creates an XMLHttpRequest object... */
function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

var http = createRequestObject(); 
//This is the name of the element whose innerHTML is changed.
var element_id;
var second_function = '';

//This is the generic ajax handler
function handle_functions(){
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById(element_id).innerHTML = response;
		if(second_function != ''){
			do_this = second_function;
			second_function = '';
			eval(do_this + '()');
		}
	}
}

function change_service_form(x){
	http.open('get', '/pm_process.php?action=change_service_form&what_form='+x);
	element_id = 'service_search';
	http.onreadystatechange = handle_functions;
	http.send(null);
}