function dispatchinputs() {
	var inputs = document.getElementsByTagName('input');
	for (i in inputs) {
		if (inputs[i].type == 'text' || inputs[i].type == 'password') {
			inputs[i].onfocus = function() {
				//alert(this.style.backgroudColor);
				//this.style.bgColor = 'FFFFFF';
			}
		}
	}
}

/**
 * Ask and Redirect function
 * on question confirmation redirect to specified location
 */
function aar(question, location) {	
	if(confirm(question))
		window.location = location;
}

function $(id) {
	return document.getElementById(id);
}


function tableSort(that, action){
	var fID = that.id;
	var orderBy = $('orderby').value[0];
	var direction = "a";
	
	if(orderBy == "")
		direction = "a";
	else if(orderBy == "a")
		direction = "d";
	else if(orderBy == "d")
		direction = "a";
		
	window.location = 'index.php5?do='+action+'&orderby='+direction+fID;
}