var showAgency = {

	setupSelects: function() { 
	 	if (!document.getElementById) 
	  		return;
		showAgency.setState();
	 	var agency_input = document.getElementById('agency'); 
	 	var publication_input = document.getElementById('publication');
		
		if(agency_input.checked){
			showAgency.setAgency();
		} else {
			showAgency.setPublication();
		}
		
		//agency_input.addEventListener('click', showAgency.setAgency, false);
		agency_input.onclick = showAgency.setAgency;
		//publication_input.addEventListener('click', showAgency.setPublication, false);
		publication_input.onclick = showAgency.setPublication;
	 	 
	},
	
	setAgency: function() {
		showAgency.setState('agency');
	},
	
	setPublication: function() {
		showAgency.setState('publication');
	},
	
	setState: function(state) {
		//alert('Defaults being set');
		if (!document.getElementById) 
	   		return;
	 	var agency_field = document.getElementById('agency_set'); 
		var publication_field = document.getElementById('publication_set');
		switch (state){
			case 'agency':
				agency_field.style.display = 'inline';
				publication_field.style.display = 'none';
			break;
			case 'publication':
				agency_field.style.display = 'none';
				publication_field.style.display = 'inline';
			break;
			default : 
				agency_field.style.display = 'inline';
				publication_field.style.display = 'none';
		}
	}
	
};

// When the page loads, set up the rollovers 
window.onload = function() {
	
	showAgency.setupSelects();

}

//window.addEventListener('load', showAgency.setupSelects, false);