 function hiden_w (){
    $("#popup_alll").slideUp("slow");
  }
  
 function hiden_t (){
    document.getElementById('item_added').style.display='none';
  }
 function popup1(){
    $("#popup_alll").slideDown("slow");

    setTimeout("hiden_w()", 6000);
    setTimeout("hiden_t()", 7000);
 }


function doAddProduct(form) {
  var get_string='';
  var fe = form.elements;

  for(var i=0 ; i<fe.length ; i++) {
    if ( fe[i].type=="radio" || fe[i].type=="checkbox" ) {
      if ( fe[i].checked ) get_string = get_string+'&'+fe[i].name+'='+fe[i].value;
    } else {
      get_string = get_string+'&'+fe[i].name+'='+fe[i].value;
    }
  }

 document.body.style.cursor = 'wait';
 if (request_in_progress == false) {
   request_in_progress = true;
   $.getJSON('ajax_shopping_cart.php?action=add_product'+get_string, {}, alertContentsShoppingCart);
 }
}


function alertContentsShoppingCart(json) {
  if (json.sc_num != '') {
    $('#divShoppingCartNum').html(json.sc_num);
  }
  if (json.product_added_popup != '') {
    self.scrollTo(0,0);
    $('#popup_alll').html(json.product_added_popup + shopping_cart_popup_footer);
    popup1();
  }
  if (json.sc_popup != '') {
    $('#popup_all_prod').html(json.sc_popup + shopping_cart_popup_footer);
  }
  document.getElementById('item_added').style.display='';
  document.body.style.cursor = 'default';
  request_in_progress = false;
}