function popbrands(mactypeindex)
{
	var arind;
	var boxind = 0;
	var thebox = document.getElementById("cb_manu") ;
	var oldsize = thebox.length ;
	
	thebox.options[boxind] = new Option() ;
	thebox.options[boxind].text = "Manufacturer..." ;
	boxind++
	
	if ((mactypeindex != null) && (mactypeindex > 0))
	{	
			
		for (arind = 1; arind <= section_tree_names[mactypeindex].pChild.length; arind++)
		{	
			thebox.options[boxind] = new Option() ;		
			thebox.options[boxind].text = section_tree_names[mactypeindex].pChild[arind].sName ;
			thebox.options[boxind].value = arind;
			boxind++;
		}
	}
	
	var newind;
		
	for (newind = boxind ; newind < oldsize; newind++)
	{
		thebox.options[boxind] = null;
	}
	
	popmachines(0)	
}

function popmachines(brandindex)
{
	var arind;
	var boxind = 0;
	var thebox = document.getElementById("cb_printers") ;
	var oldsize = thebox.length ;
		
	thebox.options[boxind] = new Option() ;
	thebox.options[boxind].text = "Model..." ;
	boxind++ ;

	if ((brandindex != null) && (brandindex > 0))
	{	
		var mactypeindex = document.getElementById("cb_mactype").value
		
		if ((mactypeindex != null) && (mactypeindex > 0))
		{
			for (arind = 1; arind <= section_tree_names[mactypeindex].pChild[brandindex].pChild.length; arind++)
			{	
				
				var str = new String(section_tree_names[mactypeindex].pChild[brandindex].pChild[arind].sName);
				str = str.replace("&#45;","-");
				str = str.replace("&#58;",":");
				
				if (str.indexOf(":") == -1)
				{
					thebox.options[boxind] = new Option() ;
					thebox.options[boxind].value = section_tree_URLs[mactypeindex].pChild[brandindex].pChild[arind].sURL.replace("&amp;","&");

					thebox.options[boxind].text = str
				
					boxind++;
				}
			}
			
			var newind;
			

		}
	}
	
	for (newind = boxind ; newind < oldsize; newind++)
	{
			thebox.options[boxind] = null;
	}
}

function setupboxes()
{
	popbrands(document.getElementById("cb_mactype").value) ;
	popmachines(document.getElementById("cb_manu").value) ;
}
