  

    	
	
	function addItem(formID ) {	
      var str = $("#"+formID).serialize(); 
	  
	  		

	  
	  
	  
	  $.get("ajax_handlers/basket.php?action=Add", str, function updateSmallBasket(){
		$.get("ajax_handlers/basket.php?action=DisplaySmall",str,function refreshBasket(content){			
				
		$("#smallBasket").html(content);	
		$("#smallBasket").slideDown("slow");
		$("#basketUpdated").fadeIn(200);
		$(".viewB2").fadeIn(200);
		$(".viewB").fadeIn(200);
		
	
		});
		
	});
    }


	function updateQuantity(site_id){
		 var str = $("#basketf").serialize();
		// alert(str);
		 $.get("ajax_handlers/basket.php?action=Update", str, function updateSmallBasket(){
		 $.get("ajax_handlers/basket.php?action=DisplaySmall",{site_id:site_id},function refreshBasket(content){				
				
				$("#smallBasket").html(content);	
				$("#smallBasket").slideDown("slow");
				$("#basketUpdated").fadeIn(200);
		
	
			updateFullBasket(site_id);
			
		});		
	});
	}


	function addDiscount(site_id){
		 //var str = $("#basketf").serialize();
		// alert(str);

		var cde = $("#disc").val();
		//alert(cde);

		 $.get("ajax_handlers/basket.php?action=AddDiscount", { site_id:site_id, code:cde}, function updateBasket(str){
			
			$("#callbackMessage").html(str);
			updateFullBasket(site_id);		
		});
	}

	function dropItem(itemID, opt1, opt2, opt3, site_id){
		
		 
		 $.get("ajax_handlers/basket.php?action=Drop", {
				 product_id:itemID, 
				 option1:opt1,
				 option2:opt2,
				 option3:opt3,
				  site_id:site_id
			}, function updateSmallBasket(){
		 $.get("ajax_handlers/basket.php?action=DisplaySmall",{site_id:site_id},function refreshBasket(content){
			
			 $("#smallBasket").html(content);	
			 $("#smallBasket").slideDown("slow");
			 $("#basketUpdated").fadeIn(200);
											
			//updateSmallBasket();
			
			updateFullBasket(site_id);
			
		});		
	});
	}

	



	function updateFullBasket(site_id){
		
		$.get("ajax_handlers/basket.php?action=DisplayFull",{site_id:site_id},function refreshBasket(contentFull){				
				 $("#fullBasket").html(contentFull);	
				//$("#fullBasket").html('test');


		})
	}

	function showDelAddress(){
		if ($("#delAdd").is(":hidden")) {
			 $("#delAdd").slideDown("slow");
			
        } else {
              $("#delAdd").slideUp("slow");
        }
	}
	
	$(document).ready(function(){
		Cufon.replace('h1,h2, h3');

		$("#opt2").change(function(){
			
			var optID = $("#opt2").val();
			
			$.get("ajax_handlers/getcolours.php?optID="+optID,{site_id:1, type:'one'},function refreshImages(content){				
					 if (content!=''){
						 $("#pdImginner").html(content);
					 }	
					//$("#fullBasket").html('test');
					var options1 = {
							zoomWidth: 300,
							zoomHeight: 250,
								xOffset: 10,
								yOffset: 0,
								position: "right",
								title: false
					};

					$('.zoom1').jqzoom(options1);


			})

			$.get("ajax_handlers/getcolours.php?optID="+optID,{site_id:1, type:'two'},function refreshImages(content){			
				 if (content!=''){
						 $("#pdImginnerTwo").html(content);
					 }
					
					//$("#fullBasket").html('test');
					var options1 = {
							zoomWidth: 300,
							zoomHeight: 250,
								xOffset: 10,
								yOffset: 0,
								position: "right",
								title: false
					};

					$('.zoom2').jqzoom(options1);


			})

			
		})
	});






