jQuery(function(){
	// window.open :: サイト内メニュー
	$("#header li a, #footer li a")
		.click(
			function() {
				if ($(this).attr('title') != 'HOME') {
					obj = window.open( $(this).attr('href'), 'subsize', 'width=420, height=570, scrollbars=no, resizable=no' );
					obj.focus();
					return false;
				}
			}
		)
	;
	
	// 
	$("#movieIcon a")
		.click(
			function() {
				obj = window.open( $(this).attr('href'), 'movie', 'width=600, height=640, scrollbars=no, resizable=no' );
				obj.focus();
				return false;
			}
		)
	;
	
	
	// window.open :: PRバナー
	$(".adv a")
		.click(
			function() {
				obj = window.open( $(this).attr('href'), '_blank');
				obj.focus();
				return false;
			}
		)
	;
	
	
	// メルマガ登録フォーム :: 初期値調整
	$("#registForm #mail")
		.focus(
			function () {
				if ($(this).val() == 'ﾒｰﾙｱﾄﾞﾚｽを入力して下さい') {
					$(this).val('');
				}
				$(this).css('background-color', '#f0eabf');
				$(this).css('color', '#000');
			}
		)
	;
	
	$("#registForm #mail")
		.blur(
			function () {
				if ($(this).val() == '') {
					$(this).val('ﾒｰﾙｱﾄﾞﾚｽを入力して下さい');
				}
				$(this).css('background-color', '#fff');
				if ($(this).val() == 'ﾒｰﾙｱﾄﾞﾚｽを入力して下さい') {
					$(this).css('color', '#999');
				}
			}
		)
	;
	$("#registForm #mail").blur();
	
	
	// メルマガ登録フォーム :: 規約同意確認
	$('#registForm form')
		.submit(
			function () {
				if ($("#agree").attr('checked') != true) {
					alert('利用規約に同意してください');
					return false;
				}
				if ($("#registForm #mail").val() == '' || $("#registForm #mail").val() == 'ﾒｰﾙｱﾄﾞﾚｽを入力して下さい') {
					alert('メールアドレスを入力して下さい');
					$("#registForm #mail").focus();
					return false;
				}
			}
		)
	;
	
	// サブウインドウを閉じるボタン
	$("#subsize .close img, #movie .close img")
		.click(
			function () {
				window.close();
			}
		)
	;
});
