/* ------------------------------------------------------------------------
 * Function:    trim
 * --------------------------------------------------------------------- */
function trim(str)
{  
  return str.replace(/^\s+|\s+$/g, '');  
}  

/* ------------------------------------------------------------------------
 * Function:    clearInput
 * --------------------------------------------------------------------- */
function clearInput(e, compare)
{  
  $(e).removeClass('blank_text');   // remove grayed out color  
  if (e.value == compare)
  {
    e.value = '';                // clear default text when clicked  
  }  
}  

/* ------------------------------------------------------------------------
 * Function:    restoreInput
 * --------------------------------------------------------------------- */
function restoreInput(e, value)
{  
  if (trim(e.value) == '')
  {  
    e.value = value;             // reset default text when unclicked  
    $(e).addClass('blank_text');  // display grayed out color  
  }  
}