$(document).ready(function(){
	
	// Toggle e-mail newsletter prompt
	$email_box = $('input[name="email"]');
	$email_box.focus(function(){
		if ($email_box.val() == 'Email Address')
			$email_box.val('');
	});
	$email_box.blur(function(){
		if ($email_box.val() == '')
		  	$email_box.val('Email Address');
	}); 
	
	// Enable collapsable side menus
	submenus = $('#category_menu li a + ul');
	submenus.css('display', 'none');
	jQuery.each(submenus, function(){
		$(this).prev('a').click(function(){
			$(this).next('ul').slideToggle('normal');
			return false;
		});
	}); 
	
	// Swap alternate product views with the large product image
	var alternate_views = $('img.alternate_view');
	alternate_views.css('cursor', 'pointer');
	jQuery.each(alternate_views, function(){
		$(this).click(function(){
			swap = $(this).attr("src");
			$(this).attr({
				src: $('img#large_product_image').attr("src")
			});
			$('img#large_product_image').attr({
				src: swap
			});
			$('img#large_product_image').parent('a').attr({
				href: swap
			});
		});
	});
});