/* #############################################################
#WEB_SITES_JS {
	--------------------------------------------
	#web site   : ncd-ri.co.jp;
	#author     : #Shigemi_Uehara;
	#version    : 6.0;
	#last update: 071203 by #Shigemi_Uehara;
	--------------------------------------------
}

#THIS_CSS {
	--------------------------------------------
	サイト内JavaScriptの管理ファイル
	--------------------------------------------
}
	
#CONTENT {
	--------------------------------------------
	+ 1: rollover function
	+ 2: scroll function
	+ 3: stripe function
	+ 999: CSS set
	
	+ 4: IE hover fucntion
	--------------------------------------------
}

#KEY {
	ファイル内管理
	--------------------------------------------
	Search key "+" + "number"
	--------------------------------------------
}

#COPYRIGHT {
	--------------------------------------------
	COPYRIGHT(c)NIPPON COLOR&DESIGN INS TITUTE INC.
	--------------------------------------------
}	
############################################################# */


/* [=memo MODx利用時の JSライブラリ mootoolsとの衝突回避 ] 
jQuery を使うときは$();の代わりに jQuery(); または j$();
を使います。
*/
jQuery.noConflict();
var j$ = jQuery;



/* ==============================================================
	
	[+1] rollover function

============================================================== */
$(function(){
	j$('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");
	});
	
	j$("div#header dl#mainNavigation dd ul>li").hover(function(){
		j$(this).addClass("hover");
	},function(){
		j$(this).removeClass("hover");
	});
	j$(".hv").hover(function(){
		j$(this).addClass("hover");
	},function(){
		j$(this).removeClass("hover");
	});



/* ==============================================================
	
	[+2] scroll function
	for jQuery


============================================================== */
//jQuery & scroll.js is necessary. 
/*
【操作手順】
.toTop a‘と書くとtoTopというclass名の中にあるaをクリックした時の動作を設定してあります。
---------------------------------------------------------------
<p class="toTop"><a href="#header">ページの先頭に戻る</a></p>
---------------------------------------------------------------
*/
	j$('.toTop a').click(function(){
		j$('#header').ScrollTo(1000, 'easeout');
		return false;
	});





/* ==============================================================
	
	[+3] stripe function
	for jQuery

============================================================== */
	j$('ul.stripe').each(function(){
		j$(this).find('li:odd').addClass('even');
		j$(this).find('li:even').addClass('odd');
	});
	j$('dl.stripe').each(function(){
		j$(this).find('dd:odd').addClass('even');
		j$(this).find('dd:even').addClass('odd');
	});
	j$('table').each(function(){
		j$(this).find('tr:odd').addClass('even');
		j$(this).find('tr:even').addClass('odd');
	});





/* ==============================================================
	
	[+999:] CSS set
	for jQuery
	
============================================================== */
/*
	//jQuery is necessary. 
	$("#rap").css({
		background:"url(img/rap_bg.png) no-repeat top",
	});
*/
});





/* ==============================================================
	
	[+5] IE hover fucntion
	for jQuery

============================================================== */
/*  IE6以下のみ対応していない:hoverの代わりに.hoverクラス付与関数
-----------------------------------*/
function setHover(targetElm) {
	j$(targetElm).hover(function() {
		j$(this).addClass("hover");},function() {
		j$(this).removeClass("hover");
	});
}
