// 背景画像読み込みキャッシュ
try { 
	document.execCommand('BackgroundImageCache', false, true); 
} catch(e) {}

// ロールオーバー
var smartRollover = {
	config: function(){
		smartRollover.init('img');
		smartRollover.init('input');
	},

	init: function(tag) {
		var images = document.getElementsByTagName(tag);
		if(!images) return;
		var preload = new Array();
		for(var i=0; i < images.length; i++) {
			if(images[i].className.indexOf('rollover') != -1){
				var path = images[i].src;
				var ext = path.slice(path.length-4, path.length);
				preload[i] = new Image();
				preload[i].src = images[i].src.replace(ext, '_on'+ext);
				images[i].onmouseover = function() {
					this.setAttribute("src", this.src.replace(ext, '_on'+ext));
				};
				images[i].onmouseout = function() {
					this.setAttribute("src", this.src.replace('_on'+ext, ext));
				};
			}
		}
	},

	addEvent: function(){
		try {
			window.addEventListener('load', smartRollover.config, false);
		} catch (e) {
			window.attachEvent('onload', smartRollover.config);
		}
	}
}
smartRollover.addEvent();




// ウィンドウ 閉じる
function closeWindow(){
window.close();
}


// ウィンドウ フォーカス
function focusWindow(){
window.focus();
}


// 前のページに戻る
function pageback(){
history.back();
return false;
}


// フォーム フォーカス
function inputFocus()
{
 if(document.forms[0].elements[0]) {
    document.forms[0].elements[0].focus();
    return true;
  }
}


// フレーム強制解除
if (top != self) { top.location.href = self.location.href }



// 一定期間New/Upマークを表示する
function newUp(y, m, d, c) {
  delDay = 7; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // Newマーク
    if(c == "new") document.write("<span class='aNew'>New!</span>");
    // Upマーク
    if(c == "up") document.write("<span class='aUp'>Up!</span>");
  }
}

