/*----------------------------------------
Name: common.js
Date Created:2011/12/07 [t.sato]
Last Updated:2011/12/07 [t.sato]
----------------------------------------*/


/*　ロールオーバー */


function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src") && images[i].getAttribute("src").match("_out\\."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_out.", "_over."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_over.", "_out."));
				}
			}
		}
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

/*　タブ */

$(function() {
	// トップページ 物件情報
	$('#estateItem .tabNav li').click(function() {
		$('#estateItem .on').removeClass('on').addClass('off');
		$(this).removeClass('off').addClass('on');

		$('#estateItem .show').removeClass('show').addClass('hide');
		$('#' + $(this).attr('title')).removeClass('hide').addClass('show');
	});

	// トップページ ニュース
	$('#news .tabNav li').click(function() {
		$('#news .on').removeClass('on').addClass('off');
		$(this).removeClass('off').addClass('on');

		$('#news .show').removeClass('show').addClass('hide');
		$('#' + $(this).attr('title')).removeClass('hide').addClass('show');
	});

});



