 function get_select_text(selectObject){
  // returns the text of a select object
  return selectObject.options[selectObject.selectedIndex].text;
 }

 function get_select_value(selectObject){
  // returns the value of a select object
  return selectObject.options[selectObject.selectedIndex].value;
 }

 old_parent_id = 0; // global the id of the last control that was made visible..

 function change_sub_cat(this_form){
  // changes the sub-cat visibility style to match the selected main cat..
  if(old_parent_id > 0) { // hide previously show list..
    eval("document."+this_form+".sub_cat_type_"+old_parent_id+".className='hide'");
    eval("document."+this_form+".sub_cat_type_"+old_parent_id+".selectedIndex=0");
  }
  parent_id = get_select_value(eval("document."+this_form+".main_cat_type"));
  old_parent_id = parent_id; // remember this in the global so we can turn it off if we turn another one one..
  if(parent_id > 0){
   if(eval("document."+this_form+".sub_cat_type_"+parent_id+".length") > 1) { // if more than one option the display it..
    eval("document."+this_form+".sub_cat_type_"+parent_id+".className='"+this_form+"_select'");
   }
  }
 }

