function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function getLocation() {
	// Google API の利用
	var cl = google.loader.ClientLocation;

	if(cl !== null){
		$('#brand_list').load('/new_brand_list.php?pref=' + encodeURI(cl.address.region));
		$('#pickup_list').load('/new_pickup_list.php?pref=' + encodeURI(cl.address.region));
		$('#sp_list').load('/new_special_list.php?pref=' + encodeURI(cl.address.region));
	}else{
		$.get('/ipinfodb.php',function(pref_nm){
			$('#brand_list').load('/new_brand_list.php?pref=' + encodeURI(pref_nm));
			$('#pickup_list').load('/new_pickup_list.php?pref=' + encodeURI(pref_nm));
			$('#sp_list').load('/new_special_list.php?pref=' + encodeURI(pref_nm));
		});
	}
}

function changeMapImage(imgPath) {
	document.getElementById('bigmap').src = imgPath;
}

// 塾名で探す ヒントテキスト
$(document).ready(function(){
	$('#text')
	.blur(function(){
		var $$=$(this);
		if($$.val()=='' || $$.val()==$$.attr('title')){
			$$.css('color', '#999')
			.val($$.attr('title'));
		}
	})
	.focus(function(){
		var $$=$(this);
		if($$.val()==$$.attr('title')){
			$(this).css('color', '#000')
			.val('');
		}
	})
	.parents('form:first').submit(function(){
		var $$=$('#text');
		if($$.val()==$$.attr('title')){
			$$.triggerHandler('focus');
		}
	}).end()
	.blur();
});

$("area").live("click", function(){
	var pref_cd = $(this).attr("name").replace(/a/,"");
	var style = $(this).attr("id").replace(/b/,"");
	var pref_nm = $(this).attr("alt");
	var top  = style.replace(/#.+/,"");
	var left = style.replace(/.+?#/,"");

	top  = top  + "px";
	left = left + "px";

	$("#menu").css("display", "block");
	$("#menu").css("top", top);
	$("#menu").css("left", left);

	$("#searchRosen").attr('href', '/line/' + pref_cd + ".html");
	$("#searchArea").attr('href', '/city/' + pref_cd + ".html");
	$("#searchMap").attr('href','/map/?free=&row_name=&q=' + encodeURI(pref_nm) + '&commit.x=0&commit.y=0');
});

$("#close_btn img").live("click", function(){
	$("#menu").attr("style","display: none");
});

