//----------------------------------------------------
// Name: jquery_setting.js
// Date Created:2009/02/15 [t.sato]
// Last Updated:2009/02/15 [t.sato]
// Copyright:Prudence.inc
//----------------------------------------------------


/* トップページ　エリアのタブ切り替え
======================================================================*/

$(function() {   
  $('.tabNavi li').click(function() {       
    $('.on').removeClass('on').addClass('off');   
    $(this).removeClass('off').addClass('on');   
  
    $('.show').removeClass('show').addClass('hide');   
    $('#' + $(this).attr('title')).removeClass('hide').addClass('show');   
  });   
});

/*　まとめてCSS設定
======================================================================
 var CSSname = '.class,#ID';　// ''内にクラス名、ID名を設定。カンマ区切り
 
【CSSclearfix】	clearfix(jquery_setting.css)を指定
【CSSsideways】 横並びDT/DD。sideways(jquery_setting.css)を指定

======================================================================
*/

$(function() {
	var CSSclearfix = '#header,#globalNavi ul';

$(CSSclearfix).addClass('clearfix');

});


/*　nの倍数だけCSS処理を変える
======================================================================
	$("#floatList li:nth-child(5n)").addClass('liRight'); 
	#floatList liの5個毎に.liRightを付ける。
	nがなければ、1回目のみ。最初の5つすべてに対する場合は『:lt(3)』
======================================================================
*/

$(document).ready(function() {
	$("#OfficeList li:nth-child(2n)").addClass('right'); // office_00.html
	$("table.nittei tr:nth-child(2n)").addClass('bg'); //beginner_05.tpl
});


/*　画像ロールオーバー
======================================================================
	initRollOverImages
	マウスオン画像はマウスオフ画像に "_on" をつけたものにすると、
	適用したスタイルの画像がロールオーバーになる。
======================================================================
*/

function initRollOverImages() {   
    var image_cache = new Object();   
    $("img.swap").not("[src*='_on.']").each(function(i) {   
        var imgsrc = this.src;   
        var dot = this.src.lastIndexOf('.');   
        var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);   
        image_cache[this.src] = new Image();   
        image_cache[this.src].src = imgsrc_on;   
        $(this).hover(   
            function() { this.src = imgsrc_on; },   
            function() { this.src = imgsrc; }   
        );   
    });   
}   
$(document).ready(initRollOverImages);





