/*--------------------------------------------------------------------------------

					pc用ボタンアクション

---------------------------------------------------------------------------------*/
jQuery(function() {

/*--------------------------------------------------------------------------------

					   イメージナビゲーション
					 (マウスオーバーバージョン)

---------------------------------------------------------------------------------*/

/* サイドバーポップアップ */

/* PopUp1 */
	jQuery(".PopAncor").hover(
		function(){
			jQuery("#PopUp1").css("display","block");
		},
		function () {
			jQuery("#PopUp1").css("display","none");
	  	}
	);

	jQuery("#PopUp1").hover(
		function(){
			jQuery("#PopUp1").css("display","block");
		},
		function () {
			jQuery("#PopUp1").css("display","none");
	  	}
	);

/* PopUp2 */
	jQuery(".PopAncor2").hover(
		function(){
			jQuery("#PopUp2").css("display","block");
		},
		function () {
			jQuery("#PopUp2").css("display","none");
	  	}
	);
	jQuery("#PopUp2").hover(
		function(){
			jQuery("#PopUp2").css("display","block");
		},
		function () {
			jQuery("#PopUp2").css("display","none");
	  	}
	);

/* PopUp3 */
	jQuery(".PopAncor3").hover(
		function(){
			jQuery("#PopUp3").css("display","block");
		},
		function () {
			jQuery("#PopUp3").css("display","none");
	  	}
	);

	jQuery("#PopUp3").hover(
		function(){
			jQuery("#PopUp3").css("display","block");
		},
		function () {
			jQuery("#PopUp3").css("display","none");
	  	}
	);

/* PopUp4 */
	jQuery(".PopAncor4").hover(
		function(){
			jQuery("#PopUp4").css("display","block");
		},
		function () {
			jQuery("#PopUp4").css("display","none");
	  	}
	);

	jQuery("#PopUp4").hover(
		function(){
			jQuery("#PopUp4").css("display","block");
		},
		function () {
			jQuery("#PopUp4").css("display","none");
	  	}
	);

/* PopUp5 */
	jQuery(".PopAncor5").hover(
		function(){
			jQuery("#PopUp5").css("display","block");
		},
		function () {
			jQuery("#PopUp5").css("display","none");
	  	}
	);

	jQuery("#PopUp5").hover(
		function(){
			jQuery("#PopUp5").css("display","block");
		},
		function () {
			jQuery("#PopUp5").css("display","none");
	  	}
	);


/* --------------------------------------

		トップページタブ
		(★今後変数化)

-------------------------------------- */

jQuery("#scrollable").hover(
	function(){
		jQuery("#scrollable .prev").fadeIn("fast");
		jQuery("#scrollable .next").fadeIn("fast");
	},
	function () {
		jQuery("#scrollable .prev").fadeOut("fast");
		jQuery("#scrollable .next").fadeOut("fast");
  	}
);


jQuery(".MoreBtn").click(function () {
	var str = $(this).attr("id");

	jQuery("#" + str ).css("display", "none");

	str = str.replace("_3", "_31");
	str = str.replace("_2", "_21");
	str = str.replace("_1", "_11");
	//alert(str);
	jQuery("." + str).fadeIn();

	var contents_height = jQuery("#BlockRightcontent").height();
	resizeall(contents_height);
});

/*
jQuery(".MoreAncor1_1").click(function () {
	jQuery(".TabBox1_11").fadeIn();

	var contents_height = jQuery("#BlockContent").height() + 480;
	jQuery("#BlockContent").css("height",contents_height + "px");

	var contentsHeight = jQuery("#BoxLeftsideOuter").height() + 480;
	jQuery("#BoxLeftsideOuter").css("height",contentsHeight + "px");
	jQuery(".MoreAncor1_1").css("display", "none");
});

jQuery(".MoreAncor1_2").click(function () {
	jQuery(".TabBox1_21").fadeIn();
	var contents_height = jQuery("#BlockContent").height() + 480;
	jQuery("#BlockContent").css("height",contents_height + "px");

	var contentsHeight = jQuery("#BoxLeftsideOuter").height() + 480;
	jQuery("#BoxLeftsideOuter").css("height",contentsHeight);

	jQuery(".MoreAncor1").css("display","none");
	jQuery(".MoreAncor1_2").css("display", "none");
	jQuery(".MoreAncor1_3").css("display", "none");
});
*/

/*
jQuery(".MoreAncor2").click(
	jQuery(".TabBox1_11").fadeIn();
}
jQuery(".MoreAncor3").click(
	jQuery(".TabBox1_11").fadeIn();
}
jQuery(".MoreAncor4").click(
	jQuery(".TabBox4_11").fadeIn();
}
*/



/* 店舗紹介 表示切り替え */

var ua = navigator.userAgent;       // ユーザーエージェント
var nHit = ua.indexOf("MSIE");     // 合致した部分の先頭文字の添え字
var bIE = (nHit >=  0);                 // IE かどうか
var bVer7 = (bIE && ua.substr(nHit+5, 1) == "7");  // バージョンが 7 かどうか

/* 店舗1 */
jQuery(".ShopList1").bind("mouseover",{x:bVer7},function(e){
	jQuery(this).addClass("selected");
	jQuery(this).parent().parent().children(".Up").children(".Big2").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big3").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big4").css("display","none");
	jQuery(this).parent().children(".ShopList2").removeClass("selected");
	jQuery(this).parent().children(".ShopList3").removeClass("selected");
	jQuery(this).parent().children(".ShopList4").removeClass("selected");
	if(e.data.x) {
		jQuery(this).parent().parent().children(".Up").children(".Big1").css("display","inline");
	}
	else {
		jQuery(this).parent().parent().children(".Up").children(".Big1").css("display","table-cell");
	}
});
/* 店舗2 */
jQuery(".ShopList2").bind("mouseover",{x:bVer7},function(e){
	jQuery(this).addClass("selected");
	jQuery(this).parent().parent().children(".Up").children(".Big1").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big3").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big4").css("display","none");
	jQuery(this).parent().children(".ShopList1").removeClass("selected");
	jQuery(this).parent().children(".ShopList3").removeClass("selected");
	jQuery(this).parent().children(".ShopList4").removeClass("selected");
	jQuery(this).addClass("selected");
	if(e.data.x) {
		jQuery(this).parent().parent().children(".Up").children(".Big2").css("display","inline");
	}
	else {
		jQuery(this).parent().parent().children(".Up").children(".Big2").css("display","table-cell");
	}
});


