    	$(document).ready(function(){
    		
    		$('form:#registerForm').submit(function(){ 
    			$.post("http://www.ihave.org.uk/ihave/public/index/register", $('form:#registerForm').serialize(), function(data){
    				if (data == 'ok'){
    					$('#status-message').text("Thank you for registering with us. We will keep you posted.");
    				}else{
    					$('#status-message').text("Please enter a valid email address.");
    				}

    				$('#status-message').slideDown("slow");
    				setTimeout(function(){ $('#status-message').slideUp("slow"); }, 2500); 
    				
    			});
    			return false;
    		});

    		if ($('#status-message').text() != ""){
    			$('#status-message').slideDown("slow");
    			setTimeout(function(){ $('#status-message').slideUp("slow"); }, 2500); 
    		}
    		
    		 $('.charity-tooltip a').qtip({
    			 hide: { effect: { type: 'fade' }, fixed:true }, 
   		      	content: {
    		         text: "test"
    		      },
    		      position: {
    		          corner: {
    		             target: 'leftTop',
    		             tooltip: 'rightTop'
    		          }
    		       },
    		       style: { 
        		       background: '#fff6dc',
						color: 'black',
						tip: 'rightTop',
						width: 400,    		    	  
						border: {
    		    	         width: 1,
    		    	         radius: 5,
    		    	         color: '#fee59e'
    		    	      }
    		       }  		       
    		   });


    			$('.charity-tooltip a').hover(function() { 

    				var api = $(this).qtip("api");
    				charityId = $(this).attr('className').replace("charity-tooltip-", "");
    				var text = $("#"+charityId);
    				
    				api.updateContent(" ");
    				api.updateContent(text);
					
				});

    			$('.headline-link').hover(function() { 
        			if ($('#btn-'+$(this).attr("id")).hasClass("btn-stillneeded")){
        				$('#btn-'+$(this).attr("id")).removeClass('btn-stillneeded');
        				$('#btn-'+$(this).attr("id")).addClass('btn-stillneeded-ticked');
        			}
					}, function (){
						if ($('#btn-'+$(this).attr("id")).hasClass("btn-stillneeded-ticked")){
	        				$('#btn-'+$(this).attr("id")).addClass('btn-stillneeded');
	        				$('#btn-'+$(this).attr("id")).removeClass('btn-stillneeded-ticked');
	        			}
				});

    			setTimeout(function(){ $('#status-message').slideUp("slow"); }, 2500); 

    			
    			$("#register_text").focus(function(){
    			    this.select();
    			    if ($(this).attr('value') == 'email address'){
    			    	$(this).attr('value', '');
    			    }
    			});

    			$("#register_text").blur(function(){
    			    if ($(this).attr('value') == ''){
    			    	$(this).attr('value', 'email address');
    			    }
    			});
    			
    	});
