 
function setFocus(id) {
	var ctlToFocus = document.getElementById(id);

	if ( ctlToFocus != null ) {
		ctlToFocus.focus();
	}

}

var enterCtl;
var enterArg = "";
var validateForm = false;

function handleEnter(evt) {

	evt = ( evt ) ? evt : (( window.event ) ? window.event : null );
    //evt = (document.layers) ? keyStroke.which : event.keyCode;
	if ( evt ) {
		if ( evt == 13 || evt == 3 ) {
			
			if ( validateForm == true && window.validate_form != null ) {
				if ( validate_form() == true ) {
					__doPostBack(enterCtl, enterArg);
				}
			} else {
				__doPostBack(enterCtl, enterArg);
			}
		}
	}
}
function assignEnter(id) {

	assignEnterWithArg(id, "", false);
}
function assignEnterAndValidate(id) {
	assignEnterWithArg(id, "", true);
}
function assignEnterWithArg(id, arg, validate) {	
	if ( document.getElementById(id) != null ) {
		validateForm = validate;
		enterCtl = id;
		arg = arg;
		document.onkeyup = handleEnter;

	}

}
