
function moveLAYER(idName,x,y){
	
    if(document.getElementById){
     	document.getElementById(idName).style.left = x+'px';
     	document.getElementById(idName).style.top = y+'px';
    }
    else if(document.all){
     	document.all(idName).style.pixelLeft = x;
     	document.all(idName).style.pixelTop = y;
    }
    else if(document.layers){
     	document.layers[idName].moveTo(x,y);
	}
}

function getINNERWIDTH(){
	if(window.opera){
		return window.innerWidth;          //o6,o7
	}else if(document.all){
		return document.body.clientWidth;  //e4,e5,e6
	}else if(document.layers){
		return window.innerWidth;          //n4
	}else if(document.getElementById){
		return  window.innerWidth;         //n6,n7,m1,s1
	}
	return null;
}

function getINNERHEIGHT(){
	if(window.opera){
		return window.innerHeight;         //o6,o7
	}else if(document.all){
		return document.body.clientHeight; //e4,e5,e6
	}else if(document.layers){
		return  window.innerHeight;        //n4
	}else if(document.getElementById){
		return window.innerHeight;         //n6,n7,m1,s1
	}
	return null;
}


//OS判別
function checkOS() {
    /*alert(navigator.userAgent);*/
    var os="OT";
    var uAnt = navigator.userAgent;
    if(uAnt.indexOf("Win") != -1) os = "WIN";
    if(uAnt.indexOf("Mac") != -1) {
        os = "OS9";
        for (i=0; i<navigator.plugins.length; i++) if (navigator.plugins[i].filename.indexOf(".") >= 0) os = "OSX";
    };
    if (uAnt.indexOf("X11") > -1) os = "UNIX";
    return os;
}

//ブラウザ判別
function checkBrowser() {
    /*alert(navigator.userAgent);*/
    var uAnt = navigator.userAgent;
    if (uAnt.indexOf("Safari") > -1) return "SF";
    if (uAnt.indexOf("Opera") > -1) return "OP";
    if (uAnt.indexOf("Firefox") > -1) return "FF";
    if (uAnt.indexOf("MSIE") > -1) return "IE";
    if (document.layers) return "NN4";
    if (document.getElementById && !document.all) return "NN6";
    return "OT";
}

/////////////////////////////////////////////////////////////////////////////////////////////

function createGiconOCTB(){
	var icon_octb = new GIcon();
	icon_octb.image = "/common/gicon/octb.png";
	icon_octb.iconSize = new GSize(15, 19);
	icon_octb.iconAnchor = new GPoint(7, 15);
	icon_octb.infoWindowAnchor = new GPoint(7, 1);
	
	return icon_octb;
}

function createGicon(id){
	var icon = new GIcon();
	icon.image = "/common/gicon/gi_"+id+".png";
	icon.shadow = "/common/gicon/shadow.png";
	icon.iconSize = new GSize(20, 26);
	icon.shadowSize = new GSize(37, 26);
	icon.iconAnchor = new GPoint(10, 26);
	icon.infoWindowAnchor = new GPoint(10, 1);
	
	return icon;
}

function mapSetUp(){
	
	if(GBrowserIsCompatible()){
		
		map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(ya[0],xa[0]), OSK_zoom);
		
		for (var i=0; i < octb_x.length; ++i){
			var icon = createGiconOCTB();
			var point = new GLatLng(octb_y[i],octb_x[i]);
			var marker = createMarker(point,icon,octb_n[i]);
			map.addOverlay(marker);
		}
		
		for (var i=0; i < xa.length; ++i){
			if(xa[i])
			{
				var icon = createGicon(i);
				var point = new GLatLng(ya[i],xa[i]);
				var marker = createMarker(point,icon,na[i]);
				map.addOverlay(marker);
			}
			
		}
	}
	
	mapWidthCentering();
	OSK_moviMap();
	
	OSK_onLoaded = true;
}

function OSK_zoomIn(){
	if(OSK_zoom < 17){
		++OSK_zoom;
		map.setZoom(OSK_zoom);
	}
}

function OSK_zoomOut(){
	if(OSK_zoom > 0){
		--OSK_zoom;
		map.setZoom(OSK_zoom);
	}
}

////////// block over out

function OSK_over(id, idname, color){
	if(GBrowserIsCompatible() && OSK_onLoaded){
		map.closeInfoWindow();
		
		map.panTo(new GLatLng(ya[id],xa[id]));
		
		if(map.getZoom() < 10){
			OSK_zoom = 17-za[id];
			map.setCenter(new GLatLng(ya[id],xa[id]), 17-za[id]);
		}else{
			map.panTo(new GLatLng(ya[id],xa[id]));
		}
		
		if(document.getElementById){
			document.getElementById(idname).style.backgroundColor = blockColor[color];
		}
	}
}

function OSK_out(id, idname, color){
	if(document.getElementById && GBrowserIsCompatible() && OSK_onLoaded){
     	document.getElementById(idname).style.backgroundColor = blockColor[color];
	}
}


