/* #############################################################
#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()"


/* ==============================================================
	
	GoogleAnalytics Tracking code
	for header read

============================================================== */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

var header = document.getElementsByTagName("head")[0];
var scriptTag = document.createElement("script");
scriptTag.setAttribute("src", gaJsHost + "google-analytics.com/ga.js");
scriptTag.setAttribute("type", "text/javascript");

header.appendChild(scriptTag);

function analytics() {
	try {
		var pageTracker = _gat._getTracker("UA-1948855-19");
		pageTracker._trackPageview();
	} catch(err) {
		// alert("Google Analytics:" + err);
	}
}

if (window.attachEvent) {
	window.attachEvent("onload", analytics);
} else {
	window.addEventListener("load", analytics, false);
}
