// JavaScript Document

/* start it here! */
function hideSubmits(e) {
	if(!document.getElementsByTagName) return false; // checks dom validity
	var inputs = document.getElementsByTagName('input');
	for(i=0; i<inputs.length; i++) {
		if(inputs[i].getAttribute('type')=='submit') {
			// how about just changing the class of this instead, keep the CSS in the CSS?
			addClass(inputs[i].parentNode,'hidden'); // input.hidden {display: none;}
			//inputs[i].style.display = 'none';
		}
	}
	var selects = document.getElementsByTagName('select');
	for(i=0; i<selects.length; i++) {
		addEvent(selects[i],'change',function(e) {
			// submit the form
			this.form.submit();
		} );
	}
}
function highlightRows() {
  if(!document.getElementsByTagName) return false;
  var rows = document.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
  for (var i=0; i<rows.length; i++) {
    rows[i].oldClassName = rows[i].className
    rows[i].onmouseover = function() {
      addClass(this,"highlight");
    }
    rows[i].onmouseout = function() {
      this.className = this.oldClassName
    }
  }
}		

addEvent(window,'load',hideSubmits);
addEvent(window,'load',highlightRows);

