$j = jQuery;

var ChintaiItemMap = {

	load : function (loc, width, height, src, canvas){
		var $j = jQuery;

		width = width || 300;
		height = height || 300;
		height2 = 200;
		src = src || "http://office360.jp/maps/s/"+loc.lat+"/"+loc.lng+"/"+width+"/"+height+"/"+height2;
		canvas = canvas || 'itemMap';

		canvas = document.getElementById(canvas);
		canvas.innerHTML="<iframe width='"+(width+10)+"' height='"+(height+height2+10)+"' scrolling='no' frameborder='0' src='"+src+"'></iframe>"

		$j('#itemMapRow').show();
//		$j('#itemMapPrevRow').addClass('eraseborder');
		$j('#itemMapButton').hide()
			.attr("onclick", "")
			.click(function(event){ChintaiItemMap.show(); event.preventDefault();});
		$j('#itemMapCloseButton').show();
	},

	close : function(){
		$j("#itemMapCloseButton").hide();
		$j('#itemMapRow').hide();
		$j('#itemMapButton').show();
	},

	show : function(){
		$j('#itemMapRow').show();
//		$j('#itemMapPrevRow').addClass('eraseborder');
		$j('#itemMapButton').hide();
		$j('#itemMapCloseButton').show();
	}

}



/*
function chintaiLoadMap(loc, canvas){
	var head = document.getElementsByTagName("head")[0];
	var script = document.createElement("script");
//	script.src = "http://maps.google.co.jp/maps?file=api&v=2.x&key=ABQIAAAAsrPyO3uylZVhC9JbUPKcIxQRXq-HZiUKXEZWz6eTl2OeGq0uHxSwHlcWseLQkH0SjEorM0BFk0v10A";
	script.src = "http://www.google.com/jsapi?key=ABQIAAAAsrPyO3uylZVhC9JbUPKcIxQRXq-HZiUKXEZWz6eTl2OeGq0uHxSwHlcWseLQkH0SjEorM0BFk0v10A";

	head.appendChild(script);

	script.onload = script.onreadystatechange = function(){

		google.load("maps", "2");
		google.setOnLoadCallback(function(){

			var map = new GMap2(canvas);
			map.setCenter(new GLatLng(loc.lat,loc.lng), 15);
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());

		});

	}


}
*/