function LoggingNeo(){
}

LoggingNeo.getDomain = function (){
	var domain;
	domain=location.href;
	domain=domain.split("//");
	domain="http://"+domain[1].substr(0,domain[1].indexOf("/"));
	return domain;
}

LoggingNeo.getContextPath = function(){
	var domain;
	domain=location.href;
	domain=domain.split("//");
	var context = domain[1].split("/");
	var path ="http://"+domain[1].substr(0,domain[1].indexOf("/")) + "/" + context[1] + "/";
	return path;
}

var httpRequest = null;

LoggingNeo.getXHR = function(){	
	if(window.ActiveXObject){
		try{
			return new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				return new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e1){
				return null;
			}
		}
	}else if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else{
		return null;
	}
	
}

LoggingNeo.sendRequest = function(url, params, callback, method){
	httpRequest = LoggingNeo.getXHR();
	
	var httpMethod = method ? method : 'GET';
	if(httpMethod != 'GET' && httpMethod != 'POST'){
		httpMethod = 'GET';
	}
	
	var httpParams = (params == null || params == "") ? null : params
	var httpUrl = url;
	if(httpMethod == 'GET' && httpParams != null){
		httpUrl = httpUrl + "?" + httpParams;
	}

	httpRequest.open(httpMethod, httpUrl, false);
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	httpRequest.onreadystatechange = callback;
		
	httpRequest.send(httpMethod == 'POST' ? httpParams : null);

}