

//BASKET POPUP
$(document).ready(function () {
    $('a.jqAddBasket').each(function () {
        var currTimeout;
        var url = $(this).attr('href');
        var ind = url.lastIndexOf('/');
        var id = url.substring(ind + 1);
        $(this).colorbox({
            iframe: true,
            href: globalSiteUrl + '/basketPopup.aspx/' + id,
            initialWidth: '436px',
            initialHeight: '263px',
            innerWidth: '336px',
            innerHeight: '163px',
            onLoad: function () { $('body').addClass('hideCBoxClose'); },
            onOpen: function () { currTimeout = window.setTimeout(closeCurrentColorbox, 3000); },
            onClosed: function () { clearTimeout(currTimeout); }
        });
    });
});

function closeCurrentColorbox() {
    $.fn.colorbox.close();
}


//EMAIL TO FRIEND ETC
$(document).ready(function() {
    $('a.jqBoxMeNews').each(function() {
        $(this).colorbox({
            iframe: true,
            initialWidth: '436px',
            initialHeight: '40px',
            innerWidth:'336px',
            innerHeight: '250px',
            onLoad: function () { $('body').addClass('hideCBoxClose'); }
        });
    });


    $('a.jqBoxMe').each(function () {
        $(this).colorbox({
            iframe: true,
            initialWidth: '436px',
            initialHeight: '350px',
            innerWidth: '336px',
            innerHeight: '300px',
            onLoad: function () { $('body').addClass('hideCBoxClose'); }
        });
    });

    $('a.jqBoxMeNews').each(function () {
        $(this).colorbox({
            iframe: true,
            initialWidth: '436px',
            initialHeight: '350px',
            innerWidth: '336px',
            innerHeight: '250px',
            onLoad: function () { $('body').addClass('hideCBoxClose'); }
        });
    });

    $('a.jqBoxMeLong').each(function () {
        $(this).colorbox({
            iframe: true,
            initialWidth: '436px',
            initialHeight: '500px',
            innerWidth: '336px',
            innerHeight: '400px',
            onLoad: function () { $('body').addClass('hideCBoxClose'); }
        });
    });
});

