
function formFocus() {
	if (!document.getElementById) return false;	
	
	var colInputs = document.getElementsByTagName('input');
	var colTextAreas = document.getElementsByTagName('textarea');
	for (var i=0; i < colInputs.length; i++){
		if (colInputs[i].type == 'text' || colInputs [i].type == 'password') {
		colInputs[i].onfocus = function () { this.select(); };
	}
	}
		for (var i=0; i < colTextAreas.length; i++){
		colTextAreas[i].onfocus = function () { this.select(); };
	}
	
}

addEvent(window, 'load', formFocus);