// jquery.persistent-helper-text
// Developed by Nathanael Boehm, http://www.purecaffeine.com
// Licensed under the Creative Commons Attribution-Share Alike 2.5 License

//presist removed: $(this).before('<div id="persist-wrapper"><p id="persist-below">'+persist.helperPrefix+' '+$(this).attr('title')+'</p></div>');$('#persist-below').css('top',$(this).parent().height()-2);

function persist(){this.timing=200;this.userText="#000";this.helperText="#888";this.helperPrefix="TIP:"}
persist = new persist();
$(document).ready(function(){
	$('input.persist').each(function(i,o){
		$(o).val($(o).attr('title'));
		$(o).css('color',persist.helperText);
	});
	$('input.persist').bind('focus',function(){
		if($(this).val()==$(this).attr('title')){
			if(persist.timing>0) {
				$(this).animate({color:"#FFF"},persist.timing);
			}else{
				$(this).css('color','#FFF');
			}
			$(this).val('');
		}
		if(persist.timing>0){
			$('#persist-below').animate({color:persist.helperText},persist.timing);
			$(this).animate({color:persist.userText},persist.timing);
		}else{
			$('#persist-below').css('color',persist.helperText);
			$(this).css('color',persist.userText);
		}
	});
	
	$('input.persist').bind('blur',function(){
		if(persist.timing>0){
			$('#persist-below').animate({color:"#FFF"},persist.timing);
		}else{
			$('#persist-below').css('color','#FFF');
		}
		$('#persist-wrapper').remove();
		if($(this).val()==''){
			$(this).css('color','#FFF');
			$(this).val($(this).attr('title'));
			if(persist.timing>0){
				$(this).animate({color: persist.helperText},persist.timing);
			}else{
				$(this).css('color',persist.helperText);
			}
		}
	});
});	