/* Author: 
Royal Slider
*/
//$(function () {
try {
    var mySliderInstance = new RoyalSlider("#mySlider", {
        captionAnimationEnabled: false,           // Set to false if you want to remove all animations from captions  
        captionShowEffects: ["fade", "moveleft"], // Default array of effects: 
        // ["fade" or "" + "moveleft", or "moveright", or "movetop", or "movebottom"]
        captionMoveOffset: 20,                   // Default distance for move effect in px
        captionShowSpeed: 400,                   // Default caption show speed in ms
        captionShowEasing: "easeOutCubic",       // Default caption show easing
        captionShowDelay: 200,                   // Default delay between captions on one slide show

        directionNavAutoHide: true,
        slideTransitionSpeed: 1000,               // Slide transition speed in ms. (1s = 1000ms)
        slideTransitionEasing: "easeInOutSine",  // Easing type for slide transition. View supported easing types
        slideshowEnabled: true,                // Autoslideshow enabled          
        slideshowDelay: 5000,                    // Delay between slides in slideshow
        slideshowPauseOnHover: true,            // Pause slideshow on hover
        slideshowAutoStart: true                // Auto start slideshow 
        /* other options go here, view javascript options to learn more */
    });
} catch (err) { };
//});

$(document).ready(function () {
    resizeSlider();
});
$(window).resize(function () {
    resizeSlider();
});
function resizeSlider() {
    try {
        var index = window.location.pathname.lastIndexOf("/");
        var filename = window.location.pathname.substr(index+1);
        if (filename != "blog.aspx") {

            //Reconfigure Slider to fit browser size appropriately and proportionally to original image sizes (900x450)
            $("#mySlider").height($("#mySlider").width() * 0.5);
            $("#mySlider ul li").css("background-size", $("#mySlider").width());
            $("#mySlider ul li").css("background-position", "top left");
            $(".royalSlide").width($("#mySlider").width());
            mySliderInstance._onResize;

            //resize snippet backgrounds
            //.snippet, .longcontent
            if ($(".snippet").height() < 277) {
                $(".snippet").css("background-size", "auto " + $(".snippet").height() + "px");
            } else {
                $(".snippet").css("background-size", "auto 277px");
            }
            if ($(".longcontent").height() < 277) {
                $(".longcontent").css("background-size", "auto " + $(".longcontent").height() + "px");
            } else {
                $(".longcontent").css("background-size", "auto 277px");
            }
        }
    } catch (err) { };
}











