		///****************************ABOUT SHOPPING CART*****************************************/
		//Add data to Shopping Cart
			box_toggle = 0;	
		$(document).ready(function(){
			CartSize = $(".shopping-box").height()*-1;
			$(".shopping-box").css('margin-top',CartSize);
		})	
		
			
		function addtoCart(ic){
			
		 //setTimeout(function(){	
		   animateCart(0,1);
		    Pathimg= $("#waitingpath").val();
		
		     $(".shop-box-detail").html('<img src="'+Pathimg+'ajax-loader.gif"> Now processing'); 	
		   setTimeout(function(){	
 
			ajaxPath = $("#ajaxpath").val();	
			Pids = "p_id"+ic;
			Pid = $("#"+Pids).val();
			QtyGroupKy = "qtygroup"+Pid;
			Qtygroup = $("#"+QtyGroupKy).val();
			if(Qtygroup != null){
			$.get(ajaxPath+"ajax_addtocart.php",{prid:Pid,qtygrp:Qtygroup,keyitem:'',step:'step1'},
				 function(stdata){  
				  animateCart(0,0);
					  //alert("An item is in your shopping cart now")
					  data= stdata.split("#");
					 $(".shop-box-detail").html(data[0]);  
					CartSize = $(".shopping-box").height()*-1;
					$(".shopping-box").css('margin-top',CartSize); 
					$("#amount_prod").html(data[1])
						$("#imgcheckout").css('visibility','visible')
				});
			}else{
				alert('Sorry! this product not allow.\n Please change  new product');
			}
		},100);
		}
		
		function addTocartLyst(Qtygroup,Pid){
			animateCart(0,1);
		    Pathimg= $("#waitingpath").val();
		     $(".shop-box-detail").html('<img src="'+Pathimg+'ajax-loader.gif"> Now processing'); 	
			  setTimeout(function(){	
			ajaxPath = $("#ajaxpath").val();	
			if(Qtygroup != null){		
			$.get(ajaxPath+"ajax_addtocart.php",{prid:Pid,qtygrp:Qtygroup,keyitem:'',step:'step1'},
				 function(stdata){  
				 	animateCart(0,0);
					data = stdata.split('#');
					  //alert("An item is in your shopping cart now")
					 $(".shop-box-detail").html(data[0]);  
					CartSize = $(".shopping-box").height()*-1;
					$(".shopping-box").css('margin-top',CartSize); 
					$("#amount_prod").html(data[1])
					$("#imgcheckout").css('visibility','visible')
				});
			}else{
				alert('Sorry! this product not allow.\n Please change  new product');
			}
			
			  },100);
		}

		
		
		function ChangeItem(kyitem,pid){
			ajaxPath = $("#ajaxpath").val();	
			stepcart = $("#cartstep").val();	
			itemid = "qtygroup"+kyitem;
			Qtygrp = $("#"+itemid).val();
			$.get(ajaxPath+"ajax_addtocart.php",{prid:pid,qtygrp:Qtygrp,keyitem:kyitem,step:stepcart},
			 function(strdata){
				 	 data = strdata.split("#");
					 $(".shop-box-detail").html(data[0]); 
					 $("#amount_prod").html(data[1])
					 $("#imgcheckout").css('visibility','visible')
					 if(stepcart=="step3"){CalCulateshipping();}
			});
		}
		function removeItem(items){
			stepcart = $("#cartstep").val();	
			ajaxPath = $("#ajaxpath").val();	
			
			if(confirm("Confirm remove this item?.")==true){
				$.get(ajaxPath+"ajax_removecartitem.php",{keyitem:items,step:stepcart},
				 function(strdata){
					  data = strdata.split("#");
						 $(".shop-box-detail").html(data[0]); 
						  $("#amount_prod").html(data[1])
						  if(data[1]==0){
						  	$("#imgcheckout").css('visibility','hidden')
						  }
						  
						  if(stepcart=="step3"){CalCulateshipping();}
				});
			}
		}
		function animateCart(x,y){
		if(x==""){
			 x = $("#shpcart").val();
		}else{
			x = x
		}
			CartSize = $(".shopping-box").height();
			$("#footer").css('z-index','998')
			box_toggle =x;
			//$("#header").css('z-index','998')
			if(box_toggle == 0)	{
				 Next= CartSize-100
				$(".shopping-box").animate({ marginTop:0+'px'});
				box_toggle = 1;
				blockheight= ($('.container_16').height()+20)*1;
				$(".white_content").css('display','block');
				$("#fade").css('display','block')
				$("#fade").css('height',blockheight);	
				if(y==0){
					$("#shpcart").val(1);
				}
				
			}else{
				Next = -1*CartSize;
				$(".shopping-box").animate({ marginTop:Next+'px'},function(){
				$(".white_content").css('display','none');
				$("#fade").css('display','none')
				});
				box_toggle = 0;
				if(y==0){
				$("#shpcart").val(0);
				}
			}

		
		}
			
	///**************************** END ABOUT SHOPPING CART*****************************************/
