$(document).ready(function(){
	
	/**** Header **************************************************************/

	$('#top_menu a[id!=home_link]').css('background-position','bottom');

	$('Body[id!=Home] #shop_link, Body[id!=Blog] #news_link, Body[id!=Art] #art_link, Body[id!=Contact] #contact_link').fadeTo(0,0.4).hover(
		function(){
			$(this).fadeTo('fast',1);
		},
		function(){
			$(this).fadeTo('slow', 0.4);		
		}
	);

	$('#Home #shop_link, #Shop #shop_link, #Checkout #shop_link, #Blog #news_link, #Art  #art_link, #Contact #contact_link').removeAttr('href').css('background-position','bottom center');

	$('#home_link').hover(
		function(){
			$(this).stop().fadeTo('fast',0.4);
		},
		function(){
			$(this).stop().fadeTo('slow', 1);		
		}
	);

	/**** Home ****************************************************************/
	
	$('#Shop ul li a').hover(
		function(){
			$(this).find('img').fadeTo('fast',0.75);
			$(this).find('p').stop().animate({ color: "#191919" }, 200);
		},
		function(){
			$(this).find('img').fadeTo('fast', 1);		
			$(this).find('p').stop().animate({ color: "#b5b5b5" }, 600);
		}
	);
	
	/**** Shop ****************************************************************/

	$("#shopping_cart_link a img").fadeTo(0,0.40);
	$("#shopping_cart_link a").hover(
		function(){
			$(this).find('img').fadeTo('fast',1);
			$(this).find('span').stop().animate({ color: "#191919" }, 200);
		},
		function(){
			$(this).find('img').fadeTo('slow',0.40);
			$(this).find('span').stop().animate({ color: "#b5b5b5" }, 600);
		}
	);
	
	$(".additional_views li a").hover(
		function(){
			$(this).stop().fadeTo('fast',0.75);
		},
		function(){
			$(this).stop().fadeTo('fast',1.00);			
		}
	);
	
	
	
	
	$(".empty_text a:hover").css('color','#191919');
	$(".empty_text a").hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);			
		}
	);
	
	$('#previous, #grid, #next').fadeTo(0,0.40);
	$('#previous, #grid, #next').hover(
		function(){
			$(this).fadeTo('fast',1.00);
		},
		function(){
			$(this).fadeTo('slow',0.40);
		}
	);


	$(".purchase").hover(
		function(){
			$(this).stop().animate({ "borderTopColor":"#191919", "borderRightColor":"#191919", "borderBottomColor":"#191919", "borderLeftColor":"#191919" }, 200);
		},
		function(){
			$(this).stop().animate({ "borderTopColor":"#b5b5b5", "borderRightColor":"#b5b5b5", "borderBottomColor":"#b5b5b5", "borderLeftColor":"#b5b5b5" }, 600);
		}
	);
	
	/* Checkout */

	$("#shippingInfo").css('color','#ccc');
	$("#shippingInfo input").attr("disabled","true");
	$("#shippingInfo select").attr("disabled","true");

	
	$("#same").change(function(){
		
		
		
		if($(this).is(':checked')) {

			$("#shippingInfo").css('color','#ccc');
			$("#shippingInfo input").css({'color':'#ccc'}).attr("disabled","true");
			$("#shippingInfo select").css('color','#ccc').attr("disabled","true");

		}
		else {

			$("#shippingInfo").css('color','inherit');
			$("#shippingInfo input").css('color','inherit').removeAttr("disabled");
			$("#shippingInfo select").css('color','inherit').removeAttr("disabled");

		}
		
		
		
		
		
		
		
	});
		
	/**** News ****************************************************************/
	 $('#News #content').find('img').lazyload({
     placeholder : "images/white.gif",       
     effect      : "fadeIn"
 	});


	$("#News .blog-entry a").hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);
		}
	);

	$("#next-page").hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);
		}
	);



	/* Infinate Scroll */
	$('#content').infinitescroll({
		bufferPx			: 40,
		loadingImg		: "/images/ajax-loader.gif",
    	loadingText		: "Loading new posts...",
	    donetext			: "<p>Congratulations, you've reached the last post.</p>",  
	    navSelector		: "a#next-page",            
	    nextSelector	: "a#next-page",    
	    itemSelector	: "#content .blog-entry",
		threshold			: 550
	},

	function(){
		 $(this).find('img').lazyload({
	     placeholder : "images/white.gif",       
	     effect      : "fadeIn"
	 	});
	});



	/**** Art *****************************************************************/

	$('#Art #content div').hover(
		function(){
			$(this).find('img').fadeTo('fast',0.75);
			$(this).find('h2').stop().animate({ color: "#b5b5b5" }, 200);
			$(this).find('a').stop().animate({ color: "#191919" }, 200);
		},
		function(){
			$(this).find('img').fadeTo('fast', 1);		
			$(this).find('h2').stop().animate({ color: "#191919" }, 600);
			$(this).find('a').stop().animate({ color: "#b5b5b5" }, 600);
		}
	);
	
		/**** Photography *******************************************************/
		
		$('#Photography #content div, #Artwork #content div').hover(
			function(){
				$(this).find('img').fadeTo('fast',0.75);
				$(this).find('h2').stop().animate({ color: "#b5b5b5" }, 200);
				$(this).find('a').stop().animate({ color: "#191919" }, 200);
			},
			function(){
				$(this).find('img').fadeTo('fast', 1);		
				$(this).find('h2').stop().animate({ color: "#191919" }, 600);
				$(this).find('a').stop().animate({ color: "#808080" }, 600);
			}
		);
	
	$("#back").hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);
		}
	);
	
	
	/**** Contact *************************************************************/
	
	$('#Contact #content dd a').hover(
		function(){
			$(this).stop().animate({ color: "#191919" }, 200);
			$(this).parent().prev('dt').stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);			
			$(this).parent().prev('dt').stop().animate({ color: "#191919" }, 600);
		}
	);

	$('body#Contact form input[type=text]').hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);			
		}
	);

	
	$('body#Contact form input[type=submit]').hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);			
		}
	);
	
	/**** Footer **************************************************************/

	$('#footer-logo img').fadeTo(0, 0.4);	
	
	$('#footer-logo img').hover(
		function(){
			$(this).fadeTo('fast',1);
		},
		function(){
			$(this).fadeTo('slow', 0.4);		
		}
	);

	$("#footer a").hover(
		function(){
			$(this).stop().animate({ color: "#b5b5b5" }, 200);
		},
		function(){
			$(this).stop().animate({ color: "#191919" }, 600);
		}
	);


 $('body').fadeIn(600);


});
