﻿var checkItems;
var selectedItems;
var index;

function SetRadionButton(btn)
{
	//check radio
	document.getElementById('btnSurvey').disabled = '';

	//init survey
	if(index == null)
	{
		//init survey
		index = 0;
		checkItems = new Array();
		selectedItems = new Array();
	}
	
	//uncheck other radios
	for (k in checkItems)
		document.getElementById(checkItems[k]).checked = false;
	
	//check current button
	btn.checked = true;
	
	//find 
	for (k in checkItems)
	{	
		if(checkItems[k] == btn.id)
		{
			//check input found
			selectedItems[0] = btn.value;
			return;
		}
	}
	
	//btn not found
	checkItems[index] = btn.id;
	selectedItems[0] = btn.value;
	index++;
}
function SetSurvey()
{
	
	var ids = '';
	var spacer = '';
	for (k in selectedItems)
	{
		ids = ids + spacer + selectedItems[k];
		spacer = '|';
	}
	
	window.location = 'SurveyApplay.aspx?id=' + ids;
	return false;
}
