function light(e) {
	e.style.backgroundColor = '#FAFDAC';
}

function dark(e) {
	e.style.backgroundColor = 'white';
}

function initHighlights() {
	/*
	var allInputs = document.getElementsByTagName('INPUT');
	for(i=0;i<allInputs.length;i++) {
		if(allInputs[i].getAttribute('type') == 'text' || allInputs[i].getAttribute('type') == 'password') {
			allInputs[i].onfocus	= function() { light(this); };
			allInputs[i].onblur		= function() { dark(this); };
		}
	}
	*/
	$A($$("input[type=text]")).each(function(e) {
		if(!e.className.match(/eip/)) {
			e.onfocus	= function() { light(this); };
			e.onblur	= function() { dark(this); };
		}
	});
	$A($$("input[type=password]")).each(function(e) {
		if(!e.className.match(/eip/)) {
			e.onfocus	= function() { light(this); };
			e.onblur	= function() { dark(this); };
		}
	});
}

Event.observe(window, "load", initHighlights);

Event.observe(window, "load", function() {
	if($('jt_message')) {
		new Effect.Highlight('jt_message', { duration: 2 });
	}

	if($('jt_error')) {
		new Effect.Highlight('jt_error', { duration: 2, startcolor: '#cf4d4d', endcolor: '#ffffff' });
	}
});
