function surveyResult(qid) {
	var idStr = '';
	$('.surveyclass').each(function(){
		if($(this).attr('checked')) {
			idStr +=$(this).val()+"|";
		}
	})
	$('select').each(function(){
		if($(this).val() != '' && $(this).val() != 0 && $(this).val() != 'All') {
			idStr +=$(this).val()+"|";
		}
	})
	//alert($( "select[.surveyclass] option[@selected]" ).val());  
	//如果没有选择结果则不提交数据
	if(idStr == '') {
		alert('Please select results');
		return false;
	}

	$.post('index.php', 
		  {
			act: 'result',
			idstr: idStr,
			ajax_qid:qid
		  }, 
			function(data) {
				if(data != 'error'){
					$('#question_'+qid).html(data);
				}else{
					alert(data);
				}
			}
	);	
}

function surveyQuestion(qid) {
	$.post('index.php', 
		  {
			act: 'question',
			ajax_qid:qid
		  }, 
			function(data) {
				if(data != 'error'){
					$('#question_'+qid).html(data);
				}else{
					alert(data);
				}
			}
	);		
}

function showResult(qid) {
	$.post('index.php', 
		  {
			act: 'result',
			idstr: '',
			ajax_qid:qid
		  }, 
			function(data) {
				if(data != 'error'){
					$('#question_'+qid).html(data);
				}else{
					alert(data);
				}
			}
	);		
}

