function OpenInNewWindow( url )
{	
	theWin = new Array;
	theWin = window.open( url, "NewWindow", "width=750,height=640,scrollbars=yes,resizable=yes" );
	if (theWin.focus) {theWin.focus()}
	return theWin;
}

function OpenInNewWindowWithSize( url, width, height )
{	
	theWin = new Array;
	theWin = window.open( url, "NewWindow", "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes" );
	if (theWin.focus) {theWin.focus()}
	return theWin;
}

function OpenInNewWindowWithSize2( url, width, height )
{	
	theWin = new Array;
	theWin = window.open( url, "NewWindow2", "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes" );
	if (theWin.focus) {theWin.focus()}
	return theWin;
}

function infoWindowHTML(address, maddress, bukkenId, playerWidth, playerHeight, title, thumbaddress, text )
{
	var htmlCode;
	
	htmlCode="<font size='2'><a href='" + address + "' target='_blank'>";
	htmlCode = htmlCode + title + "</a><br><table border=0 cellpading=0 cellspacing=0 width=270><tr><td><a href='" + address + "' target='_blank'><img src=\"" + thumbaddress + "\" align='left' width='90' height='70' border='0'></a>";
	htmlCode = htmlCode + "</font><font size='2' color='#555555'></td><td align='left'><div style='height: 75px; width: 150px; overflow: hidden'><font size='2'>" + text + "</font></div></td></tr></table>";
	htmlCode = htmlCode + "</font>";
	return htmlCode;
}

function centerMapTo( point ) {

	if ( point != null ) {
		map.setCenter(point, 14);
	} else {
		alert("住所が見つかりませんでした。確認してから、再度入力してください");
	}
}

function wheelZoom(a) {
	if(window.event) { a.returnValue = false; } // IE
    if(a.cancelable) { a.preventDefault(); } // DOM-Standard 
    if ((a.detail || -a.wheelDelta) < 0)
        map.zoomIn();
    else
        map.zoomOut();
}

function checkEnter(e){ //e is event object passed from function invocation
	var characterCode;
	if(e && e.which) {
		e = e;
		characterCode = e.which;
	} else {
		e = e;
		characterCode = e.keyCode;
	}

	if(characterCode == 13) {
		LaunchSearch();
		return false;
	} else {
		return true;
	}
}

function LaunchSearch() {
	var searchFieldDiv = document.getElementById("address");
	if ( searchFieldDiv.value == "" ) {
		alert("住所を入力してください");
		searchFieldDiv.focus();
		return false;
	}

	geoCoder = new GClientGeocoder();
	geoCoder.getLatLng(searchFieldDiv.value, centerMapTo);
}

G_NORMAL_MAP.getName = function(sh) {
        if(sh) {return "地図"}
        return "地図";
}

G_SATELLITE_MAP.getName = function(sh) {
        if(sh) {return "衛星"}
        return "衛星写真";
}

G_HYBRID_MAP.getName = function(sh) {
        if(sh) {return "地図+写真"}
        return "地図+写真";
}


G_NORMAL_MAP.getMaximumResolution = function(a) {return 19}
G_SATELLITE_MAP.getMaximumResolution = function(a) {return 19}
G_HYBRID_MAP.getMaximumResolution = function(a) {return 19}

