
Cufon.replace('#motdWidget');
Cufon.replace('.contentSliderRight_host a');
Cufon.replace('.contentSliderRight_special a');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('.lg_btn a');
Cufon.replace('.cufon');


jQuery.fn.wait = function(time, type) 
{
  time = time || 1000;
  type = type || "fx";
  return this.queue(type, function() 
  {
    var self = this;
    setTimeout(function() 
    {
      jQuery(self).dequeue();
    }, time);
  });
};

jQuery(document).ready(function($)
{
  $('#navigation li').hover(function()
  {
    $('ul:first', this).slideDown(100);
  },
  function()
  {
    $('ul:first', this).slideUp(100);
  });
  
  
  jQuery('#search').focus(function()
  {
    if(this.value == 'Search Site...')
      this.value = '';
  });
  
  jQuery('#search').blur(function()
  {
    if(this.value == '')
      this.value = 'Search Site...';
  });
  


  // widgets
  var motdNode = jQuery('#motdWidget');
  if(motdNode.get(0))
    var motdWidget = new MotdWidget(motdNode.get(0), 
    {
      slug  : 'home',
      delay : 10,
      changeNode : function(currentNode, targetNode)
      {
        targetNode = jQuery(targetNode);
        if(currentNode)
        {
          currentNode = jQuery(currentNode);
          currentNode.fadeOut(1000, function()
          {
            targetNode.fadeIn(1000);
          });
        }
        else
        {
          targetNode.fadeIn(1000);
        }
      }
    });

  
});

function clearDefaultText(inputID, defaultText)
{
  var inp = $('#' + inputID);
  
  if (inp.val() == defaultText)
  {
    inp.val('');
  }
  else if (inp.val() == '')
  {
    inp.val(defaultText);
  }
}
