//---------------------------------------------------------------------------------------------------
// close modal window begin
//---------------------------------------------------------------------------------------------------
function CloseModalWindow()
    {
    $('.ModalWindowContainer').hide();
    $('.ModalWindowContent').hide();
    $('.ModalWindowMask').hide();
    }
//---------------------------------------------------------------------------------------------------
// close modal window end
//---------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------
// zeige neues fenster mit den produkten begin
//---------------------------------------------------------------------------------------------------
function ShowModalWindow(data, width, top)
    {
    var layer_content = $('.ModalWindowContent');
    
    if((width != '') && (width > 100))
        {
        var margin_left = (width / 2);
        var cssObj = {'width' : width + 'px', 'margin-left' : '-' + margin_left + 'px'};
        layer_content.css(cssObj);
        }
    
    if((top != '') && (top > 0))
        {
        var cssObj = {'top' : top + 'px'};
        layer_content.css(cssObj);
        }
    
    layer_content.empty();
    layer_content.append(data);
    
    $('.ModalWindowContainer').show();
    
    $('.ModalWindowMask').fadeIn(500);      
    $('.ModalWindowMask').fadeTo(500, 0.9, function(){ $('.ModalWindowContent').show(); });
    }
//---------------------------------------------------------------------------------------------------
// zeige neues fenster mit den produkten end
//---------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------
// lege in cart aus dem listing bereich begin
//---------------------------------------------------------------------------------------------------
function AddInCart(products_id)
    {
    var siteurl = global_path + 'AjaxAddInCart.php';
    
    $.ajax({
        type: 'POST',
        url: siteurl,
        data: 'products_id='+products_id+'&action=process',
        error: function(e){ alert('Diese Funktion steht zur Zeit nicht zur Verfuegung!');},
        success: function(html)
            {
            // zum logging in der FireBug console
            //console.log(html);
            if(html.length > 0)
                {
                window.location.assign(html);
                }
            }
        });
    }
//---------------------------------------------------------------------------------------------------
// lege in cart aus dem listing bereich end
//---------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------
// zeige layer begin
//---------------------------------------------------------------------------------------------------
function ShowAddProductLayer(products_id)
    {
    var siteurl = global_path + 'AjaxShowAddProductLayer.php';
    
    $.ajax({
        type: 'POST',
        url: siteurl,
        //dataType: 'json',
        data: 'products_id='+products_id+'&action=process',
        error: function(e){ alert('Diese Funktion steht zur Zeit nicht zur Verfuegung!');},
        success: function(html)
            {
            // zum logging in der FireBug console
            //console.log(html);
            ShowModalWindow(html, 400, 100);
            }
        }); 
    }
//---------------------------------------------------------------------------------------------------
// zeige layer end
//---------------------------------------------------------------------------------------------------

