// remap jQuery to $

(function($){})(window.jQuery);

// Supersize 

jQuery(function($){
					
		$.supersized({
		
		slides  :  	[ {image : 'http://matthewa.com/wp-content/themes/matthewa-html5/images/bkg.jpg', title : 'grunge background'} ]
	
		});
	});

// Image rollovers use data-hover="" in image tag

$(function() {
    
	$('img[data-hover]').hover(function() {
        
		$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
    
	}).each(function() {
        
		$('<img />').attr('src', $(this).attr('data-hover'));
    
	});;
	 
	 $('input[data-hover]').hover(function() {
        
		$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
    
	}).each(function() {
        
		$('<img />').attr('src', $(this).attr('data-hover'));
    
	});;

});


// Homepage bubble animations

	$(".work-animate").mouseenter(function() {
										   
		$(".blog-bubble,.contact-bubble").hide();								
		$(".work-bubble").stop().fadeIn('fast').animate({"top": "145px"}, 200, 'easeOutBounce');
		
	}).mouseleave(function() {
		
		$(".work-bubble").animate({"top": "120px"}, "fast").fadeOut('fast');
	
	});
	
	$(".blog-animate").mouseenter(function() {
		
		$(".work-bubble,.contact-bubble").hide();
		$(".blog-bubble").stop().fadeIn('fast').animate({"top": "110px"}, 200, 'easeOutBounce');
		
	}).mouseleave(function() {
		
		$(".blog-bubble").animate({"top": "90px"}, "fast").fadeOut('fast');
	
	});
	
	$(".contact-animate").mouseenter(function() {
		
		$(".work-bubble,.blog-bubble").hide();
		$(".contact-bubble").stop().fadeIn('fast').animate({"top": "160px"}, 200, 'easeOutBounce');
		
	}).mouseleave(function() {
	
		$(".contact-bubble").animate({"top": "130px"}, "fast").fadeOut('fast');
	
	});
	
	$(".close").click(function() {
  		
		$(".content-bubble").animate({"top": "-1000px"}, 300, 'easeInBack').fadeOut('fast');
	
	});

$(document).ready(function (){
							
	// Homepage hide stuffs
	$(".content-bubble,.work-bubble,.blog-bubble,.contact-bubble").hide();
	
	// Nav current page labels
	$(".current-page").fadeIn('fast').animate({top: "-33px"}, 500, 'easeOutBounce');

});

 $(window).load(function() {
		
	$(".work-animate").fadeIn('fast').animate({"top": "456px"}, 1000, 'easeOutBounce');
	$(".blog-animate").fadeIn('fast').animate({"top": "324px"}, 500, 'easeOutBounce');
	$(".contact-animate").fadeIn('fast').animate({"top": "374px"}, 1200, 'easeOutBounce');
	$(".content-bubble").fadeIn('fast').animate({top: "-210px"}, 1200);
	
	// Content Pages fade in
	$(".secondary-content").fadeIn('slow');

});

/*

$(window).resize(function() {
	
});

*/
