//$("#questionformCopy").html($("#questionform").html());

function questionBlock(){
	$("#questionArea").css({display:"block"});
	$("#csQestionResult").html("");
	$("#csQ").text("");
	$.blockUI({
		message: $("#questionform"),
		fadeIn: 500,
		fadeOut: 500,
		css:{
			top:  ($(window).height() - 600) / 2 + 'px',
			left: ($(window).width() - 800) / 2 + 'px',
			width: '800px',
			height: '600px',
			cursor: 'default'
		}
	});
}

function doSendMassageCS(){
	$.ajax({
		type: "post"
		,url: "/apl/ajax/csqa"
		,data: $("form#qform").serialize()
		,dataType: "json"
		,cache : false
		,success:function(json){
			try{
				if(json=="OK"){
					$("#questionArea").css({display:"none"});
					$("#csQestionResult").html("<br /><br /><br /><p style='text-align:left;font-size:130%;margin:20px;padding:10px;border:1px solid #dfdfdf;'>ご質問ありがとうございます。<br /><br />このご質問に対する回答は、この募集ローンに関するQ&Aに公開されます。<br /><br />しばらくお待ちください。</p><br /><br /><br /><br />");
				}else{
					$("#csQestionResult").html("<p style='color:#ff0000;font-size:130%;'>入力内容に誤りがあります。(400文字以内でご入力してください。)</p>");
				}
			}catch(e){
				$("#questionArea").css({display:"none"});
				$("#csQestionResult").html("<p style='color:#ff0000;font-size:130%;margin:20px;padding:10px;border:1px solid #dfdfdf;'>システムでエラーが発生いたしました。<br />管理者までお問合せください。</p>");
			}

		}

		,error:function(){
			$("#questionArea").css({display:"none"});
			$("#csQestionResult").html("<p style='color:#ff0000;font-size:130%;margin:20px;padding:10px;border:1px solid #dfdfdf;'>ただいま、システムが大変混み合っております。<br />しばらくたってから再度ご利用ください。<p/>");

		}
 	});
}
var targetBlockCs=1;
function setDisplay(id){

	$("#tablist"+targetBlockCs).css({display:"none"});
	$("#cs_001 .csContents ul#csTab li#exList"+targetBlockCs +" a").removeClass("targetList");
	$("#cs_001 .csContents ul#csTab li#exList"+id +" a").addClass("targetList");
	switch(id){
		case 2:
			$("#tablist2").css({display:"block"});
			targetBlockCs=2;
		break;
		case 3:
			$("#tablist3").css({display:"block"});
			targetBlockCs=3;
			break;
		default:
			$("#tablist1").css({display:"block"});
			targetBlockCs=1;
			break;
	}

}
