function show_map(){
	var myLatlng = new google.maps.LatLng(35.473127, 139.447317);
	var myOptions = {
	  zoom: 11,
	  center: myLatlng,
	  mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var geocoder;
	geocoder = new google.maps.Geocoder();
	
	var map = new google.maps.Map(document.getElementById("map-area"), myOptions);
	var myPath = new google.maps.Polyline({
path: [
new google.maps.LatLng(35.40764534, 139.40671921),
    new google.maps.LatLng(35.41128299, 139.41028118),
    new google.maps.LatLng(35.41635444, 139.41345692),
    new google.maps.LatLng(35.41890753, 139.41268444),
    new google.maps.LatLng(35.41775340, 139.41895008),
    new google.maps.LatLng(35.41603967, 139.42418575),
    new google.maps.LatLng(35.41778837, 139.42491531),
    new google.maps.LatLng(35.42023650, 139.42452908),
    new google.maps.LatLng(35.41957202, 139.43002224),
    new google.maps.LatLng(35.41820806, 139.43422794),
    new google.maps.LatLng(35.41299682, 139.44225311),
    new google.maps.LatLng(35.40935925, 139.44118023),
    new google.maps.LatLng(35.40750543, 139.44246769),
    new google.maps.LatLng(35.40775028, 139.44482803),
    new google.maps.LatLng(35.40698075, 139.44504261),
    new google.maps.LatLng(35.40740049, 139.44890499),
    new google.maps.LatLng(35.40984894, 139.44997787),
    new google.maps.LatLng(35.41096820, 139.45250988),
    new google.maps.LatLng(35.41096820, 139.45517063),
    new google.maps.LatLng(35.41156280, 139.45753098),
    new google.maps.LatLng(35.41236726, 139.45517063),
    new google.maps.LatLng(35.41471062, 139.45645809),
    new google.maps.LatLng(35.41534017, 139.45581436),
    new google.maps.LatLng(35.41673915, 139.45697308),
    new google.maps.LatLng(35.42170534, 139.45229530),
    new google.maps.LatLng(35.42369872, 139.44864750),
    new google.maps.LatLng(35.42747552, 139.44401264),
    new google.maps.LatLng(35.42869945, 139.44607258),
    new google.maps.LatLng(35.42513253, 139.45495605),
    new google.maps.LatLng(35.42408341, 139.45989132),
    new google.maps.LatLng(35.42296432, 139.46126461),
    new google.maps.LatLng(35.42355884, 139.46255207),
    new google.maps.LatLng(35.42366375, 139.46512699),
    new google.maps.LatLng(35.42880436, 139.46504116),
    new google.maps.LatLng(35.42890926, 139.46619987),
    new google.maps.LatLng(35.42366375, 139.46710110),
    new google.maps.LatLng(35.42366375, 139.47092056),
    new google.maps.LatLng(35.42408341, 139.47289467),
    new google.maps.LatLng(35.43069266, 139.47392464),
    new google.maps.LatLng(35.43198647, 139.47293758),
    new google.maps.LatLng(35.43593772, 139.47349548),
    new google.maps.LatLng(35.43646220, 139.47435379),
    new google.maps.LatLng(35.43849018, 139.47538376),
    new google.maps.LatLng(35.43925941, 139.47508335),
    new google.maps.LatLng(35.44293059, 139.47718620),
    new google.maps.LatLng(35.44981798, 139.47860241),
    new google.maps.LatLng(35.46299677, 139.47190762),
    new google.maps.LatLng(35.46998729, 139.47461128),
    new google.maps.LatLng(35.47197948, 139.47203636),
    new google.maps.LatLng(35.47827027, 139.47001934),
    new google.maps.LatLng(35.48131065, 139.47087765),
    new google.maps.LatLng(35.48609813, 139.46937561),
    new google.maps.LatLng(35.48899844, 139.47096348),
    new google.maps.LatLng(35.49228300, 139.47074890),
    new google.maps.LatLng(35.49472886, 139.46860313),
    new google.maps.LatLng(35.49542766, 139.46624279),
    new google.maps.LatLng(35.49706983, 139.46474075),
    new google.maps.LatLng(35.49923604, 139.46624279),
    new google.maps.LatLng(35.50576925, 139.46838856),
    new google.maps.LatLng(35.50779548, 139.46753025),
    new google.maps.LatLng(35.51093954, 139.46495533),
    new google.maps.LatLng(35.51383895, 139.46392536),
    new google.maps.LatLng(35.51670333, 139.46379662),
    new google.maps.LatLng(35.51935802, 139.46105003),
    new google.maps.LatLng(35.52033604, 139.45590019),
    new google.maps.LatLng(35.51911351, 139.45482731),
    new google.maps.LatLng(35.51771631, 139.45238113),
    new google.maps.LatLng(35.51736701, 139.44821835),
    new google.maps.LatLng(35.51404854, 139.44448471),
    new google.maps.LatLng(35.51230193, 139.44306850),
    new google.maps.LatLng(35.50755094, 139.42924976),
    new google.maps.LatLng(35.48029720, 139.43894863),
    new google.maps.LatLng(35.47743153, 139.43474293),
    new google.maps.LatLng(35.47159502, 139.43637371),
    new google.maps.LatLng(35.46698144, 139.43637371),
    new google.maps.LatLng(35.46603772, 139.42199707),
    new google.maps.LatLng(35.46796010, 139.42083836),
    new google.maps.LatLng(35.46072471, 139.41414356),
    new google.maps.LatLng(35.45761365, 139.41560268),
    new google.maps.LatLng(35.45754374, 139.41101074),
    new google.maps.LatLng(35.45614546, 139.40822124),
    new google.maps.LatLng(35.45271959, 139.40650463),
    new google.maps.LatLng(35.44901390, 139.40637589),
    new google.maps.LatLng(35.44831469, 139.40238476),
    new google.maps.LatLng(35.44296555, 139.40689087),
    new google.maps.LatLng(35.43880487, 139.40710545),
    new google.maps.LatLng(35.43209138, 139.40976620),
    new google.maps.LatLng(35.42310421, 139.40912247),
    new google.maps.LatLng(35.41729874, 139.40792084),
    new google.maps.LatLng(35.41152783, 139.40633297),
    new google.maps.LatLng(35.40792517, 139.40663338)
],
strokeColor: "#4A77BB",
strokeOpacity: 0.8,
strokeWeight: 3

});
myPath.setMap(map);
	
  	downloadUrl("/map.xml",function(data){														
	  
	  var markers = data.documentElement.getElementsByTagName("marker");	  
	  for(var i=0; i< markers.length; i++){
		
		var flg = false;
		
		var name = markers[i].getAttribute("name");
		var lat = parseFloat(markers[i].getAttribute("lat"));
		var lng = parseFloat(markers[i].getAttribute("lng"));
		var latlng = new google.maps.LatLng(lat,lng);
		var address = markers[i].getAttribute("address");
		var tel = markers[i].getAttribute("tel");
		var fax = markers[i].getAttribute("fax");
		var city = markers[i].getAttribute("city");
		var ward = markers[i].getAttribute("ward");
		var url = markers[i].getAttribute("linkurl");
		var model = markers[i].getAttribute("model");
		var category = markers[i].getAttribute("category");
		
		if((document.getElementById("city1").checked == true && city == "大和市") || (document.getElementById("city2").checked == true && city == "綾瀬市")){
			flg = true;
		}
		
		
		
//		if(address2 != "" && address2 != ward){
//			flg = false;
//		}
//		if(address1 != "" && address1 != ward){
//			flg = false;
//		}
		
		//function setZoomLevel(n){
	
		
		var arr_model = model.split(",");
		for(s = 0; s < arr_model.length - 1; s++){
			arr_model[s]
		}
		var model_check = document.getElementsByName('type') 
		if(model_check[0].checked && arr_model[3] == "" ){
			flg =false;
		}
		if(model_check[1].checked && arr_model[2] == "" ){
			flg =false;
		}
		if(model_check[2].checked && arr_model[0] == "" ){
			flg =false;
		}
		if(model_check[3].checked && arr_model[4] == "" ){
			flg =false;
		}
		if(model_check[4].checked && arr_model[1] == "" ){
			flg =false;
		}
		
		
		var html = "";
		if(category == "tenken"){
			html = '<div style="height: 100px; width: 200px" class="infowindow"><p class="name">'+name+'</p><p class="address">'+address+'</p><p>TEL:'+tel+'</p><p>FAX:'+fax+'</p><p><a onclick="window.open(\''+ url+'\',null)"  href="javascript:void(0)">会員ページへ</a></p>';
		}else{
			html = '<div style="height: 100px; width: 200px" class="infowindow"><p class="name">'+name+'</p><p class="address">'+address+'</p><p>TEL:'+tel+'</p><p>FAX:'+fax+'</p>';
		}
		
		if(flg){
		createMarker(latlng,url,html,map,category,name);
		if(createMarker == 0){
			alert("該当する工場はございません。");
		}
		}
		
       }
     });
	function createMarker(latlng,url,html,map,category,name) {
		
	var iconOffset = new google.maps.Point(34, 34); 
	var iconPosition = new google.maps.Point(0, 0);
	var iconSize = new google.maps.Size(50, 54);
	var iconShadowSize = new google.maps.Size(37, 34);

	var tenkenUrl = "http://car-yamatoayase.sakura.ne.jp/images/tenken15.png";
	var tenkenShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/tree.shadow.png";
	var tenkenIcon = new google.maps.MarkerImage(tenkenUrl, iconSize, iconPosition, iconOffset);
	var tenkenShadow = new google.maps.MarkerImage(tenkenShadowUrl, iconShadowSize, iconPosition, iconOffset);
	
	var carUrl = "http://car-yamatoayase.sakura.ne.jp/images/red-dot.png";
	var carShadowUrl = "http://car-yamatoayase.sakura.ne.jp/images/msmarker.shadow.png";
	var carIcon = new google.maps.MarkerImage(carUrl, iconSize, iconPosition, iconOffset);
	var carShadow = new google.maps.MarkerImage(carShadowUrl, iconShadowSize, iconPosition, iconOffset);

	var bikeUrl = "http://car-yamatoayase.sakura.ne.jp/images/bike_icon.png";
	var bikeShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/hotsprings.shadow.png";
	var bikeIcon = new google.maps.MarkerImage(bikeUrl, iconSize, iconPosition, iconOffset);
	var bikeShadow = new google.maps.MarkerImage(bikeShadowUrl, iconShadowSize, iconPosition, iconOffset);

	var tokusyuUrl = "http://car-yamatoayase.sakura.ne.jp/images/tokusyu_icon.png";
	var tokusyuShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/fishing.shadow.png";
	var tokusyuIcon = new google.maps.MarkerImage(tokusyuUrl, iconSize, iconPosition, iconOffset);
	var tokusyuShadow = new google.maps.MarkerImage(tokusyuShadowUrl, iconShadowSize, iconPosition, iconOffset);
	var dampUrl = "http://car-yamatoayase.sakura.ne.jp/images/damp_icon.png";
	var dampShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/fishing.shadow.png";
	var dampIcon = new google.maps.MarkerImage(dampUrl, iconSize, iconPosition, iconOffset);
	var dampShadow = new google.maps.MarkerImage(dampShadowUrl, iconShadowSize, iconPosition, iconOffset);
	var truckUrl = "http://car-yamatoayase.sakura.ne.jp/images/truck_icon.png";
	var truckShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/fishing.shadow.png";
	var truckIcon = new google.maps.MarkerImage(truckUrl, iconSize, iconPosition, iconOffset);
	var truckShadow = new google.maps.MarkerImage(truckShadowUrl, iconShadowSize, iconPosition, iconOffset);
	var busUrl = "http://car-yamatoayase.sakura.ne.jp/images/bus_icon.png";
	var busShadowUrl = "http://maps.google.co.jp/mapfiles/ms/icons/fishing.shadow.png";
	var busIcon = new google.maps.MarkerImage(busUrl, iconSize, iconPosition, iconOffset);
	var busShadow = new google.maps.MarkerImage(busShadowUrl, iconShadowSize, iconPosition, iconOffset);
	
		
	var customIcons =
	{
	tenken: {icon:tenkenIcon,shadow:tenkenShadow},
	car: {icon:carIcon,shadow:carShadow},
	bike: {icon:bikeIcon,shadow:bikeShadow}, 
	tokusyu: {icon:tokusyuIcon,shadow:tokusyuShadow}, 
	damp: {icon:dampIcon,shadow:dampShadow},
	truck: {icon:truckIcon,shadow:truckShadow},
	bus: {icon:busIcon,shadow:busShadow}
	};

	var icon = customIcons[category] || {};
	var marker = new google.maps.Marker(
	{
	map: map,
	position: latlng,
	icon: icon.icon,
	shadow: icon.shadow,
	title: name
	});
	var infoWindow = new google.maps.InfoWindow();
	google.maps.event.addListener(marker, 'click', function() 
	{
		infoWindow.setContent(html);
           	infoWindow.open(map,marker);        	
	});
		
    //var address = latlng;
    //  geocoder.geocode( { 'address': address}, function(results, status) {
//        if (status == google.maps.GeocoderStatus.OK) {
//          map.setCenter(results[0].geometry.location);
//          var marker = new google.maps.Marker({
//              map: map, 
//              position: results[0].geometry.location,
//			  icon: icon.icon,
//			  shadow: icon.shadow,
//			  title: name
//          });
//		  
//        } else {
//          alert("Geocode was not successful for the following reason: " + status);
//        }
//      });
	
	
	
	}
	
	
	
	var address3 = document.getElementById("address").value;
	var address1 = document.getElementById("address1").value;
	var address2 = document.getElementById("address2").value;
	if(address1 != "" || address2 != "" || address3 != ""){
		if(address1 != ""){
		var Center = document.getElementById("address1").value;
	}
	if(address2 != ""){
		var Center = document.getElementById("address2").value;
	}
	var CenterLatLng = Center.split(",");
	var Clat = CenterLatLng[0];
	var Clng = CenterLatLng[1];
		//var Mlat = document.getElementById("mapCent1").value;
//		var Mlng = document.getElementById("mapCent2").value;
		var pos = new google.maps.LatLng(Clat,Clng);
		map.setCenter(pos);
		map.setZoom(15);
		}


}
    
    
