﻿function KeyDownHandler(btn, e)
    {
		//alert("here" + btn);
		
        // process only the Enter key
        //var e = window.event;
        if (e==null) {
			e = window.event;
        }
        if (e.keyCode == 13)
        {
			var theBtn = document.getElementById(btn);
			// cancel the default submit 
            //e.returnValue=false;
            //e.cancel = true;
            // submit the form by programmatically clicking the specified button
            //alert("The btn is " + theBtn.id);
            //window.location = document.getElementById(btn).href;
            //document.getElementById(btn).createEvent("click");
            document.getElementById(btn).click();
            
            return false;
        }else {
            return true;
        }
    }
    
    function KeyDownLinkHandler(btn, e)
    {
		//alert("here" + btn);
		
        // process only the Enter key
        //var e = window.event;
        if (e==null) {
			e = window.event;
        }
        if (e.keyCode == 13)
        {
			var theBtn = document.getElementById(btn);
			// cancel the default submit 
            //e.returnValue=false;
            //e.cancel = true;
            // submit the form by programmatically clicking the specified button
            //alert("The btn is " + theBtn.id);
            window.location = document.getElementById(btn).href;
            //document.getElementById(btn).createEvent("click");
            //document.getElementById(btn).click();
            
            return false;
        }else {
            return true;
        }
    }