/*
 * Google Custom Search script stuff
 * Taken from http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en
 * and fixed by Thomas to be less gay.
 */

function GoogleSearchInit()
{
  var f = document.getElementById('cse-search-box');

  if (f && f.q)
  {
    var q = f.q;
    var n = navigator;
    var l = location;

    //    if (n.platform == 'Win32')
    //{
    //  q.style.cssText = 'border: 1px solid #7e9db9; padding: 2px;';
    //}

    var b = function()
    {
      if (q.value == '')
      {
        q.style.background = 'white url("website_files/googlesearch.gif") left no-repeat';
      }
    };

    var f = function()
    {
      q.style.background = 'white';
    };

    q.onfocus = f;
    q.onblur = b;

    if (!/[&?]q=[^&]/.test(l.search)) { b(); }
  }
}

window.onload = GoogleSearchInit;

