Need some urgent JS help

Ok I have I am by far no JS guru, but I am trying. Well I have a form that has like 20 or so check boxes, and when that form submits (back to itself) it returns answers based on the questions that have the box checked. I have got that to work but I cant get the answers to keep the same order as the questions they seem to randomly do what they want :(…Here is the JS I am using.

this is in one .js file. (each “var” represents the name of the checkbox and is in the same order that they appear on the form. Each initial value is set to “on”)

Please help… I basically just need the results to be in the same order as the form/array.

function Solution () {

this.slist = new Array();

this.payroll1 = "<strong>Question 1 will go here?</strong><p>Answer goes here</p>";

this.payroll2 = "<strong>Question 2 will go here?</strong><p>Answer goes here</p>";

this.payroll3 = "<strong>Question 3 will go here?</strong><p>Answer goes here</p>";

this.policy1 = "<strong>Question 4 will go here?</strong><p>Answer goes here</p>";

this.policy2 = "<strong>Question 5 will go here?</strong><p>Answer goes here</p>";

this.policy3 = "<strong>Question 6 will go here?</strong><p>Answer goes here</p>";

this.benefits1 = "<strong>Question 7 will go here?</strong><p>Answer goes here</p>";

this.benefits2 = "<strong>Question 8 will go here?</strong><p>Answer goes here</p>";

this.benefits3 = "<strong>Question 9 will go here?</strong><p>Answer goes here</p>";

this.benefits4 = "<strong>Question 10 will go here?</strong><p>Answer goes here</p>";

this.benefits5 = "<strong>Question 11 will go here?</strong><p>Answer goes here</p>";

this.benefits6 = "<strong>Question 12 will go here?</strong><p>Answer goes here</p>";

this.benefits7 = "<strong>Question 13 will go here?</strong><p>Answer goes here</p>";

this.benefits8 = "<strong>Question 14 will go here?</strong><p>Answer goes here</p>";

this.benefits9 = "<strong>Question 15 will go here?</strong><p>Answer goes here</p>";

this.benefits10 = "<strong>Question 16 will go here?</strong><p>Answer goes here</p>";

this.benefits11 = "<strong>Question 17 will go here?</strong><p>Answer goes here</p>";

this.benefits12 = "<strong>Question 18 will go here?</strong><p>Answer goes here</p>";

this.benefits13 = "<strong>Question 19 will go here?</strong><p>Answer goes here</p>";

this.benefits14 = "<strong>Question 20 will go here?</strong><p>Answer goes here</p>";

this.benefits15 = "<strong>Question 21 will go here?</strong><p>Answer goes here</p>";

this.benefits16 = "<strong>Question 22 will go here?</strong><p>Answer goes here</p>";

this.medical1 = "<strong>Question 23 will go here?</strong><p>Answer goes here</p>";

this.medical2 = "<strong>Question 24 will go here?</strong><p>Answer goes here</p>";

this.medical3 = "<strong>Question 25 will go here?</strong><p>Answer goes here</p>";

this.medical4 = "<strong>Question 26 will go here?</strong><p>Answer goes here</p>";

this.medical5 = "<strong>Question 27 will go here?</strong><p>Answer goes here</p>";

}

Solution.prototype.getParams = function () {
	var args = new Object();
	var query = location.search.substring(1);
	if (query == "") {
		return false;
	}
	var pairs = query.split("&");
	for (var i = 0; i < pairs.length; i++) {
		var pos = pairs*.indexOf("=");
		if (pos == -1) {
			continue;
		}
		var argname = pairs*.substring(0, pos);
		var value = pairs*.substring(pos + 1);
		args[argname] = unescape(value);
	}
	return args;
}

Solution.prototype.item_sort_function = function (a, b) {
	var a_start = a.indexOf(">");
	var a_end = a.indexOf("<", a_start);
	var a_comparison_string = a.slice(a_start + 1, a_end);
	
	var b_start = b.indexOf(">");
	var b_end = b.indexOf("<", b_start);
	var b_comparison_string = b.slice(b_start + 1, b_end);

	if (a_comparison_string == b_comparison_string) return 0;
	if (a_comparison_string > b_comparison_string) return 1;
	if (a_comparison_string < b_comparison_string) return -1;	
}

Solution.prototype.addItem = function (item) {
	// we have a new item to add
	// so we loop through the current list
	for (var i = 0; i < this.slist.length; i++) {
		// if we find that item already then
		if (item == this.slist*) {
			// we return so as to not 
			// include the duplicate
			return;
		}
	}
	// if we are here, then no 
	// match was found for item
	// so we can safely add it to the end
	this.slist[this.slist.length] = item;
}

Solution.prototype.main = function () {
	
	var params = this.getParams();
	
	if (params == false) {
		return "Please click 'back' and choose at least one need.";
	}
	
	var payroll1 = params['payroll1'];
	var payroll2 = params['payroll2'];
	var payroll3 = params['payroll3'];
	var policy1 = params['policy1'];
	var policy2 = params['policy2'];
	var policy3 = params['policy3'];
	var benefits1 = params['benefits1'];
	var benefits2 = params['benefits2'];
	var benefits3 = params['benefits3'];
	var benefits4 = params['benefits4'];
	var benefits5 = params['benefits5'];
	var benefits6 = params['benefits6'];	
	var benefits7 = params['benefits7'];
	var benefits8 = params['benefits8'];	
	var benefits9 = params['benefits9'];	
	var benefits10 = params['benefits10'];	
	var benefits11 = params['benefits11'];	
	var benefits12 = params['benefits12'];	
	var benefits13 = params['benefits13'];	
	var benefits14 = params['benefits14'];	
	var benefits15 = params['benefits15'];	
	var benefits16 = params['benefits16'];	
	var medical1 = params['medical1'];	
	var medical2 = params['medical2'];	
	var medical3 = params['medical3'];	
	var medical4 = params['medical4'];	
	var medical5 = params['medical5'];	
	
	if (payroll1 == "ON") {
		this.addItem(this.payroll1);
	}
	
	if (payroll2 == "ON") {
		this.addItem(this.payroll2);
	}
					
	if (payroll3 == "ON") {
		this.addItem(this.payroll3);
	}
					
	if (policy1 == "ON") {
		this.addItem(this.policy1);
	}
					
	if (policy2 == "ON") {
		this.addItem(this.policy2);
	}
	if (policy3 == "ON") {
		this.addItem(this.policy3);
	}
	
	if (benefits1 == "ON") {
		this.addItem(this.benefits1);
	}

	if (benefits2 == "ON") {
		this.addItem(this.benefits2);
	}

	if (benefits3 == "ON") {
		this.addItem(this.benefits3);
	}
	
	if (benefits4 == "ON") {
		this.addItem(this.benefits4);
	}
		if (benefits5 == "ON") {
		this.addItem(this.benefits5);
	}
	if (benefits6 == "ON") {
		this.addItem(this.benefits6);
	}
	if (benefits7 == "ON") {
		this.addItem(this.benefits7);
	}
	if (benefits8 == "ON") {
		this.addItem(this.benefits8);
	}
	if (benefits9 == "ON") {
		this.addItem(this.benefits9);
	}
		if (benefits10 == "ON") {
		this.addItem(this.benefits10);
	}
		if (benefits11 == "ON") {
		this.addItem(this.benefits11);
	}
		if (benefits12 == "ON") {
		this.addItem(this.benefits12);
	}
		if (benefits13 == "ON") {
		this.addItem(this.benefits13);
	}
			if (benefits14 == "ON") {
		this.addItem(this.benefits14);
	}
			if (benefits15 == "ON") {
		this.addItem(this.benefits15);
	}
			if (benefits16 == "ON") {
		this.addItem(this.benefits16);
	}
			if (medical1 == "ON") {
		this.addItem(this.medical1);
	}
			if (medical2 == "ON") {
		this.addItem(this.medical2);
	}
			if (medical3 == "ON") {
		this.addItem(this.medical3);
	}
			if (medical4 == "ON") {
		this.addItem(this.medical4);
	}
			if (medical5 == "ON") {
		this.addItem(this.medical5);
	}
	
	this.slist.sort(this.item_sort_function);
	return this.slist.join("");

}

this is the other

function ShowAll(form) {
var count = 0; 
  for (count=0; count < form.elements.length; count++) 
		{form.elements[count].checked = 1;}
	form.submit();}

function ValidateForm(form) {
var count = 0; 
var isgood = false;
  for (count=0; count < form.elements.length; count++) {
			if (form.elements[count].checked == true) 
				isgood=true;}
	return isgood;
	}