	   $(document).ready(
				function(){
				
				
$('.suberror').hide();

$(".button").click(function() {
	// validate and process form
	// first hide any error messages
	$('.suberror').hide();
	
	var email = $("input#email").val();
	if (email == "") {
	$("label#email_error").show();
	$("input#email").focus();
	return false;
	}
	
	var dataString = 'email=' + email;
	/* alert (dataString);return false; */
	
	$.ajax({
	type: "POST",
	url: "submit-email.asp",
	data: dataString,
	
	success: function(data) {
	$('#subscribe').html("<div id='message'></div>");
	$('#message').html("<h2>Subscribe!</h2>")
	.append("<p>&nbsp;"+data+"</p>")
	.hide()
	.fadeIn(1500, function() {
	$('#message').append("<img id='checkmark' src='images/check.png' />");
	});
	}
	});
	return false;
});


			$('.promo-latest').innerfade({
						timeout: 6000,
						speed: 'slow',
						containerheight: 'auto'
			});

			$('.vinyl-latest').innerfade({
						timeout: 6000,
						speed: 'slow',						
						containerheight: 'auto'
			});
						
			$('.mp3-latest').innerfade({
						timeout: 6000,
						speed: 'slow',						
						containerheight: 'auto'
			});
						
						
			$("li.shoplink").click(function() {
			window.location.href = '/product/'+$(this).attr("rel")
			});
				
		$("li.hoverme").mouseover(function(){
			$(this).css({ backgroundImage : "url(/images/threeacross_item-over_bg.gif)" });
			}).mouseout(function(){
			$(this).css({ backgroundImage : "url(/images/threeacross_item_bg.gif)" });
		});
		
		
				$("div.artistreleases").mouseover(function(){
			$(this).css({ backgroundImage : "url(/images/threeacross_item-over_bg.gif)" });
			}).mouseout(function(){
			$(this).css({ backgroundImage : "url(/images/threeacross_item_bg.gif)" });
		});
				    
		$("a.addtocart").click(function() {
			$(this).css("background-image", "url(/images/buy_btn_alt.gif)"); 
            $.get("/cart.asp", { id: $(this).attr("id") },
            function(data){
            $("#minicartcontents").html(data);
			$("#minicart").effect("highlight", {}, 2000);  
            });                                
		});

		$("span.buytrack").click(function() {
            $.get("/cart.asp", { id: $(this).attr("id") },
            function(data){
            $("#minicartcontents").html(data);
			$("#minicart").effect("highlight", {}, 2000);  
            });                                
		});
		
		
		$("img.delfromcart").click(function() {
            $.get("/cart.asp", { id: $(this).attr("id"), qty: "0" },
            function(data){
            window.location.href = '/fullcart'
            });                                
		}); 
		

		     

		$("a.viewcart").click(function() {
		window.location.href = '/fullcart'
		});     
    


			$("a.popupwindow").click(function(){
			window.open(this.href, 'grid', "height=80,width=270,scrollbars=0,status=0,createnew=0").focus();
			return false;
		});
		
		
			$("div.gallerylink").click(function() {
			window.location.href = '/gallery-view/'+$(this).attr("id")
			});
		
			$("div.artists").click(function() {
			window.location.href = '/artist/'+$(this).attr("rel")+'/'
			});


			$("div.artist").click(function() {
			window.location.href = '/artist/'+$(this).attr("rel")+'/'
			});
			
			$("div.artistreleases").click(function() {
			window.location.href = '/product/'+$(this).attr("rel")+'/'
			});
/*
		$("form").submit(function() {
      if ($("input:first").val() == "correct") {
        $("span").text("Validated...").show();
        return true;
      }
      $("span").text("Not valid!").show().fadeOut(1000);
      return false;
    });
*/

		
    
});
			
			

