//µ¿ÀûÀ¸·Î httpRequest¸¦ ¿äÃ»ÇÑ´Ù(±âÁ¸ÀÇ ¾ÖÇÃ¸´À» ´ëÃ¼ÇÏ´Â ½ºÅ©¸³Æ®)
function DinamicHttpPost(strURL, strSubmit, strResultFunc, param) {
	//alert("111"+strURL);
    var xmlHttpReq = false;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
    	
            xmlHttpReq = new XMLHttpRequest();
            //xmlHttpReq.overrideMimeType('text/xml');//ie 7¿¡¼­ ¿¡·¯°¡ ¹ß»ýÇØ¼­ Á¦°Å
    }
    // IE
    else if (window.ActiveXObject) {
    	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }

	xmlHttpReq.open('POST', strURL, true);
	xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttpReq.onreadystatechange = function() {
    	var strResponse;
    	if (xmlHttpReq.readyState == 4) {
			strResponse = xmlHttpReq.responseText;
			//exception Ã³¸®
			switch (xmlHttpReq.status) {
		       // Page-not-found error
		       case 404:
		               alert('Error: Not Found. The requested URL ' + strURL + ' could not be found.');
		               break;
		       // Display results in a full window for server-side errors
		       case 500:
		               handleErrFullPage(strResponse);
		               break;
		       default:
		               // Call JS alert for custom error or debug messages
		               if (strResponse.indexOf('Error:') > -1 || strResponse.indexOf('Debug:') > -1) {
		                       alert(strResponse);
		               }else {
		               // Call the desired result function
		                      eval(strResultFunc + "(xmlHttpReq.responseText,'"+param+"');");
		               }
		               break;
			}
        }
    }
    
    xmlHttpReq.send(strSubmit);
}
