﻿function MM_swapImgRestore() { //v3.0
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}
function MM_preloadImages() { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
    }
}

function MM_findObj(n, d) { //v4.01
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}
function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}

jQuery(function ($) {
  
    $.supersized({

        slideshow: 1, 	//Slideshow on/off
        autoplay: 1, 	//Slideshow starts playing automatically
        start_slide: 0, 	//Start slide (0 is random)
        random: 1, 	//Randomize slide order (Ignores start slide)
        slide_interval: 9000, //Length between transitions
        transition: 1, 		//0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
        transition_speed: 3000, //Speed of transition
        new_window: 1, 	//Image links open in new window/tab
        pause_hover: 0, 	//Pause slideshow on hover
        keyboard_nav: 1, 	//Keyboard navigation on/off
        performance: 1, 	//0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
        image_protect: 1, 	//Disables image dragging and right click with Javascript
        image_path: 'images/', //Default image path



        vertical_center: 1, 	//Vertically center background
        horizontal_center: 1, 	//Horizontally center background
        min_width: 1400, //Min width allowed (in pixels)
        min_height: 700, //Min height allowed (in pixels)
        fit_portrait: 1, 	//Portrait images will not exceed browser height
        fit_landscape: 0, 	//Landscape images will not exceed browser width
        image_protect: 1, 	//Disables image dragging and right click with Javascript
        slides: [ 		//Background image
												  		{image: '/images/bg1.jpg' },
												  		{ image: '/images/bg2.jpg' },
                                                        { image: '/images/bg3.jpg' },
												  		{ image: '/images/bg4.jpg' }
												]
    });
});
