
function handleEnter (field, event) {

		var IE = (document.all) ? true : false; 	

        if (!event) event = window.event;
                
        
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		var cFocus;
		var parent;

		if (keyCode == 13) {
			cFocus = document.activeElement;
			//alert('cFocus.type==>' + cFocus.type + ' cFocus.tagName==>' + cFocus.tagName);
			switch (cFocus.type.toUpperCase()){
				case 'TEXTAREA':
				case 'BUTTON':
				case 'SUBMIT':
					return true;  // allow above types to fire click on Enter key.
					break;		  // you may want to include <a> tags in this but you can't use type. you must use cFocus.tagName = 'A'
								// but this action is what I am trying to stop here.
				default :
				    if (focusNextButton(cFocus.id))
						return false;
					else if (IE) {
						event.keyCode = 9;  // set to tab instead of enter
						break;
					} else {
						return false;
					}
			}
		} 
		else
		return true;
	}      


function focusNextButton(id) {
    var cntrl = id.split("_")[0];
    var btn = document.getElementById(cntrl + "_Button" + cntrl);
    
    if (btn) {
        btn.focus();
		btn.click();
		return true;
	}
	return false;
}