﻿      function HandleEnterKey(e) {
            var rootpath = '<%= ConfigurationManager.AppSettings.Get("path") %>';
            var key;

            if (window.event)
                key = window.event.keyCode;     //IE
            else
                key = e.which;     //firefox

            if (key == 13) {

                if (txtSearchHasFocus) {                    
                    if (document.getElementById("ctl00_bluheader1_txtSearch").value == "")
                        return false;
                    else
                        window.open(rootpath + "search.aspx?search=" + document.getElementById("ctl00_bluheader1_txtSearch").value);
                   
                }
                else if ((txtBusinessNameHasFocus != null && txtLicNumberHasFocus != null) && (txtBusinessNameHasFocus || txtLicNumberHasFocus)) {              
                e.cancel = true;               
                aspnetForm.__doPostBack('ctl00_ContentPlaceHolder1_btnSearch', 'OnClick');              
                    
                }
                else return false;
            }
        }
        ///////////////
        
