// ###########################
// created by: Ben Weeks
// Created Date: 3rd November 2005
// Company: webtechy.co.uk
//
// Modified By:
// Modified Date:
// Modified Comment:
//
// Version: 1.00
// ###########################

function AlterCommitteeSelect() {
	var bFound;
	var sString = "";
	var sCommitteeID = "CommitteeSelectSpan";
	aAllowedCommittees = new Array();
	aAllowedCommittees[0] = "All";

	aAllowedCommittees[1] = "Cabinet";
	aAllowedCommittees[2] = "Corporate Management Committee";
	aAllowedCommittees[3] = "Communtity Well-Being &amp; Rural Issues Committee";
	aAllowedCommittees[4] = "Economy &amp; Service Partnerships Committee";
	aAllowedCommittees[5] = "Environment &amp; Housing Committee";
	aAllowedCommittees[6] = "Development Control Committee";
	aAllowedCommittees[7] = "Licensing and Health Committee";
	aAllowedCommittees[8] = "Rights of Way Committee";
	aAllowedCommittees[9] = "Standards Committee";
	aAllowedCommittees[10] = "Appeals Committee";
	aAllowedCommittees[11] = "North Area Development Control Sub-Committee";
	aAllowedCommittees[12] = "South Area Development Control Sub-Committee";
	aAllowedCommittees[13] = "Customer Services Task Group";
	aAllowedCommittees[14] = "Local Development Framework Task Group";
	aAllowedCommittees[15] = "Grants Task Group";
	aAllowedCommittees[16] = "Felixstowe South Seafront Land Member Task Group";
	aAllowedCommittees[17] = "IT and E-Government Task Group";
	aAllowedCommittees[18] = "Finance &amp; Planning Task Group";
	aAllowedCommittees[19] = "Car Park Task Group";

	try {
		oCommitteeSelect = document.getElementById(sCommitteeID).firstChild;

		if (oCommitteeSelect) {
			aOptionsToRemove = new Array();
			var iNumberOfOptions = oCommitteeSelect.children.length;
	
			// Search through the options	
			for (var i = 0; i <= iNumberOfOptions - 1; i++) {
				bFound = false;
				for (var j = 0; j <= aAllowedCommittees.length - 1; j++) {
					if (oCommitteeSelect.children[i]) { // Just to be on the safe side, should work without this really.
						if (oCommitteeSelect.children[i].innerText == aAllowedCommittees[j]) {
							// OK, we've found one of the Committees that 
							// we want, so set it to found.  could at
							// this point jump out of the for loop 
							// really to speed things up.
							bFound = true;
						}
					}
				}
				if (bFound != true) {
					oCommitteeSelect.children[i].removeNode();
					i--; // We have to go back one because we have just removed one!
					iNumberOfOptions--; // We also have to reduce the total number by one!
				}
			}
			// alert(sString);
		}
		else {
			//alert("Committee select list with the ID " + sCommitteeID + " not found on this page.");
		}
	}
	catch(er) {
		// We'll just have to leave the list as it is.
		//alert("Problem");
	}
}

//AlterCommitteeSelect();
