$(document).ready(function() {

	// prepend the empty spans in the H1 tags for the gradient effects :)
	$('h1').prepend('<span></span>');
	
	imgarray = $("#imglist li").get();
	imgtotal = imgarray.length;
	if (imgtotal > 0) {
		if (imgplaying) {
			imgGoNext();
		}
		else {
			imgGo(0);
		}
	}
	
	$('#mbr-open').click(function () { 
      $('#mbr-login').slideToggle(400); 
    });
	
  $(function(){  
    $("#bottom").fadeIn("slow");
//    $("#bottom").positionFooter(true);  
  }); 


	// check for what is/isn't already checked and match it on the fake ones
	$("input:checkbox").each( function() {
		(this.checked) ? $("#fake"+this.id).addClass('fakechecked') : $("#fake"+this.id).removeClass('fakechecked');
	});
	// function to 'check' the fake ones and their matching checkboxes
	$(".fakecheck").click(function(){
		($(this).hasClass('fakechecked')) ? $(this).removeClass('fakechecked') : $(this).addClass('fakechecked');
		$(this.hash).trigger("click");
		return false;
	});
/*
$('.headerImg').cycle({
fx:        'fade',
speed:  5000	   
});
*/
      });
	  
	  
	  
function addToBasket(itemid){
	$.post('/basket', { action: 'add', id: itemid, qty: $('#qty'+itemid).val() },
			function(data){
				$("#basket").html(data);
			});
}
function removeFromBasket(itemid){
	$.post('/basket', { action: 'remove', id: itemid },
			function(data){
				$("#basket").html(data);
			});
}
	  