/* ----------------------------------------------------- */
/* jquery ロード*/
/* ----------------------------------------------------- */
$(function(){

	/* aタグクリック時の枠線無効に */
	/* ----------------------------------------------------- */
	$('a').focus(
		function(){
		this.blur();
	});

	/* ロールオーバー */
	/* ----------------------------------------------------- */
	$('img.over').not('[src*="-o."]').hover(function()
	{
		Rollover($(this),$(this).attr('src'));	
	},function() {
		Rollover($(this),$(this).attr('src'));	
	});	


	/* ページ内スクロール */
	/* ----------------------------------------------------- */
	$('a[href^=#]').click(function(event) {
    	var hash = this.hash;
		if(hash!==''){
			var tarPosition = $(hash).offset().top;
			if(undefined !== window.opera && "function" === typeof window.opera.version){ // opera
				$('html').animate({scrollTop: tarPosition}, 400, 'easeOutQuad'); 
			}
			else{
				$('html, body').animate({scrollTop: tarPosition}, 400, 'easeOutQuad');
			}
			return false;
		}
	});


	/* フォーム */
	/* ----------------------------------------------------- */
	$("table input[type=text],table textarea").focus(function(){
			$(this).addClass('focus');							
	});
	$("table input[type=text],table textarea").blur(function(){
		$(this).removeClass('focus');															
	});

	/* addclass */
	/* ----------------------------------------------------- */
	/*$('#gnav li:last-child').addClass('last-c');*/
	$('#topContents dl:first').addClass('first');


});

/* ----------------------------------------------------- */
/*　ページ内スクロール用　*/
/* ----------------------------------------------------- */
jQuery.easing.easeOutQuad = function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
};
/* ----------------------------------------------------- */
/* flatHeights */
/* ----------------------------------------------------- */
var flat = function(obj,flatobj,num){
	var sets = [], temp = [];
	/* numごとで高さ揃える */
		$(obj).find(flatobj).each(function(i) {
				temp.push(this);
				if ((i+1) % num == 0) {
						sets.push(temp);
						temp = [];
				}
		});
		if (temp.length) sets.push(temp);

		/* 各組ごとに高さ揃え */
		$.each(sets, function() {
				$(this).flatHeights();
		});
		sets = [], temp = [];
}


