
$(function() {

	$(".history_line .image img").hover(function(){
		$(this).css("border-color","#58BA00");
	}, function(){
		$(this).css("border-color","#FFFFFF");
	});

	$(".h_radio").hover(function(){
		$(this).css("background","#F2F2F2 url(/img/home/bg_radio.gif) no-repeat top center");
	}, function(){
		$(this).css("background-image","none");
	});

	$(".h_service").hover(function(){
		$(this).css("background","#F2F2F2 url(/img/home/bg_service.gif) no-repeat top center");
	}, function(){
		$(this).css("background-image","none");
	});

	$(".h_event").hover(function(){
		$(this).css("background","#F2F2F2 url(/img/home/bg_event.gif) no-repeat top center");
	}, function(){
		$(this).css("background-image","none");
	});

	$(".h_private").hover(function(){
		$(this).css("background","#F2F2F2 url(/img/home/bg_private.gif) no-repeat top center");
	}, function(){
		$(this).css("background-image","none");
	});

	$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat top center");

	$(".thickbox").click(function(){
		$("object").css("visibility","hidden");
	});

	$("#lbl_1_2").click(function(){
		f_ClickRadio();
	});

	// 吹き出し表示
	$("#staff_bar #staff_1 dt div").html("<a href=\"javascript:jf_DispMsg('hbkr');\"></a>");
	$("#staff_bar #staff_3 dt div").html("<a href=\"javascript:jf_DispMsg('daiskip');\"></a>");
	$("#staff_bar #staff_4 dt div").html("<a href=\"javascript:jf_DispMsg('mochinaga');\"></a>");
	$("#staff_bar #staff_5 dt div").html("<a href=\"javascript:jf_DispMsg('shimoda');\"></a>");


	$(".logpi_msg").hover(function(){
	}, function(){
		$(this).fadeOut("slow");
	});

});




//********************************
// ヒストリー表示項目
//********************************
function jf_DispHis(pMode){

	if( pMode=="all" ){

		$("#btn_1").css("background","url(/img/home/btn_1.gif) no-repeat bottom center");

		$(".h_service").slideDown("slow");
		$(".a_service").slideDown("slow");
		$("#btn_2").css("background","url(/img/home/btn_2.gif) no-repeat bottom center");

		$(".h_radio").slideDown("slow");
		$(".a_radio").slideDown("slow");
		$("#btn_3").css("background","url(/img/home/btn_3.gif) no-repeat bottom center");

		$(".h_event").slideDown("slow");
		$(".a_event").slideDown("slow");
		$("#btn_4").css("background","url(/img/home/btn_4.gif) no-repeat bottom center");

		$(".h_private").slideUp("slow");
		$(".a_private").slideUp("slow");
		$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat top center");

	}

	if( pMode=="service" ){

		$("#btn_1").css("background","url(/img/home/btn_1.gif) no-repeat top center");

		$(".h_service").slideDown("slow");
		$(".a_service").slideDown("slow");
		$("#btn_2").css("background","url(/img/home/btn_2.gif) no-repeat bottom center");

		$(".h_radio").slideUp("slow");
		$(".a_radio").slideUp("slow");
		$("#btn_3").css("background","url(/img/home/btn_3.gif) no-repeat top center");

		$(".h_event").slideUp("slow");
		$(".a_event").slideUp("slow");
		$("#btn_4").css("background","url(/img/home/btn_4.gif) no-repeat top center");

		$(".h_private").slideUp("slow");
		$(".a_private").slideUp("slow");
		$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat top center");

	}

	if( pMode=="radio" ){

		$("#btn_1").css("background","url(/img/home/btn_1.gif) no-repeat top center");

		$(".h_service").slideUp("slow");
		$(".a_service").slideUp("slow");
		$("#btn_2").css("background","url(/img/home/btn_2.gif) no-repeat top center");

		$(".h_radio").slideDown("slow");
		$(".a_radio").slideDown("slow");
		$("#btn_3").css("background","url(/img/home/btn_3.gif) no-repeat bottom center");

		$(".h_event").slideUp("slow");
		$(".a_event").slideUp("slow");
		$("#btn_4").css("background","url(/img/home/btn_4.gif) no-repeat top center");

		$(".h_private").slideUp("slow");
		$(".a_private").slideUp("slow");
		$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat top center");

	}

	if( pMode=="event" ){

		$("#btn_1").css("background","url(/img/home/btn_1.gif) no-repeat top center");

		$(".h_service").slideUp("slow");
		$(".a_service").slideUp("slow");
		$("#btn_2").css("background","url(/img/home/btn_2.gif) no-repeat top center");

		$(".h_radio").slideUp("slow");
		$(".a_radio").slideUp("slow");
		$("#btn_3").css("background","url(/img/home/btn_3.gif) no-repeat top center");

		$(".h_event").slideDown("slow");
		$(".a_event").slideDown("slow");
		$("#btn_4").css("background","url(/img/home/btn_4.gif) no-repeat bottom center");

		$(".h_private").slideUp("slow");
		$(".a_private").slideUp("slow");
		$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat top center");

	}

	if( pMode=="private" ){

		$("#btn_1").css("background","url(/img/home/btn_1.gif) no-repeat top center");

		$(".h_service").slideUp("slow");
		$(".a_service").slideUp("slow");
		$("#btn_2").css("background","url(/img/home/btn_2.gif) no-repeat top center");

		$(".h_radio").slideUp("slow");
		$(".a_radio").slideUp("slow");
		$("#btn_3").css("background","url(/img/home/btn_3.gif) no-repeat top center");

		$(".h_event").slideUp("slow");
		$(".a_event").slideUp("slow");
		$("#btn_4").css("background","url(/img/home/btn_4.gif) no-repeat top center");

		$(".h_private").slideDown("slow");
		$(".a_private").slideDown("slow");
		$("#btn_5").css("background","url(/img/home/btn_5.gif) no-repeat bottom center");

	}

}

