// JavaScript Document
    function makeRequest(zid)
	{
        var httpRequest;

        if (window.XMLHttpRequest)// Mozilla, Safari, ...
		{ 
            httpRequest = new XMLHttpRequest();
            if (httpRequest.overrideMimeType)
			{
                httpRequest.overrideMimeType('text/xml');
            }
        } 
        else if (window.ActiveXObject)// IE
		{ 
            try 
			{
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
            } 
            catch (e)
			{
				try {
                		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                    } 
                catch (e) {}
			}
		}

        if (!httpRequest)
		{
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

        httpRequest.onreadystatechange = function() { bsShowMap(httpRequest); };
        httpRequest.open('GET', 'get_monster.php?z='+zid, true);
        httpRequest.send('');

    }

    function bsShowMap(httpRequest)
	{
        if (httpRequest.readyState == 4)
		{
            if (httpRequest.status == 200) 
			{
				 xmlDoc = httpRequest.responseXML;
				 
				 var map = xmlDoc.getElementsByTagName("ZoneMap")[0].firstChild.data;
				 var monster = xmlDoc.getElementsByTagName("Monster");
				 
				 var output = "";
				 output += '<div class="map_info_t" style="background: #CDCDFF;">怪 物 分 布</div>\n'; 
				 

				 for(i=0; i<monster.length; i++)
				 {
					 m_name = monster[i].childNodes[0].firstChild.data;
				 	 m_level = monster[i].childNodes[1].firstChild.data;
				 	 m_loc = monster[i].childNodes[2].firstChild.data;	
					 
					 output += '<div class="map_npc"><span style="background: #33CC33; color:#FFFFFF; float:left; width: 16px; text-align: center; margin-right: 2px;">'+m_loc+'</span> <span>'+m_name+'</span> <span>( Lv'+m_level+' )</span></div>';
					 if(i+1%2==0 || i+1==monster.length)
					 	output += '<div class="map_npc_r"></div>';
				 }
				 
				 document.getElementById("map_tab_npc").src = 'image/map_npc_a.gif';
				 document.getElementById("map_tab_mon").src = 'image/map_mon_b.gif';
				 document.getElementById("map_show").src = 'http://bs.e72play.com/image/map/'+map;

				 document.getElementById("map_info").innerHTML = output;
			} 
			else
			{
                alert('There was a problem with the request.');
            }
        }

    }
