//---------------------------------------------------------------------------------------------------------------------------------
// Function  : CreateXmlHttpRequest
// Does      : 브라우저에 상관없이 XMLHttpRequest 객체를 생성해주는 function.
// Access    : public
// Parameters: void
// Returns   : XMLHttpRequest 객체. 만약 객체 생성에 실패하면 null을 반환한다. 그러나 일반적인 웹브라우저에서는 그럴 일이 없다.
// Exception : none
// Revised   : 2006-08-25
function CreateXmlHttpRequest() {
	var XmlHttpRequest;

	// XMLHttpRequest 객체 생성. MSIE를 제외한 브라우저의 경우를 위해서이다.
	try {
		XmlHttpRequest = new XMLHttpRequest();
		return XmlHttpRequest;
	}
	catch (ex) {
	}
	
	// MSIE의 경우에는 ActiveXObject로 생성.
	try {
		XmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		return XmlHttpRequest;
	}
	catch (ex) {
	}

	return null;
}

//---------------------------------------------------------------------------------------------------------------------------------
// Function  : AddQueryString
// Does      : "Name1=Value1&Name2=Value2"와 같은 query string에 파라미터를 추가해주는 function.
//             GET 방식과 POST 방식(URL-ENCODED인 경우) 모두에 사용할 수 있다.
// Access    : public
// Parameters: QueryStr			"Name=Value"를 추가하려는 query string.
// Returns   : 기존의 QueryStr에 새로운 "이름=값"이 추가된 query string.
// Exception : none
// Revised   : 2006-04-27
function AddQueryString(QueryStr, ParamName, ParamValue) {
	if (QueryStr.length > 0)
		QueryStr += "&";
		
	return QueryStr + encodeURIComponent(ParamName) + "=" + encodeURIComponent(ParamValue);
}
