

	



		
				
		
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			            
			
			
			
			
			            			
			
			
			
			
				
			
		
		
		
		
			
						
		
	


	


















	





	
	
	











var any_selected = false;
var goo_selected = false;

loadFunc[loadFunc.length] = "self.focus()";

function setFormGoes(gem,id)
{
	any_selected = true;
	goo_selected = gem;
	// reflect state in form buttons
	if (document.proDep['GOinsert']) {
		document.proDep['GOinsert'].disabled = 1-any_selected;
		
		document.proDep['GOaddFromList'].disabled = 1-goo_selected;
		
	} else {
		carId = id;
	}
}

function selectSinglet( formElem, gem)
{
	// doesn't work in Firefox
	formElem.checked = true;
	setFormGoes(gem);
}

function clearForm()
{
	selected = false;
	document.proDep.reset();
	any_selected = false;
	goo_selected = false;
	var radio_count = document.getElementsByTagName('input');
	var count = 0;
	for (var x = 0; x < radio_count.length; x++) {
		if (radio_count[x].name == "id") count++;
	}
	if (count == 1) selectSinglet(document.proDep['id'],true);
}