/*
	jQuery formHints (jQuery 1.2.3 - 1.4.1)
	Version: 1.0
	Authors: Serega Korolev and Serega Tolmachyov (Fuse8 Online)
*/

(function($){$.fn.formHints=function(d){var e={labelTag:'label',inputTag:'input',hideSpeed:250,showSpeed:250,timerDelay:120};var f=$(this);$.extend(f,{setTimer:function(a,b){a.timer=setInterval(function(){if(a.val()==''){if(b.css('display')=='none')b.show()}else{if(b.css('display')=='block')b.hide()}},a.options.timerDelay)},removeTimer:function(a){if(a.timer)clearInterval(a.timer)}});f.each(function(){var a=$(this);if(a.length==1&&!a.parent().hasClass('usedHints')){a.options=$.extend({},e,d);if(a[0].nodeName.toLowerCase()=='textarea')a.val('');var b=a.parent().find(a.options.labelTag).css({position:'absolute',cursor:'text',opacity:1}).eq(0);var c=$('<div class="usedHints" style="position:relative;"></div>');b.before(c);b.appendTo(c);a.appendTo(c);f.setTimer(a,b);a.focus(function(){b.animate({opacity:0},a.options.hideSpeed,function(){$(this).hide()});f.removeTimer(a)});a.blur(function(){b.stop(true,false);if(a.val()==''){b.show().animate({opacity:1},a.options.showSpeed);f.setTimer(a,b)}});b.click(function(){a[0].focus()})}});$(window).bind('unload',function(){f.remove()});return f}})(jQuery);
