// CREATE the XMLHttpRequest ActiveX Object
function AjaxCore_createXMLHttpRequest_CJIJ(){

	var reqHttp;
	if (window.ActiveXObject) {
		try{
			reqHttp = new ActiveXObject("Msxml2.XMLHTTP");	//after IE 5.0 browser
		}catch(e1){
			try{
				reqHttp = new ActiveXObejct("Microsoft.XMLHTTP");
			}catch(e){
				reqHttp = null;
			}
		}
	} else if (window.XMLHttpRequest){
		
		try{
			reqHttp = new XMLHttpRequest();
		}catch(e2){
			reqHttp = null;
		}
	}

	if (reqHttp == null) errorMessage();	//unable XMLHTTPRequest..
	
	return reqHttp;
}

// Check the readyState and status
function AjaxCore_openSendStatus_CJIJ(getorpost, urlfileapp, trueoffalse, senddata, callbackFunction){
	
	var xmlHttp = AjaxCore_createXMLHttpRequest_CJIJ();	// CREATE XMLHttpRequest
	xmlHttp.open(getorpost, urlfileapp, trueoffalse);	//1:transfer method, 2:url, 3:Asynchronous or synchronous
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4){	//server status
			if(xmlHttp.status == 200){	//response status
				if(callbackFunction != null){
					callbackFunction(xmlHttp);
				}
			}else{
				AjaxCore_exceptionControl_CJIJ(xmlHttp);
			}
		}
	}
	var conType = "application/x-www-form-urlencoded;";
	xmlHttp.setRequestHeader("Content-Type", conType);
	xmlHttp.send(senddata);
}

function AjaxCore_errorHandler_CJIJ(){
	//do something.. alert("unable Browser, change to IE or FireFox or Opera..and so on");
}

function AjaxCore_exceptionControl_CJIJ(xmlHttp){
	//do something.. example. It's The fail between sever to client browser response transfer
}

function AjaxCore_commAddListener(paramObject, paramType, paramFunction, paramFalse){
	if(paramObject.attachEvent){
		paramObject.attachEvent("on"+paramType, paramFunction);
	}else{
		paramObject.addEventListener(paramType. paramFunction, paramFalse);
	}
}