	
	var isIE = false;
	
	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"){
			isIE = true;
			/* 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();
	var global_username_check = '';
	
	function checkUserName(email) {
		var url, pars;
		
		url = './modules/mo_ajax_check_email.php?';
		pars = 'email=' + email;
		
		http.open('post', url+pars);
		http.onreadystatechange = handleUserName;
		http.send(null);
	}
	
	function handleUserName() {
		var response;
		
		if(http.readyState == 4){
	
			if (http.status == 200) {
				
				response = http.responseText;
					
				if(response!=0) {
					global_username_check = 'error';
				}
				else {
					global_username_check = '';
				}
					
			}
		
		}
	}		
	
	