// our dollar function
//is lame - changed by Sam Shull 5-27-10
(function(){
function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1)
      return element;
    elements.push(element);
  }
  return elements;
}


window.toggle = {
  show : function() {
    for ( i=0; i < arguments.length; i++ ) {
      $(arguments[i]).style.display = '';
    }
  },
  hide : function() {
    for ( i=0; i < arguments.length; i++ ) {
      $(arguments[i]).style.display = 'none';
    }
  }
};


window.open_tab = function (tab_clicked,content,tabs){
  for (x=0; x < tabs.length; x++){
    
    var cid = content[x];
    var tid = tabs[x];
    if (document.getElementById(cid).style.display == ''){
      toggle.hide(cid);
      document.getElementById(tid).className = '';
    }
    if (cid == tab_clicked){
      toggle.show(cid);
      document.getElementById(tid).className = 'active';
    }
  }
}

window.toggle_contact_form = function (type){
  if (type == "taxes"){
    toggle.show(type);
    toggle.hide("accounting");
    document.getElementById("form_type").value = type;
  }
  else if (type == "accounting"){
    toggle.show(type);
    toggle.hide("taxes");
    document.getElementById("form_type").value = type;
  }
}
})();