$(function() {
	$('a[rel=tipsy]').tipsy({fade: true, gravity: 's'});
});

$(function() {
	$('img[alt=tweet]').tipsy({fade: true, gravity: 'w'});
});

$(document).ready(function(){
 		$("#ajax-contact-form").submit(function(){
 
 		var str = $(this).serialize();
 
		    $.ajax({
		    type: "POST",
		    url: "/contact.php",
		    data: str,
		    success: function(msg){
     
 		$("#note").ajaxComplete(function(event, request, settings){
 
			 if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
			 {
			 result = '<div class="notification_ok">Your message has been sent. Thank you! Apologies in advance for late replies as currently I am away until the 19th of November.</div>';
			 $("#fields").hide();
			 }
			 else
			 {
			 result = msg;
			 }
 
 		$(this).html(result);
 
 	});
 
 		}
 
 	});
 
 		return false;
 
	});
});

$(document).ready(function(){

 	$("#openBtn").click(function(){
 	
 		if ($("#callBack").is(":hidden")){
 			$("#callBack").slideDown({
 				duration: 850, 
 				easing: 'easeOutBack'});
		}
		
 		else{
 		
 		$("#callBack").slideUp({
 			duration: 250, 
 			easing: 'swing'});
 		}
 	}); 

 }); 

$(document).ready(function() { 
    $('#blog_feed').gFeed({  
        url: 'http://www.randpdesign.co.uk/blog/?feed=rss2', 
        max: 2
    });     
}); 

$(document).ready(function() { 
    $('#blog_comments').gFeed({  
        url: 'http://www.randpdesign.co.uk/blog/comments/feed/?feed=rss2', 
        max: 4
    });     
}); 
