//---------- 画像の拡大
function pict_large(url, pict_width, pict_height){
  x_loc = 100;
  y_loc = 100;
  window.open(url, "image", "width=" + (parseInt(pict_width) + 40) + ",height=" + (parseInt(pict_height) + 40) + ",scrollbars=yes,resizable=yes,left=" + x_loc + ",top=" + y_loc);
}

//---------- 回答投稿ウィンドウ
function answer_window(question_id){
  window.open("./answer_add.php?q_id=" + question_id, "answer", "width=600,height=600,status=no,resizable=yes,scrollbars=yes");
}

//---------- お礼投稿ウィンドウ
function thanks_window(answer_id){
  window.open("./thanks_add.php?a_id=" + answer_id, "thanks", "width=500,height=300,status=no,resizable=yes,scrollbars=yes");
}

//---------- ステータスを終了に変更
function status_finish(){
	res = confirm("この質問への回答を締切ってもよろしいですか？");
	if(res){
		location.href = "ask_detail.php?finish_flag=1&q_id=" + q_id;
	}
}

//---------- ポイントを付与
function grant_point(answer_id, user_name, pt){

	if(pt == 1){
		point = 20;
	}
	else if(pt == 2){
		point = 10;
	}

	res = confirm(user_name + "さんに良回答" + point + "ptを付与します。");
	
	if(res){
		location.href = "ask_detail.php?add_point=1&q_id=" + q_id + "&a_id=" + answer_id + "&pt=" + pt;
	}
}
