

window.addEvent('domready', function() {
  try {
    $('container').style.minHeight = $('theBody').clientHeight - ( $('header').clientHeight + $('footer').clientHeight + 37 ) + "px";
  }
  catch(e) {
    // Do nothing
  };
  try {
    setup_search_field();
  }
  catch(e) {
    // Do nothing:
  };
});


/*****************************************************************************/
function setup_search_field()
{
  var default_value = "Site Search";
  if( ! document.getElementById("input_search") )
    return;

  var field = document.getElementById("input_search");
  if( trim(field.value) == default_value || trim(field.value) == "" )
  {
    field.style.color = "#666666";
  }// end if()
  
  field.onfocus = function() {
    if( trim(this.value) == default_value )
    {
      this.value = "";
    }// end if()
    this.style.color = "";
  };
  
  field.onblur = function() {
    if( trim(this.value) == default_value || trim(this.value) == "" )
    {
      this.value = default_value;
      this.style.color = "#666666";
    }// end if()
  };
}// end setup_search_field()


/*****************************************************************************/
function trim( str )
{
  if( ! str || typeof str == "undefined" )
    return '';
  return str.toString().replace(/^\s+/,"").replace(/\s+$/,"");
}// end trim( str )