/* 店舗3 */
jQuery(".ShopList3").bind("mouseover",{x:bVer7},function(e){
	jQuery(this).addClass("selected");
	jQuery(this).parent().parent().children(".Up").children(".Big1").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big2").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big4").css("display","none");
	jQuery(this).parent().children(".ShopList1").removeClass("selected");
	jQuery(this).parent().children(".ShopList2").removeClass("selected");
	jQuery(this).parent().children(".ShopList4").removeClass("selected");

	if(bVer7) {
		jQuery(this).parent().parent().children(".Up").children(".Big3").css("display","inline");
	}
	else {
		jQuery(this).parent().parent().children(".Up").children(".Big3").css("display","table-cell");
	}
});

/* 店舗4 */
jQuery(".ShopList4").bind("mouseover",{x:bVer7},function(e){
	jQuery(this).addClass("selected");
	jQuery(this).parent().parent().children(".Up").children(".Big1").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big2").css("display","none");
	jQuery(this).parent().parent().children(".Up").children(".Big3").css("display","none");
	jQuery(this).parent().children(".ShopList1").removeClass("selected");
	jQuery(this).parent().children(".ShopList2").removeClass("selected");
	jQuery(this).parent().children(".ShopList3").removeClass("selected");
	if(bVer7) {
		jQuery(this).parent().parent().children(".Up").children(".Big4").css("display","inline");
	}
	else {
		jQuery(this).parent().parent().children(".Up").children(".Big4").css("display","table-cell");
	}
});


/* 住所自動入力 */
	jQuery(".ZipTextBox").bind('keyup', function() {
		AjaxZip2.zip2addr(this,'pref','addr');
		 }
	);
/*
	jQuery(".ZipTextBox").onkeyup(
		function(){
			AjaxZip2.zip2addr(this,'pref','addr');
		}
	);
*/

