//==============================================================================
// The init() func is called for every page load. It's job is to call functions 
// needed for every page, plus call the VERY SPECIAL _onload() func, which is a
// page-level func that is only defined when a specific page needs onload 
// funtionality.
//==============================================================================
function init()
{
	//funcs to call for every page in site
	//focus_first_field();
	//look for page-level _onload() function and execute if exists
 	if ( typeof(window._onload == "function") ){
		window._onload();
	}
}

function trim(s) 
{
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}

function focus_first_field()
{
	var set = false;
	for(i=0; i < document.forms[0].length; i++){
		if (document.forms[0][i].type != "hidden" && document.forms[0][i].disabled != true){
			document.forms[0][i].focus();
			var set = true;
		}
		if (set == true){
			break;
		}
	}
}
function hideshow(id) 
{
    this_box = document.getElementById(id);
    if (this_box.style.display == "none")  {
        this_box.style.display = "";
    } else {
        this_box.style.display = "none";
    }
}
