
var http_request = false;
var parmData = "";

function Ajax_Connection(){	

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

}



//<!--******************************************************************************************-->
//函數名稱：GSSRemoveAllOpts
//目        的：移除清單中所有選項
//傳入參數：vObj - 清單物件(未傳遞時,預設取得觸發事件的物件)
//版本變更：
//xx. YYYY/MM/DD	AUTHOR		COMMENTS
// 1. 2002/06/19	Brenda		New Create
//<!--******************************************************************************************-->
function GSSRemoveAllOpts(vObj){
	if(!vObj){
		var objComBox=event.srcElement;}
	else{
		var objComBox=vObj
	}
    var intCount=objComBox.options.length;
    for (var i=intCount-1; i>=0; i--) {
        blnSel=objComBox.options[i].selected;
        if(blnSel) objComBox.options[i].selected=false;
		objComBox.remove(i);
    }	
}
//<!--******************************************************************************************-->
//函數名稱：GSSAddCboOpt
//目        的：將字串集合資料轉換成ComBox物件Option選項資料
//參數說明：vObj：欲處理的ComBox物件（或者是欲處理的ComBox物件的ID）
//			vstrData：ComBox物件Option選項資料來源字串
//			資料格式：Option1 Value\|Option1 Text\,Option2 Value\|Option2 Text
//			每個Option的Value與Text資料分隔符號為\|，每個Option資料的分隔符號為\,
//版本變更：
//xx. YYYY/MM/DD	AUTHOR		COMMENTS
// 1. 2002/06/19	Brenda		New Create
//<!--******************************************************************************************-->
function GSSAddCboOpt(vObj,vstrData){
    var arrData;
 
    if(!vObj) return false;
    var objDocument=document;   
    if(typeof(vObj)=='object'){
        var objListBox=vObj;}
    else{
        var objListBox=objDocument.getElementById(vObj);}
      
    arrData=vstrData.split('\\,');
  
   for(var i=0;i<arrData.length;i++){
	 
     intIndex=arrData[i].indexOf('\\|', 0);

     var objNewItem = objDocument.createElement('OPTION');
      
     objNewItem.text = arrData[i].substr(intIndex+2,arrData[i].length-intIndex-2);
     objNewItem.value = arrData[i].substr(0,intIndex);
     objListBox.options.add(objNewItem);
   }
	
	if (objListBox.length<1) 
		objListBox.selectedIndex = -1;
	else
		objListBox.selectedIndex = 0;
 
}
//<!--******************************************************************************************-->
//函數名稱：CheckNumeric
//目        的：
//參數說明：
//			
//			
//			
//版本變更：
//xx. YYYY/MM/DD	AUTHOR		COMMENTS
// 1. 2006/05/02	Nelson		New Create
//<!--******************************************************************************************-->
function CheckNumeric(){
	if(window.event.keyCode<48 || window.event.keyCode>57 ){
		window.event.keyCode = '';
	}
}