﻿// Javascript functions for Sutter County Sheriff

//
// Search box functions
//

function searchBoxFocus(ctrl)
{
    // When the search box gets focus, clear it out to position the cursor at the beginning
    ctrl.value = "";
}

function clickButton(e, btnID)
{
    // Allows user to press enter key in search box to submit search, but
    // is generic enough to be used by other controls as well.
    
    var evt = e ? e : window.event;
    var btn = document.getElementById(btnID);
    
    if (btn){
        // Check for enter key press within the control (textbox)
        if (evt.keyCode == 13){
            // Raise click event for the button
            btn.click();
            return false;
        }
    }
 }	

