/**
 * @xmlHttp.js (Ajax °øÅë ½ºÅ©¸³Æ®)
 * @version 1.0, 2007-12-14
 * @author Yoon Tae Hyun ( thrukill@nate.com )
*/
var xmlHttp;
var userFunction;

function createXMLDocRequest(fXml) {
    var xmlDoc;
    if (window.ActiveXObject) {
        xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
    } else if (window.XMLHttpRequest) {
        xmlDoc = document.implementation.createDocument('', '', null);
    }
    xmlDoc.async = false;
    xmlDoc.load(fXml);
    return xmlDoc;
}
function createXMLTextRequest(fXml) {
    var xmlDoc;
    if (window.ActiveXObject) {
        xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
        xmlDoc.async = false;
        xmlDoc.loadXML(fXml);
    } else if (window.XMLHttpRequest) {
        xmlDoc = document.implementation.createDocument('', '', null);
        var parser = new DOMParser();
        xmlDoc = parser.parseFromString(fXml, 'text/xml');
        delete parser;
    }
    return xmlDoc;
}
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
	} else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}
function doRequestUsingGET(vStr, uFun) {
	userFunction = uFun;
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.open('GET', vStr, false);
    xmlHttp.send(null);
}
function doRequestUsingPOST(vUrl, vStr, uFun) {
	userFunction = uFun;
    createXMLHttpRequest();
    xmlHttp.open('POST', vUrl, false);
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send(vStr);
}
function handleStateChange() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
        	try {
        		eval(userFunction);
            } catch(e) {}
        } else if (xmlHttp.status == 404) {
        	alert('Àß ¸øµÈ ÆäÀÌÁö¸¦ È£ÃâÇÏ¿´½À´Ï´Ù.');
        }
    }
}
function hangleCheck(value) {
	return escape(value).replace(/\+/g, '%2B');
}

function tworldLogo() {
	//document.write("<embed id='TworldLogo' src='http://www.tworld.co.kr/inc/sound/TRING.wav' loop='false' autostart='false' hidden='true'></embed>");
}

