jQuery(document).ready(function() {
  var srchInput = document.getElementById('uniSrchText'),
      srchGo = document.getElementById('uniSrchSub'),
      srchForm = document.getElementById('uniSrchForm'),
      isEmpty;
  function addStyle() {
    var ssheet = document.createElement('style'),
        selector = '#header form #uniSrchSub, #header form #uniSrchSub:hover',
        declaration = 'background:#ececec; color:#424242;';
    if (ssheet) {
      ssheet.setAttribute('type','text/css');
      ssheet.setAttribute('media','screen');
      try {
        ssheet.appendChild(document.createTextNode('#header form #uniSrchSub, #header form #uniSrchSub:hover {background:#ececec; color:#424242;}'));
      } catch(e) {};
      document.getElementsByTagName('head')[0].appendChild(ssheet);
      if (jQuery.browser.msie && document.styleSheets && document.styleSheets.length > 0) {
        try {
          var last_style_node = document.styleSheets[document.styleSheets.length - 1];
          if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
        } catch(e) {};
      }        
    }
  }
  function val(elm) {return elm.value.replace(/^\s+|\s+$/g,'');}    
  function resetStyle() {
    srchInput.style.color = '#6f6f6f';
    srchInput.style.fontStyle = 'italic';
    srchGo.style.color = '#424242';
    srchGo.style.background = '#ececec';
    srchInput.value = 'Search';
  }
  function unStyle() {
    srchInput.value = '';
    srchInput.style.fontStyle = '';
    srchGo.style.color = srchInput.style.color = '#000';
  }    
  addStyle();
  isEmpty = (val(srchInput).length == 0);
  if (isEmpty) resetStyle();
  srchInput.onfocus = function() {if (isEmpty) unStyle();}
  srchInput.onblur = function() {
    isEmpty = (val(srchInput).length == 0);
    if (isEmpty) resetStyle();
  }
  srchGo.onmouseover = function() {if (!isEmpty) {this.style.color = '#be4b00'; this.style.background = '#ffe2bd';}};
  srchGo.onmouseout = function() {this.style.color = '#424242'; this.style.background = '#ececec'};
});

function kwd_search_validate(formId,textId) {
  var f,k,changed=true;
  if (!document.getElementById) return;
  f = document.getElementById(formId);
  k = document.getElementById(textId);
  if (f && k) {
    f.onsubmit = function() {
      if (k.value.match(/^\s*$/) || !changed) {
        k.value='Enter keywords';
        k.style.backgroundColor='#f0dddd';
        changed = false;
        k.onfocus = function() {
          k.style.backgroundColor = '';
          k.value = '';
          changed = true;
          k.onfocus = function(){}
        };
        k.onchange = function() {changed = true;}
        return false;
      }
      return true;
    }
  }
}

<!-- ph=1 -->
<!-- nhm:from_kauri -->