function OSK_moviMap(){
	
	var PosLeft;
	var PosTop;
	
	clearTimeout(timerID);
	timerID = setTimeout("OSK_moviMap()",10);
	
	if(document.all){
		PosLeft = document.body.parentNode.scrollLeft;
		PosTop = document.body.parentNode.scrollTop;
	}
	else if(document.layers){
		PosLeft = window.pageXOffset;
		PosTop = window.pageYOffset;
	}
	else if(document.getElementById){
		PosLeft = window.pageXOffset;
		PosTop = window.pageYOffset;
	}
	
	OSK_tay = PosTop + OSK_ofy;
	OSK_say = OSK_say + (OSK_tay - OSK_say) / 6;
	
	moveLAYER(OSK_map,OSK_x,OSK_say);
}

function mapWidthCentering(){
	var setx = getINNERWIDTH() / 2 + OSK_centerBaf + OSK_dec;
	if(getINNERWIDTH() < OSK_contetsWith){
		setx = OSK_contetsWith / 2 + OSK_centerBaf + OSK_dec;
	}
	OSK_x = setx;
	moveLAYER(OSK_map,OSK_x,OSK_say);
}

//Google Maps API"
//
// Create a marker whose info window displays the given number.
function createMarker(point, icon, html) {
	//var marker = new GMarker(point);
	var marker = new GMarker(point, icon);

	GEvent.addListener(marker, 'click', function() {
		marker.openInfoWindowHtml(html);
	});
	
	return marker;
}
///

var octb_x = new Array();
var octb_y = new Array();
var octb_z = new Array();
var octb_n = new Array();

octb_y[0]=34.666247;octb_x[0]=135.495314;
octb_y[1]=34.647307;octb_x[1]=135.514024;
octb_y[2]=34.733167;octb_x[2]=135.499664;
octb_y[3]=34.702694;octb_x[3]=135.50221;
octb_y[4]=34.668276;octb_x[4]=135.436575;
octb_y[5]=34.433938;octb_x[5]=135.240472;
octb_y[6]=34.516654;octb_x[6]=135.658335;
octb_y[7]=34.835442;octb_x[7]=135.46884;
octb_y[8]=34.504458;octb_x[8]=135.601333;
octb_y[9]=34.451253;octb_x[9]=135.573038;
octb_y[10]=34.582023;octb_x[10]=135.469614;
octb_y[11]=34.558245;octb_x[11]=135.487208;
octb_y[12]=34.488402;octb_x[12]=135.425438;
octb_y[13]=34.445445;octb_x[13]=135.35805;
octb_y[14]=34.465205;octb_x[14]=135.622358;
octb_y[15]=34.956699;octb_x[15]=135.401823;

octb_n[0]='<div class="fukidashi"><a href="/jp/search/detail/office_1.html">大阪市ビジターズインフォメーションセンター・難波</a></div>';
octb_n[1]='<div class="fukidashi"><a href="/jp/search/detail/office_2.html">大阪市ビジターズインフォメーションセンター・天王寺</a></div>';
octb_n[2]='<div class="fukidashi"><a href="/jp/search/detail/office_3.html">大阪市ビジターズインフォメーションセンター・新大阪</a></div>';
octb_n[3]='<div class="fukidashi"><a href="/jp/search/detail/office_4.html">大阪市ビジターズインフォメーションセンター・梅田</a></div>';
octb_n[4]='<div class="fukidashi"><a href="/jp/search/detail/office_5.html">大阪市ビジターズインフォメーションセンター・ユニバーサルシティ</a></div>';
octb_n[5]='<div class="fukidashi"><a href="/jp/search/detail/office_6.html">関西観光情報センター</a></div>';
octb_n[6]='<div class="fukidashi"><a href="/jp/search/detail/office_7.html">道の駅　近つ飛鳥の里　太子</a></div>';
octb_n[7]='<div class="fukidashi"><a href="/jp/search/detail/office_8.html">箕面市観光案内所</a></div>';
octb_n[8]='<div class="fukidashi"><a href="/jp/search/detail/office_9.html">富田林観光案内所</a></div>';
octb_n[9]='<div class="fukidashi"><a href="/jp/search/detail/office_10.html">河内長野市観光案内所</a></div>';
octb_n[10]='<div class="fukidashi"><a href="/jp/search/detail/office_11.html">堺駅観光案内所</a></div>';
octb_n[11]='<div class="fukidashi"><a href="/jp/search/detail/office_12.html">大仙公園観光案内所</a></div>';
octb_n[12]='<div class="fukidashi"><a href="/jp/search/detail/office_13.html">和泉市観光案内ステーション</a></div>';
octb_n[13]='<div class="fukidashi"><a href="/jp/search/detail/office_14.html">貝塚市観光案内所</a></div>';
octb_n[14]='<div class="fukidashi"><a href="/jp/search/detail/office_15.html">道の駅　ちはやあかさか</a></div>';
octb_n[15]='<div class="fukidashi"><a href="/jp/search/detail/office_16.html">道の駅　能勢「くりの郷」</a></div>';