/* -----------------------------------------------------------

	ボタンオーバー　切り替わり

-------------------------------------------------------------- */

	//ページトップへボタン
	jQuery("#ToTopBox a img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/common/bg/totop_front_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/common/bg/totop_front.png");
	  	}
	);


	/* メンバーログイン系　バックグラウンド */
	jQuery("#MemberBox ul li").hover(
		function(){
			jQuery(this).css("background","url('/img/PC/common/bg/header_btn_on.png') no-repeat left top");
		},
		function () {
			jQuery(this).css("background","url('/img/PC/common/bg/header_btn.png') no-repeat left top");
	  	}
	);

	/* スライダブル画像 next back */
	jQuery("#top a.prev img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/scrollable/prev_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/scrollable/prev.png");
	  	}
	);
	jQuery("#top a.next img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/scrollable/next_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/scrollable/next.png");
	  	}
	);

	/* パーティー */
	jQuery("#party .ConfirmBtn img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/party/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/party/confirm.png");
	  	}
	);
	/* めいどりーみんとは */
	jQuery("#about .ConfirmBtnBox img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/about/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/about/confirm.png");
	  	}
	);

	/* キャスト募集 */
	jQuery("#recruitment #PartBtnBox img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/recruit/part_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/recruit/part.png");
	  	}
	);

	jQuery("#recruitment #RegularBtnBox img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/recruit/regular_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/recruit/regular_btn.png");
	  	}
	);

	/* お問い合わせ */
	jQuery("#contact1 #ImmediateBtn img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/immediate_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/immediate.png");
	  	}
	);

	/* お問い合わせ 送信ボタン */
	jQuery("#BackBtn input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/back_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/back.png");
	  	}
	);
	jQuery("#SubmitBtn input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/submit_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/submit_btn.png");
	  	}
	);
	jQuery("#SubmitBtn input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/submit_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/submit_btn.png");
	  	}
	);
	jQuery("#ConfirmBtn #inquiryformSubmit-2").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/confirm.png");
	  	}
	);
	jQuery("#ConfirmBtn #inquiryformSubmit-1").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/confirm.png");
	  	}
	);
	jQuery("#ConfirmBtn #inquiryformSubmit-3").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/confirm.png");
	  	}
	);
	jQuery("#ConfirmBtn #inquiryformSubmit-4").hover(
		function(){
			jQuery(this).attr("src","/img/PC/contact/confirm_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/contact/confirm.png");
	  	}
	);


	jQuery("#MemberAddBox .RegistBtn input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/member/regist/regist_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/member/regist/regist_btn.png");
	  	}
	);

	jQuery(".ModificationBtn input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/member/modification/modifi_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/member/modification/modifi_btn.png");
	  	}
	);

	/* -------------------------------------------------------------------

		タブがクリックされたら1秒後にコンテンツの高さ調整

	---------------------------------------------------------------------- */
	jQuery(".TabBox li a").click(function () {
		//timer = setTimeout("timers()", 1000);
		//jQuery(this).removeClass("shadow4");
		jQuery(".TabBox li a").removeClass("shadow4");
		jQuery(".TabBox li a").removeClass("shadow1");

		jQuery(".TabBox li a").addClass("shadow4");
		jQuery(this).removeClass("shadow4");
		jQuery(this).addClass("shadow1");
		timer = setTimeout( function () { 
			var contents_height = jQuery("#BlockRightcontent").height();
			//alert(contents_height);
			resizeall(contents_height);
		} , 1000 );

	});


	/* -------------------------------------------------------------------

		会員ページ

	---------------------------------------------------------------------- */
	jQuery("#member #MemeberTop .ListItems li").hover(
		function(){
			jQuery(this).css("background","#250d00");
			jQuery(this).find(".EachBox h4").css("color","#ffffff");
			jQuery(this).find(".EachBox p").css("color","#ffffff");
		},
		function () {
			jQuery(this).css("background","url(/img/PC/member/top/list_bg.png) repeat left top");
			jQuery(this).find(".EachBox h4").css("color","#250d00");
			jQuery(this).find(".EachBox p").css("color","#250d00");
	  	}
	);

	//ログアウトボタン
	jQuery(".LogoutBtn a img").hover(
		function(){
			jQuery(this).attr("src","/img/PC/member/top/logout_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/member/top/logout_btn.png");
	  	}
	);

	jQuery(".BoxLogin .submit input").hover(
		function(){
			jQuery(this).attr("src","/img/PC/member/login_btn_on.png");
		},
		function () {
			jQuery(this).attr("src","/img/PC/member/login_btn.png");
	  	}
	);

});


