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

	/* -- ポップアップ -- */
	/* ----------------------------------------------------- */
	popupWindow('a.to-recruit',800,650,'recruit');

	/* ページ内スクロール */
	/* ----------------------------------------------------- */
	$('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;
		}
	});

	/* 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;
};

/* ----------------------------------------------------- */
/* ポップアップウィンドウ開く */
/* ----------------------------------------------------- */
var popupWindow = function(tar,w,h,windowName){
	$(tar).click(function(){
		var Loc = $(this).attr('href');
		var features="scrollbars=yes,resizable=yes";
		features+=", left="+(window.screen.width-w)/2;
		features+=", top="+(window.screen.height-h)/2;
		features+=", width="+w;
		features+=", height="+h;
		var newWin=window.open(Loc,windowName,features);
		newWin.focus();
		return false;
	});
}


