// members
function agencySort(id) {
	resetList();
	btn = id + '_Btn';
	list = 'agency' + id;
	document.getElementById(btn).style.backgroundPosition = 'bottom';
	document.getElementById(list).style.display = 'block';
}

function resetList() {
	var listArray = ['AE','FJ','KO','PT','UZ'];
	for (i=0;i<listArray.length;i++) {
		btn = listArray[i] + '_Btn';
		list = 'agency' + listArray[i];
		document.getElementById(btn).style.backgroundPosition = 'top';
		document.getElementById(list).style.display = 'none';
	}
}


//associates
var catArray = ['eventServices','hispanicAgencies','internet','magazines','mediaPlanning','multiculturalAgencies','mysteryShopping','newspapers','outdoor','production','repFirms','research','radioNetworks','satelliteCable','talent','tvNetworks','tvStations','other'];

function getCategory() {
	var form = document.getElementById("associateMemForm");
	var selected_index = form.elements["catList"].selectedIndex;

	if(selected_index > 0) {
		var option_value = form.elements["catList"].options[selected_index].value;
		if (option_value == 'all') {
			allCat();
		} else {
			clearCat();
			document.getElementById(option_value).style.display = "block";
		}
	}
}

function clearCat() {
	for (i=0;i<catArray.length;i++) {
		cat = catArray[i];
		document.getElementById(cat).style.display = 'none';
	}
}

function allCat() {
	for (i=0;i<catArray.length;i++) {
		cat = catArray[i];
		document.getElementById(cat).style.display = 'block';
	}
}
