function aln_directory_directory(config) {

  this.config = config;
  this.selects = new Array(); // tracks what values are available for processing results

  // creates the container for the search controls
  this.field = function() {
    container = document.createElement('DIV');
    container.setAttribute('class', 'aln_directory_cbx_container');
    this.content = container;
    this.get_checkboxes();
    return this.content;
  }

  // my code
  // creates checkboxes for display
  this.get_checkboxes = function () {
    /*
    vocab = this.config.settings.vocabulary;
    keys = new Array('', '');    
    for (var n in vocab) {
      keys[n] = n;
    }
    keys.reverse();
    for (var n in vocab) {
      thisnum = parseFloat(n)-1; 
      op = keys[thisnum];
      
      tid = this.config.settings.vocabulary[op].tid;
      vid = this.config.settings.vocabulary[op].vid;
      name = this.config.settings.vocabulary[op].name;
      this.add_cbx(tid, vid, name);
    }
    */
    this.add_cbx(1, 1, 'development');
    this.add_cbx(3, 1, 'transportation');
    this.add_cbx(4, 1, 'health');
    this.add_cbx(2, 1, 'environment');
  }

  // creates individual checkbox
  this.add_cbx = function(tid, vid, name) {
    
    // creating container and label
    // these can be hidden using css
    var cbx_container = document.createElement('DIV');
    //var cbx_label = document.createElement('LABEL');
    //var cbx_label_text = document.createTextNode(name);
    
    // creating checkbox
    var cbx = document.createElement('INPUT');
    cbx.field = this;
    cbx.selects = this.selects; // tells the checkbox where the selects is
    cbx.parent = parent;
    cbx.type = 'CHECKBOX';
    cbx.style.display = 'none';
    cbx.checked = false;
    cbx_container.setAttribute('class', 'aln_directory_cbx_box');
    cbx.setAttribute('class', 'aln_directory_cbx');
    
    // going to create a unique id for each element
    // based on the term, vocab, and name
    unique_id = name.replace(/ /,"_") + '_' + tid + '_' + vid;
    unique_id = unique_id.toLowerCase();
    cbx.setAttribute('id', unique_id);
    cbx.setAttribute('tid', tid);
    // register the checkbox, give it a default value of 1 for checked
    // this.selects[tid] = 1;
    this.selects[tid] = 0;
    
    // create button for checkbox - this is going to need to be specific
    // to the aln search, with values hard coded based on the 
    // unique id for the search
    var cbx_btn = document.createElement('IMG');
    // gonna hard code images based on the source here...
    // src = directory_base_path + directory_theme_path + 'images/aln_us_h_on.jpg';
    // src_on = directory_base_path + directory_theme_path + 'images/aln_us_h_on_o.jpg';

    // heh, can probably use the first letter of the name to get these
    // these are for H
    if(unique_id.substring(0,1) == 'h'){
      //src = directory_base_url + directory_theme_path + '/images/ButtonHealthOFF.gif';
      //src_on = directory_base_url + directory_theme_path + '/images/ButtonHealthON.gif';
      //src_off = directory_base_url + directory_theme_path + '/images/ButtonHealthOFF.gif';
      src = directory_base_url + directory_theme_path + '/images/aln_us_h_on.jpg';
      src_off = directory_base_url + directory_theme_path + '/images/aln_us_h_on.jpg';
      src_on = directory_base_url + directory_theme_path + '/images/aln_us_h_on_o.jpg';
    } else if(unique_id.substring(0,1) == 'd'){
      //src = directory_base_url + directory_theme_path + '/images/ButtonDevelopmentOFF.gif';
      //src_on = directory_base_url + directory_theme_path + '/images/ButtonDevelopmentON.gif';
      //src_off = directory_base_url + directory_theme_path + '/images/ButtonDevelopmentOFF.gif';
      src = directory_base_url + directory_theme_path + '/images/aln_us_d_on.jpg';
      src_off = directory_base_url + directory_theme_path + '/images/aln_us_d_on.jpg';
      src_on = directory_base_url + directory_theme_path + '/images/aln_us_d_on_o.jpg';
    } else if(unique_id.substring(0,1) == 't'){
      //src = directory_base_url + directory_theme_path + '/images/ButtonTransportationOFF.gif';
      //src_on = directory_base_url + directory_theme_path + '/images/ButtonTransportationON.gif';
      //src_off = directory_base_url + directory_theme_path + '/images/ButtonTransportationOFF.gif';
      src = directory_base_url + directory_theme_path + '/images/aln_us_t_on.jpg';
      src_off = directory_base_url + directory_theme_path + '/images/aln_us_t_on.jpg';
      src_on = directory_base_url + directory_theme_path + '/images/aln_us_t_on_o.jpg';
    } else if(unique_id.substring(0,1) == 'e'){
      //src = directory_base_url + directory_theme_path + '/images/ButtonEnvironmentOFF.gif';
      //src_on = directory_base_url + directory_theme_path + '/images/ButtonEnvironmentON.gif';
      //src_off = directory_base_url + directory_theme_path + '/images/ButtonEnvironmentOFF.gif';
      src = directory_base_url + directory_theme_path + '/images/aln_us_e_on.jpg';
      src_off = directory_base_url + directory_theme_path + '/images/aln_us_e_on.jpg';
      src_on = directory_base_url + directory_theme_path + '/images/aln_us_e_on_o.jpg';
    }
        
    cbx_btn.setAttribute('src', src);
    cbx_btn.setAttribute('src_off', src);
    cbx_btn.setAttribute('src_on', src_on);
    cbx_btn.setAttribute('trigger', unique_id);
    cbx_btn.setAttribute('align', 'left');

    // now define methods for checkbox
    cbx.onclick = function(){
      // test check state, change monitor value
      // by default, nothing is checked
      // checking a box restricts the search to that tag only
      // safari does NOT appear to check a box on an onclick event
			if (navigator.userAgent.indexOf("Safari") > 0){
	      if(this.checked){
	      	this.checked = false;
	      } else {
	      	this.checked = true;
	      }
			}
			// inspect checkbox, set selected value accordingly      
      if(this.checked){
      	if(this.tid){
          this.selects[this.tid] = 1; // safari, IE - does not work in IE
      	} else {
          this.selects[this.attributes.tid.value] = 1; // firefox
      	}
      } else {
      	if(this.tid){
          this.selects[this.tid] = 0; // safari, IE - does not work in IE
      	} else {
          this.selects[this.attributes.tid.value] = 0; // firefox
      	}
      }
			// tells whether or not the setup worked      
/*			if(this.tid){
	      alert('The value for item ' + this.tid + ' is ' + this.selects[this.tid] + ' - ' + this.checked);
			} else {
	      alert('The value for item ' + this.attributes.tid.value + ' is ' + this.selects[this.attributes.tid.value]);
			}
*/          
      // get list of selected values based on the items which are currently checked
      items = '';
      // alert(typeof this.selects);
      for (var item in this.selects){ // now IE likes this, adding the var made the difference
      	// alert('checking items: item ' + item + ' = ' + this.selects[item]);
        if(this.selects[item] == 1){ 
          items = items + item + ',';
        }
      }
      // remove trailing comma
      if(items.lastIndexOf(',')){
        items = items.substring(0, items.lastIndexOf(","));
      }
      // if there are no boxes checked, put in a negative value
      if(items.length == 0){
        items = -1;
      }
      // send fields to drupal for results
      // alert(items);
      this.field.set(items);
    }
    
    // clicking on this image fires the press event for the checkbox
    // associated with the image which will (presumably) force the 
    // form to load new results
    cbx_btn.onclick = function (){
      // alert(this.attributes.src_on.value);
      // = this.attributes.src_on.value;
      // alert($(this.attributes.trigger.value).checked);
      // alert(this.attributes.trigger.value.substring(0,1));
      // list all the attributes and their value
      
      // find the trigger
      if(this.trigger){ // get the trigger itself
        trigger = $(this.trigger); // safari, possibly IE
      } else if(this.attributes.trigger.value) {
        trigger = $(this.attributes.trigger.value); // firefox
      }
      // alert('trigger: ' + trigger);
      // alert('checked: ' + trigger.checked);
      
      // swap the image based on whether or not the trigger is checked
      if(trigger.checked){
      	if(this.src_off){
          this.src = this.src_off; // safari, possibly IE
      	} else if (this.attributes.src_off.value) {
          this.src = this.attributes.src_off.value; // firefox
      	}
      } else {
      	if(this.src_on){
        	this.src = this.src_on; // safari
      	} else if (this.attributes.src_on.value) {
        	this.src = this.attributes.src_on.value; // firefox
      	}
      }
      trigger.click(); // launch the trigger code
      return;
    }
    
    
    //cbx_label.appendChild(cbx_label_text);
    cbx_container.appendChild(cbx);
    
    //alert(document.getElementById(unique_id));
    
    
    //cbx_container.appendChild(cbx_label);
    cbx_container.appendChild(cbx_btn);
    this.content.appendChild(cbx_container);
    return cbx;
  }
  
  // sends values to drupal for inclusion in query
  this.update = function(config) {
    return;
    this.config = config;
    var values = [];
    for (var n in this.selects) {
      values[n] = this.selects[n].options[this.selects[n].selectedIndex].value;
    }
    this.selects[0].remove();
    this.get_checkboxes();
    for (var n in values) {
      if (this.selects[n]) this.selects[n].select(values[n]);
    }
  }

  // fires when values change
  this.set = function(items) {
    this.tid = items;
    directory_update();
  }

  // sets values when sending to drupal
  this.value = function() {
    if (this.tid) return {'tid': this.tid};
  }

}
