
 var shopping_cart = 
{   
    sc : 'add_to_shopping_cart',  
    productId : null,
    qty : 0,
    
    setItem : function(_productId)
    {
        this.productId = _productId
    },
    
    setQty : function (_qty)
    {
        this.qty = _qty;
        this.addItem();
    },
    
    position : function(obj, productId)
    {
        this.setItem(productId);
       $(this.sc).style.display = "none";
       $(this.sc).style.top = findPosY(obj)+"px";
       $(this.sc).style.left = findPosX(obj)+"px";
       $(this.sc).style.display = "block";
       return false;
    },
    
    addItem : function ()
    {
           var params = "f=addItem&productId="+this.productId+"&qty="+this.qty;
            new Ajax.Request("/modul/webshop/shopping_cart/ajax.php",{
            method: 'post',
            parameters: params,
            onComplete: function(transport)
                {
                   // $(this.sc).style.display = "none";
                    //alert("OK!");
                    $('add_to_shopping_cart').style.display = "none";
                    $('shopping_cart_bar').innerHTML = transport.responseText;
                    new Effect.Highlight($('shopping_cart_bar'),{startcolor: '#c30000',endcolor: '#ffffff'});
      
                }
            });
    }   
}



