/* #############################################################
#WEB_SITES_JS {
	--------------------------------------------
	#filename	: base.js
	#version    : 1.0;

	サイト内JavaScriptの管理ファイル
	--------------------------------------------
}

#CONTENT {
	--------------------------------------------
	+ 1: rollover function
	+ 2: stripe function
	+ 999: CSS set
	--------------------------------------------
}

############################################################# */


$(function(){
/* ==============================================================
	
	[+1:]
	rollover function
	for jQuery

============================================================== */
$('img.hov')
	.mouseover(function () {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
	})
	.mouseout(function () {
		this.src = this.src.replace(/^(.+)_hov(\.[a-z]+)$/, "$1$2");
	})
	.each(function () {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
});
$("input.hov")
	.mouseover(function () {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
	})
	.mouseout(function () {
		this.src = this.src.replace(/^(.+)_hov(\.[a-z]+)$/, "$1$2");
	})
	.each(function () {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
});


$('img.on')
	.each(function () {
	this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
});

/*
※jQuery is necessary. 
■ボタンのロールオーバー用ファンクション(jQuery版)

【操作手順】
[1]ロールオーバー前用の画像を適当なファイル名で用意します。 例：btn.gif
[2]ロールオーバー時用の画像のファイル名末端に"_hov"と付けます。 例：btn_hov.gif
[3]設置するimg要素に class="Hov" を指定します。
---------------------------------------------------------------
<img class="Hov" src="../../common/js/img/btn.gif" alt="test" />
---------------------------------------------------------------
*/


});
//END "$(function()"


/* ==============================================================
	
	[+2:]
	blank function
	※class="blank"指定で別ウィンドウで表示

============================================================== */
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
		((anchor.getAttribute("rel") == "external nofollow") || (anchor.getAttribute("rel") == "nofollow external") || (anchor.getAttribute("rel") == "external")))
		anchor.target = "_blank";
	}
}

window.onload = externalLinks;
