$(function() {
	// GlobalNavigation	
		$("#floor li#navi01 img").attr({"src":"/common/img/g_navi/g_navi_01_on.png"});
		$("#flow li#navi02 img").attr({"src":"/common/img/g_navi/g_navi_02_on.png"});
		$("#service li#navi03 img").attr({"src":"/common/img/g_navi/g_navi_03_on.png"});
		$("#company li#navi04 img").attr({"src":"/common/img/g_navi/g_navi_04_on.png"});
		$("#staff li#navi05 img").attr({"src":"/common/img/g_navi/g_navi_05_on.png"});
		$("#link li#navi06 img").attr({"src":"/common/img/g_navi/g_navi_06_on.png"});
});

$(function() {
//smartRollover
	var imgCount = 0;
	var images_pre = new Array();
	$('img[src*="_off."],input[src*="_off."]').each (function(){
		images_pre[imgCount] = new Image();
		images_pre[imgCount].src = $(this).attr("src").replace("_off.", "_on.");
		$(this).hover(
			function () {
				$(this).attr("src", $(this).attr("src").replace("_off.", "_on."));
			},
			function () {
				$(this).attr("src", $(this).attr("src").replace("_on.", "_off."));
			}
		);
		imgCount ++;
	});

// opacity Rollover
    	$('img[src*="_op."],input[src*="_op."]').hover(
			function () {
				$(this).css('opacity', 0.6).css('filter', 'alpha(opacity=60)');
			},
			function () {
				$(this).css('opacity', 1).css('filter', 'alpha(opacity=100)');
			}
		);

// smoothScroll
	$('a[href^="#"], a[href^="' + location.pathname + '#"]').each (function(){
		var hash = this.hash;
		if(hash.length > 1 && !this['rel']){
			$(this).click(function() {
				smoothScroll(hash);
				return false;
			})
		}
	});

function smoothScroll(hash) {
	var target = $(hash).offset().top;

	$(($.browser.safari) ? 'body' : 'html')
		.animate({scrollTop: target >= 15 ? target - 15 : target}, 600, 'swing', function(){$(this).unbind("mousewheel DOMMouseScroll");})
		.bind("mousewheel DOMMouseScroll",function(){
			$(this).queue([]).stop();
			$(this).unbind("mousewheel DOMMouseScroll");
		});
};

});





(function($) {

	$(function() {
		$.css3.stripe();
		$.css3.css3class();
	});

	$.css3 = {
		//奇数、偶数を自動追加
		stripe: function(options) {
			var c = $.extend({
				oddClass:'odd',
				evenClass:'even'
			}, options);
			$('ul.odd_even, #job_category ul').each(function(){
				//JSでは0から数えるのでevenとaddを逆に指定
				$(this).children('li:odd').addClass(c.evenClass);
				$(this).children('li:even').addClass(c.oddClass);
			});
			$('#floor_dl, #voice, .odd_even').each(function(){
				$(this).children('dl:odd').addClass(c.evenClass);
				$(this).children('dl:even').addClass(c.oddClass);
			});
		},
		//css3のクラスを追加
		css3class: function() {
			//:first-child, :last-childをクラスとして追加
			$('body :first-child').addClass('firstChild');
			$('body :last-child').addClass('lastChild');
			//css3の:emptyをクラスとして追加
			$('body :empty').addClass('empty');
		}
	};
})(jQuery);
