jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
$(function () {


	//==========================================================================================
	//textresizerSetting
	$( "#textsizer a" ).textresizer({
		target: "#container",
		type: "cssClass",
		sizes: [ "small-text", "medium-text", "large-text"],
		selectedIndex: 0
	});
	//==========================================================================================
	//GlobalNaviSetting
	//Home
	if($('body').attr('id') == 'home'){
		globalNaviPathArr = $('#globalNavHome img:first').attr('src').split('.png');
		$('#globalNavHome img:first').attr("src",globalNaviPathArr[0] + '-on' + '.png');
		$('#globalNavHome img:first').removeClass('imgOverGlobal');
		
	}
	//about
	if($('body').attr('id') == 'about'){
		globalNaviPathArr = $('#globalNavAbout img:first').attr('src').split('.png');
		$('#globalNavAbout img:first').attr("src",globalNaviPathArr[0] + '-on' + '.png');
		$('#globalNavAbout img:first').removeClass('imgOverGlobal');
		
	}
	//group
	if($('body').attr('id') == 'group'){
		globalNaviPathArr = $('#globalNavGroup img:first').attr('src').split('.png');
		$('#globalNavGroup img:first').attr("src",globalNaviPathArr[0] + '-on' + '.png');
		$('#globalNavGroup img:first').removeClass('imgOverGlobal');
		
	}
	
	//request
	if($('body').attr('id') == 'request'){
		globalNaviPathArr = $('#globalNavRequest img:first').attr('src').split('.png');
		$('#globalNavRequest img:first').attr("src",globalNaviPathArr[0] + '-on' + '.png');
		$('#globalNavRequest img:first').removeClass('imgOverGlobal');
	}
	
	//request
	if($('body').attr('id') == 'contact'){
		globalNaviPathArr = $('#globalNavContact img:first').attr('src').split('.png');
		$('#globalNavContact img:first').attr("src",globalNaviPathArr[0] + '-on' + '.png');
		$('#globalNavContact img:first').removeClass('imgOverGlobal');
	}
		
	//GlobalNaviOver	
	$('img.imgOverGlobal').hover(function(){
		$(this).stop().animate({'opacity' : '0'}, 0);
	},function(){$(this).stop().animate({'opacity' : '1'}, 400);});

	
	//==========================================================================================
	//LocalNaviSetting
	//for-person
	if($('body').attr('id') == 'for-person'){
		if($('body').attr('class') == 'outline'){
			localNaviPathArr = $('#localNavOutline img:first').attr('src').split('.gif');
			$('#localNavOutline img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavOutline img:first').removeClass('imgOverHarf');
		}
		if($('body').attr('class') == 'visit'){
			localNaviPathArr = $('#localNavVisit img:first').attr('src').split('.gif');
			$('#localNavVisit img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavVisit img:first').removeClass('imgOverHarf');
		}
		if($('body').attr('class') == 'freespace'){
			localNaviPathArr = $('#localNavFreespace img:first').attr('src').split('.gif');
			$('#localNavFreespace img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavFreespace img:first').removeClass('imgOverHarf');
		}

		if($('body').attr('class') == 'experience'){
			localNaviPathArr = $('#localNavExperience img:first').attr('src').split('.gif');
			$('#localNavExperience img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavExperience img:first').removeClass('imgOverHarf');
		}
		
		if($('body').attr('class') == 'relationship'){
			localNaviPathArr = $('#localNavRelationship img:first').attr('src').split('.gif');
			$('#localNavRelationship img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavRelationship img:first').removeClass('imgOverHarf');
		}
		if($('body').attr('class') == 'news'){
			localNaviPathArr = $('#localNavNews img:first').attr('src').split('.gif');
			$('#localNavNews img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavNews img:first').removeClass('imgOverHarf');
		}

	}
	//==========================================================================================
	//LocalNaviSetting
	//for-person
	if($('body').attr('id') == 'for-group'){
		if($('body').attr('class') == 'seminar'){
			localNaviPathArr = $('#localNavSeminar img:first').attr('src').split('.gif');
			$('#localNavSeminar img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavSeminar img:first').removeClass('imgOverHarf');
		}
		if($('body').attr('class') == 'seminar-case'){
			localNaviPathArr = $('#localNavSeminarCase img:first').attr('src').split('.gif');
			$('#localNavSeminarCase img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavSeminarCase img:first').removeClass('imgOverHarf');
		}
		if($('body').attr('class') == 'news'){
			localNaviPathArr = $('#localNavNews img:first').attr('src').split('.gif');
			$('#localNavNews img:first').attr("src",localNaviPathArr[0] + '-on' + '.gif');
			$('#localNavNews img:first').removeClass('imgOverHarf');
		}
	}
	//==========================================================================================
	//GlobalNaviOver
	$('img.imgOverGlobal').hover(function(){
		$(this).stop().animate({'opacity' : '0'}, 0);
	},function(){$(this).stop().animate({'opacity' : '1'}, 400);});
	
	//==========================================================================================
	//imgOver
	$('.imgOverHarf').hover(function(){
		$(this).stop().animate({'opacity' : '0.8'}, 0);
	},function(){$(this).stop().animate({'opacity' : '1'}, 0);});
	
	$('.imgOverFull').hover(function(){
		$(this).stop().animate({'opacity' : '0'}, 0);
	},function(){$(this).stop().animate({'opacity' : '1'}, 400);});
	
	//==========================================================================================
	//pageScroll
	$('a[href*=#headerArea]').click(function() {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					jQuery('html,body').stop().animate({ scrollTop: targetOffset }, 200, 'quart');
					return false;
				}
	;});
	$('a[href^=#jump]').click(function() {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					jQuery('html,body').stop().animate({ scrollTop: targetOffset }, 200, 'quart');
					return false;
				}
	;});
		
});


