var map="";

var markers="";



jQuery(document).ready(function(){



	jQuery.ajax({

		cache:false,

		url:"location.xml",

		type:"GET",

		error: function(){

			alert("xmlファイルの読み込みに失敗しました");

		},

		dataType:"xml",

		success:function(xml){

			parseXml(xml);

		}

	});



	map = new GMap2(document.getElementById("gmap-central"),{size:new GSize(645,320)});

	map.addControl(new GLargeMapControl());

	map.addControl(new GMapTypeControl());

	map.enableScrollWheelZoom();

});

function centerize(lat,lng){

	map.setCenter(new GLatLng(lat,lng), 16);

}





function parseXml(xml)

{

	jQuery(xml).find("location").each(function(){

		if(jQuery(this).children("id").text()=="central01"){

			new icons(jQuery(this));

		}

	});

}





function icons(xml){



	this.xml=xml;

	this.id=xml.children("id").text();

	centerize(xml.children("lat").text(),xml.children("lng").text());

	this.htmlbody;

	this.markerIcon;

	this.opt;

	this.marker;



	this.markerIcon=new GIcon();

	this.markerIcon.image="../info/icon/central.png";

	this.markerIcon.iconSize=new GSize(42,50);

	this.markerIcon.iconAnchor=new GPoint(21, 46);

	this.markerIcon.infoWindowAnchor=new GPoint(21, 2)



	this.opt={icon:this.markerIcon};

	this.marker=new GMarker(new GPoint(xml.children("lng").text(),xml.children("lat").text()),this.opt);

	this.marker.name=this.xml.children("name").text();

	map.addOverlay(this.marker);





}










