// jQuery - Setting file

/**
 * フリーワード入力チェック
 */
$(document).ready( function() {
	$('.freeBlock form').submit( function() {
		if ($('#keyword').val() == "") {
			alert("\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002");
			return false;
		}
	});
});


/**
 * キーワードカウント
 */
$(document).ready( function() {
	$('div#mediKeyword ul li a').click( function() {
		$.get("/99navi/keyword/countUp.do?id=" + $(this).attr("rel"));
	});
});


/**
 * 別サイトは別窓で開く
 */
$(document).ready( function() {
	$('a[@href^="http"]').not('[@href^="http://www.99navi"]').click(function() {
		window.open(this.href, '');
		return false;
	});
});


/**
 * ロールオーバー
 */
function initRollOverImages() {
	var image_cache = new Object();
	$('input[@type="image"]').not('[@src*="_on."]').each( function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});
}
$(document).ready(initRollOverImages);

