/*
 @ link页面的js文件
*/
function submitValue(){
	var subValue = '';
	$(".radioquestion").each(function(){
		if($(this).attr('checked')){
			subValue += $(this).val()+"_";	
		}						  
	})
	
	$(".checkquestion").each(function(){
		if($(this).attr('checked')){
			subValue += $(this).val()+"_";		
		}						  
	})
	
	
	$('.selectquestion').each(function(){
		if($(this).val()){
			subValue += $(this).val()+"_";
		}							  
	})
	
	if(subValue == '') {
		alert('Please select results');
		return;
	}
	$.post('index.php', 
		  {
			act: 'question',
			idstr: subValue
		  }, 
			function(data) {
				if(data != 'error'){
					$('#survey').hide();
					$('#resultcontent').html(data);
					$('#resultdiv').show();
				}else{
					alert(data);
				}
			}
	);	
}

function showresults(content) {
	if(content == 'result') {
		$('#survey').hide();
		$('#resultdiv').show();
	}
	if(content == 1){
		$(".radioquestion").each(function(){
			$(this).removeAttr('checked');
		})
	
		$(".checkquestion").each(function(){
			$(this).removeAttr('checked');
		})
	
	
		$('.selectquestion').each(function(){
			$(this).removeAttr('selected');
		})
		$('#survey').show();
		$('#resultdiv').hide();
	}
	
}


