/* ポップアップの処理 */
$(document).ready(function(){
	$(".signUpPop a").hover(function() {
		$(this).next("em").stop(true, true).animate({opacity: "show", top: "40"}, "fast");
	}, 
	function() {
		$(this).next("em").animate({opacity: "hide", top: "35"}, "fast");
	});

	$(".mailmagazinePop1 span").mouseover(function() {
		tarTop = $(document).scrollTop();
		pos = $(this).position();
		$(this).next("em").css( { "top" : tarTop + 39, "left" : pos.left + 80 });
		$(this).next("em").stop(true, true).animate({opacity: "show", top: tarTop + 40}, "fast");
	}).mouseout(function(){
		$(this).next("em").animate({opacity: "hide", top: tarTop + 39}, "fast");
	});
	
	$(".mailmagazinePop2 span").mouseover(function() {
		tarTop = $(document).scrollTop();
		pos = $(this).position().left - $(this).next("em").width() - 30;
		$(this).next("em").css( { "top" : tarTop + 39, "left" : pos });
		$(this).next("em").stop(true, true).animate({opacity: "show", top: tarTop + 40}, "fast");
	}).mouseout(function(){
		$(this).next("em").animate({opacity: "hide", top: tarTop + 39}, "fast");
	});
	
});




/*  画像化したチェックボックスの処理　*/
$(function(){
	$("p input.serviceCheck").parent().attr("class","unchecked");
	$("p input.serviceCheck:checked").parent().attr("class","checked");
	$(".checked, .unchecked").click(function(){
		$(this).toggleClass("unchecked").toggleClass("checked")
		if($(this).attr("class")=="unchecked"){
			$(this).children("input").attr("checked","");
		}else{
			$(this).children("input").attr("checked","checked");
		}
	});
});

/* 「もっと詳細を見る」 */

$(function(){
	$(".switch").click(function(){
		tarParent = $(this).parent();
		tarTable = tarParent.next(".append").children("table");
		if(tarTable.css("display") == "none"){
			$(this).html("<img src='../img_cmn/closeDetailBtn.gif'/>")
			tarTable.show("200");
		}else{
			$(this).html("<img src='../img_cmn/openDetailBtn.gif'/>")
			tarTable.hide("200r");
		}
	});
});

/* 前付き、後付き、無しのラジオボタンによって、セレクトボックスの位置移動 */
$(function(){
	$("#backPrefix").click(function(){
		var tarObj = $("#companyPrefixSelect");
		tarObj.insertAfter("#companyTextArea").show();
	});
	$("#frontPrefix").click(function(){
		var tarObj = $("#companyPrefixSelect");
		tarObj.insertBefore("#companyTextArea").show();
	});
	$("#noPrefix").click(function(){
		var tarObj = $("#companyPrefixSelect");
		tarObj.hide();
	});
});

$(function(){
	$("#otherBusinessTypeRadio").click(function(){
		$("#otherBusinessTypeSelect").show();
	})
	$(".businessUl li input[id!=otherBusinessTypeRadio]").click(function(){
		$("#otherBusinessTypeSelect").hide();
	})
})

