(function ($) {
$.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'sblur';
  }
  return this.each(function () {
    var $input = $(this),
      title = $input.attr('title'),
      $form = $(this.form),
      $win = $(window);
    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }
	if (title) { 
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur();      
      $form.submit(remove);
      $win.unload(remove);
    }
  });
};
})(jQuery);


$(function() {

	$("input[name='keywords'], input[name='username'], input[name='password']").hint();

	$("#navbar>ul>li, #footbar>ul>li").fadeTo(1,0.6);
	$(".headericon").fadeTo(100,0.7);
	$("#navbar>ul>li, #footbar>ul>li").mouseenter(function()
	{
		$(this).children("ul").show();
		$(this).stop().fadeTo(300,1);
	}).mouseleave(function() {
		$(this).children("ul").hide();
		$(this).fadeTo(300,0.6);
	});
	$(".headericon").hover(function() {
		$(this).fadeTo(100,1);
		$("#tiptext").html("<img src='/images/icons/information.png' alt=''> "+$(this).attr("rel"));
	},function() {
		$(this).fadeTo(100,0.7);
		$("#tiptext").html("");
	});
	
	setInterval(function() {
		$(".flashbutton").fadeTo(400,1).fadeTo(400,0.7).fadeTo(400,1).fadeTo(400,0.7);
	},2000)
});
