// JavaScript Document

// 自動でロールオーバーイメージを適応する
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);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


// 一定期間New/Upマークを表示する
function newUp(y, m, d, c) {
  delDay = 14; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    document.write('<div class="new">&nbsp;</div>');
  } else {
    document.write('<div class="none">&nbsp;</div>');
  }
}

// お問い合わせフォームをポップアップで表示
function popup_window(popup_URL){
	window.open(popup_URL, "window_name", "width=525, height=600, scrollbars=yes, resizable=no, menubar=no, toolbar=no, location=no, directories=no, status=no");
	}
