function ValidateForm(theform) {
	var count = theform.elements.length;

	for (i=0; i<count; i++) {
		var element = theform.elements[i];
		if (element.type == "select-one") {
			optionText = element.options[1].text
			if (optionText.search && (optionText.search(new RegExp("^[0-9]*$","g"))>=0) && (element.selectedIndex==0)) {
				element.options[1].selected = true
			}
		}
	}

	for (i=0; i<count; i++) {
		var element = theform.elements[i];
		if (element.type == "select-one") {
			optionText = element.options[1].text
			if (!checkSelect(element)) {
				alert('Please make your choices from the available options')
				element.focus()
				return false
			}
		}
	}

	for (i=0,total=0,numberOptionFound=false; i<count; i++) {
		var element = theform.elements[i];
		if (element.type == "select-one") {
			optionText = element.options[element.selectedIndex].text
			if ( optionText.search && (optionText.search(new RegExp("^[0-9]*$","g"))>=0) ) {
				numberOptionFound=true
				total += parseInt(optionText)
			}
		}
	}

	if (numberOptionFound && (total != 6)) {
		alert('Total quantity must be equal to 6')
		theform.elements[0].focus()
		return false
	}

	return true
}

function checkSelect(theSelect)
{
	if (theSelect.options[0].selected == true) {
		return false;
	}
	return true;
}

