//Ajax function [Debby Create by 2006/12/08]
//strUrl:傳入的網址;strSubmit:帶入的值;strResultFunc:回傳時,運作的function
//範例:xmlhttpPost()
function xmlhttp_init(CodeField,CodeDesc,NameField,NameDesc,Table,subWhereQuery,OrderField,strResultFunc,FuncValue) {
  CodeField=escape(CodeField);
	CodeDesc=escape(CodeDesc);
	NameField=escape(NameField);
	NameDesc=escape(NameDesc);
	subWhereQuery=escape(subWhereQuery);
	var strValue ='CodeField='+CodeField+
	              '&CodeDesc='+CodeDesc+
								'&NameField='+NameField+
								'&NameDesc='+NameDesc+
								'&Table='+Table+
								'&subWhereQuery='+subWhereQuery+
								'&OrderField='+OrderField+'&rnd='+Math.random();
xmlhttpPost('..\\fun\\SelValue.asp',strValue,strResultFunc,FuncValue);

}
//Ajax function [Debby Create by 2006/12/08]
//strUrl:傳入的網址;strSubmit:帶入的值;strResultFunc:回傳時,運作的function
//範例:xmlhttpPost()
function xmlhttpPost(strURL, strSubmit, strResultFunc,FuncValue) {
        var xmlHttpReq = false;
       /* 
        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                xmlHttpReq = new XMLHttpRequest();
                xmlHttpReq.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }*/
				// 建立 XMLHttpRequest 物件
//var xmlHttpReq;

if (window.ActiveXObject) {
    try {        // 新版 IE
        xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {    // 舊版 IE
            xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
    }
} else if (window.XMLHttpRequest) { // Mozilla/Safari
    xmlHttpReq = new XMLHttpRequest();
}

        xmlHttpReq.open('POST', strURL, true);
        xmlHttpReq.setRequestHeader('Content-Type', 
		     'application/x-www-form-urlencoded');
				 
        xmlHttpReq.onreadystatechange = function() {
                if (xmlHttpReq.readyState == 4) {
								 if (xmlHttpReq.status == 200) {
                        eval(strResultFunc + '(xmlHttpReq.responseText,"'+FuncValue+'");');
									}else{
									      eval(strResultFunc + '("Error","'+FuncValue+'");');
									};			
												
                }
        }
        xmlHttpReq.send(strSubmit);
}