function post_answer(question_id){
//	alert ("question_id=" + question_id + "&answer=" + $("#ans_text_" + question_id).val() + "&v=" + Math.random());	
	var post_to_twitter = "no";
	if($("input[name='post_to_twitter_" + question_id + "']:checked").val() == 'on'){
		post_to_twitter = "yes"
	}
//	alert ("post_answer.php?question_id=" + question_id + "&post_to_twitter=" + post_to_twitter + "&answer=" + $("#ans_text_" + question_id).val() + "&v=" + Math.random());

	$.ajax({
		type: "POST",
		url: "post_answer.php",
		data: "question_id=" + question_id + "&post_to_twitter=" + post_to_twitter + "&answer=" + $("#ans_text_" + question_id).val() + "&v=" + Math.random(),
		success: function(data){
//			hideDiv('ans_' + question_id);
			document.frmInbox.submit();
//			$.modal.close();
		},
		error: function(){
//			$.modal.close();
		}
	});
}

function delete_question(question_id){
	$.ajax({
		type: "POST",
		url: "delete_question.php",
		data: "question_id=" + question_id  + "&v=" + Math.random(),
		success: function(data){
			document.frmInbox.submit();
//			$.modal.close();
		},
		error: function(){
//			$.modal.close();
		}
	});
}

function select_all(){
	$("input[@name='chk_question'][type='checkbox']").attr('checked', true);
}

function delete_question_all(){
	var checked = $('.remem-ch:checked');
	if(checked.length != 0){
		var qStr = "";
		for (i=0;i<checked.length;i++)
		{    
			qStr = qStr + jQuery.trim(checked[i].id.substring(6)) + ",";
		}
		$.ajax({
			type: "POST",
			url: "delete_question.php",
			data: "delete_group=yes&question_id=" + qStr  + "&v=" + Math.random(),
			success: function(data){
				document.frmInbox.submit();
			},
			error: function(){
			}
		});
	}
}

