/* 
 * Javscript
 * jqueryを利用したものです。
 */

$(document).ready(function(){
	
	var map;
	var center;
	
	var top = 0, left = 0;
	left = window.innerWidth;
	left = ( ! left ) ? document.body.clientWidth : left;
	left = ( ! left ) ? document.documentElement.clientWidth : left;
	
	left = ( left / 2 ) - 300;
	top = 50;
	var w = $("div#Gmap").css("width");
	var h = $("div#Gmap").css("height");
	
	//GoogleMapを表示する
	$("a#gomap").click(function(){
		$("div.Gmap").css("position","absolute");
		$("div.Gmap").css("z-index","999");
		$("div.Gmap").css("top",top);
		$("div.Gmap").css("left",left);
        $("div.Gmap").show();
		map = new GMap2(document.getElementById("Gmap"));
		map.setCenter(new GLatLng(gy,gx), z, G_NORMAL_MAP);
		var marker = new GMarker(new GLatLng(gy,gx));
		map.addOverlay(marker);
		map.addControl(new GLargeMapControl());
    });
	
	//GoogleMapを非表示にする
	$("img#close").click(function(){
		$("div.Gmap").hide();
	});
	
	//ドラッグ処理
	$("div.Gmap").draggable({
		appendTo : "body",
		cursor   : "move",
		handle   : "td.title",
		stop: function(event, ui) {
				top = $("div.Gmap").attr("top");
				left = $("div.Gmap").attr("left");
			}
	});
	
});






