	
	$(
		function() {
			cfab();
		}
		
	);
	
	$(document).ready(function() 
		{
			init();
		}
	);
	
	function cfab() {
		
		var className = $("#ad-image").attr("class");
		
		if (className) {
			
			$("#ad").html("Looks like you have ad-block enabled, which is (of course) fine. But please take a minute to read <a href=\"http://108things.co.uk/ads\">our ad policy</a>. It's not like many others.");
		} else {
			
			$("#ad").append("<a href=\"http://108things.co.uk/ads\">Our ad policy</a>");
		}
		
	}
	
	
	function init() {
		
		var t = $(".form-text");
		
		
		if(t != null)
		{
			label($(t));
			
			t.change(function() {
				label($(this));
			});
			
			t.focus(function() {
				remLabel($(this));
			});
			
			t.blur(function() {
				label($(this));
			});
		}
	
	}
	
	function addLabel(e) {
		e.addClass("l");
	}
	
	function remLabel(e) {
		e.removeClass("l");
	}	
	
	function label(e) {		
		if(e.val() == "") {
			addLabel(e);
		}
		else
		{
			remLabel(e);
		}
	}
	