/*
 * Read from SVN revision 45442 on Wed May 19, 2010 at 03:18 PM by r.clein.
 */
function light(event) {
	e = Event.element(event);
	e.style.backgroundColor = '#FAFDAC';
}

function dark(event) {
	e = Event.element(event);
	e.style.backgroundColor = null;
}

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.className.match(/jt_nohighlight/)) {
			Event.observe(e, 'focus', light);
			Event.observe(e, 'blur', dark);
			/*
			e.onfocus	= function() { light(this); };
			e.onblur	= function() { dark(this); };
			*/
		}
	});
	$A($$("input[type=password]")).each(function(e) {
		if(!e.className.match(/eip/) && !e.className.match(/jt_nohighlight/)) {
			Event.observe(e, 'focus', light);
			Event.observe(e, 'blur', dark);
			/*
			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' });
	}
});

