if(document.all) {
	if(window.clientInformation.platform.indexOf("Mac") == -1)
		document.attachEvent("onkeydown", EnterButtonSubmit);
}
else {
	document.addEventListener("keydown",EnterButtonSubmit,false);
}

function EnterButtonSubmit( e ) {
	var enterKeyCode = 13;
	var keyCode = ( document.all ) ? event.keyCode : e.keyCode;
	if ( keyCode == enterKeyCode ) {
		var nextControl = ( document.all ) ? event.srcElement : e.target;
		var control;
		if (nextControl.tagName != "TEXTAREA")
		{
			while ( nextControl )
			{
				control = nextControl;
				if (control && (control.tagName == "INPUT" && (control.getAttribute("type") == "submit" || control.getAttribute("type") == "image")) || (control.tagName == "A" && control.getAttribute("href").indexOf("javascript:__doPostBack") > -1)) {
					control.click();
					break;
				}
				control = FirstChild(nextControl);
				if (!control)
					control = NextSibling(nextControl);
				nextControl = control;
			}
			return false;
		}
	}
	return true;
}

function FirstChild(node) {
	var child;
	if (node)
		child = node.firstChild;
	return child;
}

function NextSibling(node) {
	var next;
	if (node && node.tagName != "SCRIPT")
		next = node.nextSibling;
	if (!next && node)
		next = NextSibling(node.parentNode);
	return next;
}