// This code takes the query string from the dropdown form below and breaks it apart looking for department code
// It then runs an if-then loop to see if it's equal to what was submitted
// If so it sets the the selected 


	function onboxchange() { 
		O=document.getElementById("deptform");
		O.submit();
		
	}
	
	
	
	
  function onPageLoad() {
     deptcode = parseQueryString()["dept"];

     o = document.getElementById("deptbox")
// This first checks to see if anything was submitted because we have gotten to this page by other means
// Hence deptcode && it's looking to see if it's null
// If we got here via the drop down it wont be null and the if loop continues
     if(deptcode && deptcode.length > 0 && o) {
	 //alert("in if");
	for(i = 0; i < o.length; i++) {
		if(o.options[i].value == deptcode) {
			o.selectedIndex=i;
			break;
		}
	}
     }
  }

function parseQueryString () {
  str = location.search;
  var query = str.charAt(0) == '?' ? str.substring(1) : str;
  var args = new Object();
  if (query) {
    var fields = query.split('&');
    for (var f = 0; f < fields.length; f++) {
      var field = fields[f].split('=');
      args[unescape(field[0].replace(/\+/g, ' '))] = 
unescape(field[1].replace(/\+/g, ' '));
    }
  }
  return args;
}