// マウスオーバー
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
	//window.addEventListener("load", initSearchText , false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
	//window.attachEvent("onload", initSearchText);
}


// NEWアイコンの表示切替
function NewMark(y,m,d) {
oldDay = new Date(y,m,d);	//コンテンツ更新日の取得
newDay = new Date(2010,03,12);	//サーバータイムの取得
n = (newDay - oldDay)/(1000*60*60*24);
if (n <= 14) document.write("<img src='/common/imgs/ico_new.gif' alt='[NEW!]' width='24' height='11' class='ico' />");　//(n <= xx)部分で、何日以内の指定が可能
}


// ポップアップ用（お問い合わせフォーム用）
function contactPopup(url) {
	window.open(url,"contact","width=720,height=690,status=yes,menubar=no,location=yes,toolbar=no,scrollbars=yes,resizable=yes");
	return false;
}


// タブ切り替え


/*function trend(num){
	$$(".trend").each(function(obj){obj.style.display = "none";});
	document.getElementById("trend" + num ).style.display = "block";
}

function search(num){
	$$(".search").each(function(obj){obj.style.display = "none";});
	document.getElementById("search" + num ).style.display = "block";
}*/



// 「サイト内検索」フォーカス時にテキストを消す

//function onFocusHead(obj){
//	$("searchtxt").value = "";
//}

//function onBlur(obj){
//	if($("searchtxt").value == ""){
//		$("searchtxt").value = "サイト内検索";
//	}
//}

//function initSearchText() {
//	$("searchtxt").value = "サイト内検索";
//}