//********************************
// page top
//********************************
function slowdownScroll() {

	var sctop;

	if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
		sctop = document.body.parentNode.scrollTop;
	}else if(window.pageYOffset){
		sctop = window.pageYOffset;
	} else {
		sctop = document.body.scrollTop;
	}

	if(sctop){
		var  scup = Math.ceil(sctop*0.5);
		scrollBy(0,-scup);
		if (sctop-scup) setTimeout("slowdownScroll()",15);
	}
}


//********************************
// お問い合わせフォーム入力チェック
//********************************
function jf_ChkContact(){

	if( document.frm.subject.value=="" ){ alert("件名が選択されていません"); document.frm.subject.focus(); return; }
	if( document.frm.naiyou.value=="" ){ alert("お問い合わせ内容が入力されていません"); document.frm.naiyou.focus(); return; }
	if( document.frm.name.value=="" ){ alert("お名前が入力されていません"); document.frm.name.focus(); return; }
	if( document.frm.mail.value=="" ){ alert("メールアドレスが入力されていません"); document.frm.mail.focus(); return; }
	if( !document.frm.mail.value.match(/^[0-9a-zA-Z\-\_\.\+]+@[0-9a-zA-Z\-\_\.\+]+$/) ){ alert("\""+document.frm.mail.value+"\"は適切なメールアドレスではありません"); document.frm.mail.focus(); return; }

	document.frm.exec_flg.value = "check";
	document.frm.submit();

}

//********************************
// お問い合わせフォーム リセット
//********************************
function jf_ResetContact(){

	document.frm.exec_flg.value = "reset";
	document.frm.submit();

}

//********************************
// お問い合わせメール送信
//********************************
function jf_SubmitContact(){

	if(!confirm("お問い合わせを送信してもよろしいですか？")) return;
	document.frm.exec_flg.value = "submit";
	document.frm.submit();

}

//********************************
// ラジオタグ
//********************************
function f_ClickRadio(){

	if( document.frm.images.value=="" ){
		document.frm.images.value = "<script type='text/javascript'>var swf = new jp.catalase.SwfTagWriter('http://hbkr.jp/flash/madame/madame_player.swf', 'madapla', 305, 115);swf.addFlashVars('fname', 'http://ラジオファイルのURL');swf.addFlashVars('user', 'madamepla');swf.writeHTML();</script>";
	}

}

//********************************
// めっせーじひょうじ
//********************************
function jf_DispMsg(pUser){

	$(".logpi_msg").fadeOut("fast");
	$("#"+pUser+"_msg").fadeIn("slow");

	$("#"+pUser+"_msg").fadeIn("slow",function(){
		setTimeout(function(){
			$("#"+pUser+"_msg").fadeOut("slow");
		},8000);
	});

}
