$(document).ready(function() {
	
	Shadowbox.init();
	
	$('#slider').nivoSlider({
        effect:'fold', // Specify sets like: 'fold,fade,sliceDown'
        animSpeed:500, // Slide transition speed
        pauseTime:4000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
		
    });
	
	Cufon.replace('h1');
	
	$(".cartQty").change(function() {
			var id = $(this).attr('data-id');
			var value = $(this).val();
			
			window.location.href=('/cart/updateQty/'+id+'/'+value); 
			
	});
	
	$('#copyDetails').click(function(){
		if ($(this).attr("checked") == true) {
			$("#custDelAddress1").val($("#custAddress1").val());
			$("#custDelAddress2").val($("#custAddress2").val());
			$("#custDelTown").val($("#custTown").val());
			$("#custDelCounty").val($("#custCounty").val());
			$("#custDelCountry").val($("#custCountry").val());
			$("#custDelPostcode").val($("#custPostcode").val());
		} else {
			$("#custDelAddress1").val('');
			$("#custDelAddress2").val('');
			$("#custDelTown").val('');
			$("#custDelCounty").val('');
			$("#custDelCountry").val('');
			$("#custDelPostcode").val('');
		}
	});
	
});
