/* ------------------------------------
 Copyright 2006 Andreas Schnaiter, LEO Gesellschaft für Computer & Kommunikation mbH
 ------------------------------------ */

/* 
Successfully tested in:
 - Firefox
 - SeaMonkey
 - Opera
 - Microshit Internet Exploiter
 - Konqueror (sticks to the DOM 2 Standard, which says click() is only supported on <input>)
 
Not supported:

*/

function aRE(event, destid) {
	asRedirEnter(event, destid);
}

function asRedirEnter(event, destid) {
	var e=(event) ? event : window.event;
	if (13==e.keyCode) {
		var btn=$(destid);
		if (null!=btn) {
			if (null!=btn.click) {
				btn.click();
			} else {
				var ev=document.createEvent('UIEvent');
				ev.initUIEvent('DOMActivate', true, true, document.defaultView, 1);
				btn.dispatchEvent(ev);
				e.returnValue=false;
			}
			return false;
		}
	}
	return true;
}