add_load_event = function(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
		window.onload = func;}
	else{
		window.onload = function(){
			oldonload();
			func();}}}

open_url = function(url){
	window.location = url;}
	
open_popup = function(url){
	window.open(url);}	

var error_arr = new Array();
	
build_error = function(error_text, insertbefore_ell){
	var label_ell = document.createElement('label');
	label_ell.innerHTML = '&nbsp;';	
	fieldset_ell.insertBefore(label_ell, insertbefore_ell);	
	var span_ell = document.createElement('span');							
	span_ell.className = 'error';	
	span_ell.innerHTML = error_text;
	fieldset_ell.insertBefore(span_ell, insertbefore_ell);	
	var br_ell = document.createElement('br');		
	fieldset_ell.insertBefore(br_ell, insertbefore_ell);	
	error_arr[error_arr.length] = new Array(label_ell, span_ell, br_ell);}
	
clear_errors = function(){
	for(var i = 0; i < error_arr.length; i++){				
		if(error_arr[i]){				
			fieldset_ell.removeChild(error_arr[i][0]);
			fieldset_ell.removeChild(error_arr[i][1]);
			fieldset_ell.removeChild(error_arr[i][2]);}}
	error_arr = new Array();}
	
init_search = function(){
	var search_ell = document.getElementById('search');
	search_ell.onclick = function(){
		search_ell.value = '';}
	var search_button = document.getElementById('searchbutton');
	search_button.onclick = function(){
		document.getElementsByTagName('form')[0].submit();
		return false;}}
	
init_table = function(){	
	var tr_ell = document.getElementsByTagName('tr');
	for(var i = 0; i < tr_ell.length; i++){		
		tr_ell[i].onmouseover = function(){
			this.className = 'over';}	
		tr_ell[i].onmouseout = function(){
			this.className = '';}}}
	
add_load_event(init_table);
add_load_event(init_search);