// path to plugin directory
var PLUGIN_ROOT = "https://www.dw-shop.de/scripts/lwc-slider-plugin/";

// load global stylesheet
var link = jQuery('<link>');
link.attr({
    type: 'text/css',
    rel: 'stylesheet',
    href: PLUGIN_ROOT + 'css/global.css'
});
jQuery('head').append( link );

// load global lwc-slider plugin
jQuery.getScript(PLUGIN_ROOT + 'js/lwc-slider.js', function() {
    jQuery(document).ready(function() {

        // load plugin at startup with custom settings
        jQuery.lwcSlider({
            pluginRoot: PLUGIN_ROOT, // absolute path to plugin root directory
            autoload: false, // autoload first catalog
            tabTextOpen: 'Katalog anzeigen', // text for tab
            tabTextClose: 'Katalog schließen', // text for tab if slider is opened
            closable: true, // tab is closable
            closeTabTextOnly: true, // text only on close tab, by default "close.png" is used
            tabHeight: 15, // tab width
            tabWidth: 120,  // tab height
            width: "80%", // slider width, use px or %
            height: "90%", // slider height, use px or %
            speed: 300, // animation speed
            location: 'top', // slider location
            leftPos: '50%',  // slider position top, only used if location is top or bottom
            topPos: '50%', // slider position left, only used if location is left or right
            fixedPosition: true, // fixed position
            mask: true, // soften background
            maskColor: '#fff' // soften background-color
        });

    });
});

function openWindow(url) {
    document.location.href = url + '-group/detail.jsf'; // open url in current window
}

