//var xmlHttpObject = init_object();
//var xmlHttpObject = false;

var xmlHttpObject = false;

if(typeof XMLHttpRequest != 'undefined') xmlHttpObject = new XMLHttpRequest();

if(!xmlHttpObject){

	try{
	
		xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
	
	}catch(e){
	
		try{
		
			xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
		
		}
		
		catch(e){
		
			xmlHttpObject = null;
		
		}
	
	}

}

function sendContent(action,param,val){

	var params = "";
	
	for(i = 0;i < param.length;i++){
	
		params+= param[i]+"="+escape(val[i]);
		
		if(i + 1 < param.length) params+= "&";
	
	}
	
	xmlHttpObject.open("POST",action,true);
	xmlHttpObject.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlHttpObject.setRequestHeader("Content-length", params.length);
	xmlHttpObject.setRequestHeader("Connection","close");
	xmlHttpObject.onreadystatechange = handleContent;
	xmlHttpObject.send(params);
	
	return false;

}

function loadContent(method,action){//,handle

	//if(xmlHttpObject == false) xmlHttpObject = init_object();
	
	xmlHttpObject.open(method,action);
	//xmlHttpObject.setRequestHeader("Content-Type", "text/javascript;charset=UTF-8");
	xmlHttpObject.onreadystatechange = handleContent;
	xmlHttpObject.send(null);
	
	return false;

}

function handleContent(){

	if(xmlHttpObject.readyState == 4){
	
		//alert(xmlHttpObject.responseText);
		//document.getElementById("err").innerText = xmlHttpObject.responseText;
		eval(xmlHttpObject.responseText);
	
	}

}

/*function init_object(){

	xho = false;
	
	if(typeof XMLHttpRequest != 'undefined') xho = new XMLHttpRequest();
	
	if(!xho){
	
		try{
		
			xho = new ActiveXObject("Msxml2.XMLHTTP");
		
		}catch(e){
		
			try{
			
				xho = new ActiveXObject("Microsoft.XMLHTTP");
			
			}
			
			catch(e){
			
				xho = null;
			
			}
		
		}
	
	}
	
	return xho;

}*/

