

/* :first-child, :last-childをクラスとして追加
-----------------------------------------------------------*/
$(document).ready(function() {
	$('ul li:first-child,.news dt:first-child,.qa dd dl dt:first-child').addClass('firstChild');
	$('ul li:last-child').addClass('lastChild');
	$("ul li:only-child").removeClass("first-child").removeClass("last-child").addClass("only-child");

});


/* ウィンドウポップアップ
-----------------------------------------------------------*/
function openWindow(url, name, width, height){
	var w = window.open(url, name, 'scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,width=' + width + ',height=' + height);
	w.focus();
}


/* ロールオーバー
-----------------------------------------------------------*/
(function($) {
	$.fn.rollover = function(postfix) {
		postfix = (postfix != null) ? postfix : '_on';
		
		return this.not('[src*="'+ postfix +'."]').each(
		function() {
			var img = $(this);
			var src = img.attr('src');
			var src_on = src.substr(0, src.lastIndexOf('.'))
			           + postfix
			           + src.substring(src.lastIndexOf('.'));
			$('<img>').attr('src', src_on);
			img.hover(
				function() {
					img.attr('src', src_on);
				},
				function() {
					img.attr('src', src);
				}
			);
		});
		
		
	};
})(jQuery);


jQuery(document).ready(function($) {
   // set postfix
   $('#globalNavi a img').rollover();
   $('.recruit a img,.original a img').rollover();
 });


/* 資料請求フォーム
-----------------------------------------------------------*/
function checkRequestEnter() {
	document.form1.enterDecided.checked = true;
}
function checkRequestAttend() {
	document.form1.attendDecided.checked = true;
}

