function attachBorderAndSelect(id){
  	obj0 = document.getElementById(id)
  	obj0.onfocus= function() {this.style.background='#eee url("/_img/fieldbg.gif") repeat-x top';}
	obj0.onblur= function() {this.style.background='#fff url("/_img/fieldbg.gif") repeat-x top';}
}

function initTextHighlight(bFormFocus) {
	var arFormInputFields = document.forms[0].getElementsByTagName("INPUT");
	var arFormTextFields = document.forms[0].getElementsByTagName("TEXTAREA");
	var arInputFields = new Array();
	
	for (var cInput=0; cInput<arFormInputFields.length; cInput++) {
		arInputFields[cInput] = arFormInputFields[cInput];
	}
	for (var cText=0; cText<arFormTextFields.length; cText++) {
		arInputFields[cInput+cText] = arFormTextFields[cText];
	}
	
	var bFocusSet = false;
	if (bFormFocus == 'none') { bFocusSet = true; } 
	
  	for (var i=0; i<arInputFields.length; i++) {
		if ((arInputFields[i].type == 'text') || (arInputFields[i].type == 'password') || (arInputFields[i].type == 'file') || (arInputFields[i].type == 'textarea')) {
			attachBorderAndSelect(arInputFields[i].id); // Attach onFocus & onBlur events
			if (!bFocusSet) {document.forms[0][arInputFields[i].id].focus(); bFocusSet = true;}	// Automatically focus first text box on page
    	}
  	}
}