$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://chintai360.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=ABQIAAAASo52xcRd0MfXiuuRL29CBBRqR3tfnCICvosncMxeA5WBUkMJoBSHK682K9kQFPZh3-0DsJ9CcgjuSA";
	script.src = "http://www.google.com/jsapi?key=ABQIAAAASo52xcRd0MfXiuuRL29CBBRHvzaIaQTJYea_I5axUkG00KZe_BQhbq12lGS6YqU_xUcxRym-mN7uPA";

	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());
			
		});

	}


}
*/