
// 
// Common javascript used on Sutter County web pages
// 

function enterSearchForm(e, txtvalue) {
  var k = -1;
  if (e && e.which) k = e.which; // NS;
  else if (window.event && window.event.keyCode) k = window.event.keyCode; // IE
  if (k == 10 || k == 13) {
    doSearch(txtvalue);
    return false;
  }
}

function doSearch(txtval) {
  location.href = '/Apps/SiteSearch/Search.aspx?term=' + txtval;
}

function CursorToCtl(item) {
  if (item != null && document.getElementById(item) != null) 
  {
    // Place focus on control.  Note: for Calendar Popup controls
    // this code works in conjunction with the startup script at
    // the bottom of the page that sets the onfocus event handlers
    // in the PreRender of the code-behind.
    var ctl = document.getElementById(item);
    if (ctl != null)
    {
		ctl.focus();
    }
  }
}

//
//This script will remove frames, it executes without a call
//
if (top.location != self.location) 
{
	// Held hostage by a frame...break outta here...    
    top.location.replace(self.location)
}
