  //依門市店名搜尋
   var cvstore_type;
	function showList5(form) {
	cvstore_type = document.MainForm.vStore_Type.value;
		clearMil();
		clearlist1();
		clearlist2();
		clearlist3();
		
		document.getElementById("store_id").innerHTML = "";
		document.getElementById("store_name").innerHTML = "";
		document.getElementById("store_tel").innerHTML = "";
		document.getElementById("store_addr").innerHTML = "";
		
		document.getElementById("arr_time").innerHTML = "";
		document.getElementById("show_map").innerHTML = "";
		document.getElementById("ArrTimeNote").style.display = "none";
		
		document.getElementById("div_choice").style.display="none";

		var store_name = form.vstore_name.value;
		form.vstore_id.value="";
		if (store_name.length== 0) {
			alert('請輸入店名');
			form.vstore_name.focus();
			return false;
		}else{
			var isfox = check();
			var argument = "in_st_name=" +store_name+"&isfox="+isfox+"&vStore_Type="+cvstore_type;
			sendRequest5("ezship_map_search_all.jsp?"+argument);
		}
	}
	
	function sendRequest5(url) {
		createXMLHttpRequest();
		XMLHttpReq.open("GET", url, true);
		XMLHttpReq.onreadystatechange = processResponse5;
		XMLHttpReq.send(null);
	}

   function processResponse5() {
   	if (XMLHttpReq.readyState == 4) {
        	if (XMLHttpReq.status == 200) {
				updateList5();
		    } else {
		      alert("很抱歉，目前系統忙碌中，請稍後再試。");
		    }
        }
    }
	
	function updateList5() {
		var xmldoc = XMLHttpReq.responseXML;
		if(xmldoc.getElementsByTagName("ST_NAME").length==1){
			if(xmldoc.getElementsByTagName("ST_NAME")[0].childNodes[0].nodeValue=='tomuch'){
				document.MainForm.list3.disabled = true;
				alert('由於筆數過多，請重新輸入查詢條件。');
			}else if(xmldoc.getElementsByTagName("ST_NAME")[0].childNodes[0].nodeValue=='zero'){
				document.MainForm.list3.disabled = true;
				alert('您輸入的門市店名，查無資料，請重新輸入。');
				document.MainForm.vstore_name.focus();
			}			
		}else{
		  var current = document.MainForm.list3;
		  document.MainForm.list3.disabled = false;
        var anode, tnode;
        while(current.hasChildNodes()) {
          anode = current.firstChild;
          current.removeChild(anode);
        }
		  
        for(i=0; i<xmldoc.getElementsByTagName("ST_NAME").length; i++){
        	anode = document.createElement("option");
         anode.setAttribute("value", xmldoc.getElementsByTagName("ST_NAME")[i].childNodes[0].nodeValue);
          if(i == 0) 
            anode.setAttribute("selected", "1");
          	current.appendChild(anode);
          	tnode = document.createTextNode(xmldoc.getElementsByTagName("ST_NAME")[i].childNodes[0].nodeValue);
				anode.appendChild(tnode);
        }
         
        if (xmldoc.getElementsByTagName("ST_NAME").length==2) { 
				//current[1].selected = true;
				showList4(document.MainForm,document.MainForm.list3[1].value);
        } else {
        		document.MainForm,document.MainForm.mli.style.backgroundColor = '#FFFFFF';
				document.MainForm,document.MainForm.list3.style.backgroundColor = '#FFFFCC';
        }      

      }
	}
