﻿//Send to server.
function SubmitSimpleSearch() {
   var srCtrl = "SelectResults1_";
   var obj, hid;

   $get(srCtrl + "TaskName_hid").value = "SimpleSearch";
   $get(srCtrl + "Command_hid").value = "-";
   $get(srCtrl + "GeomStr_hid").value = "-";

   obj = $get(srCtrl + "SelectableLayers_DropDownList");
   hid = $get(srCtrl + "SelectLayer_hid");
   hid.value = obj.value;

   obj = $get(srCtrl + "SelectMode_DropDownList");
   hid = $get(srCtrl + "SelectMode_hid");
   hid.value = obj.value;

   obj = $get("Simple_textBox");
   hid = $get(srCtrl + "SearchValues_hid");
   hid.value = obj.value;
   if (hid.value == "") {
      return;
   }
   //Submit.
   showBusy("SimpleSearch");
   obj = $get(srCtrl + "CallbackButton1");
   obj.click();
}
//Set focus.
function focusSimpleSearch() {
   window.setTimeout("focusSS();", 300);
}
function focusSS() {
   $get("Simple_textBox").focus();
}

//Process enter key.
function EnterKey_ss(e, evt) {
   if (evt.keyCode == 13) {
      SubmitSimpleSearch();
      evt.returnValue = false;
   }
}
