﻿
function init_dw_Scroll() {
    var wndo = new dw_scrollObj('wn', 'lyr1');
    wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
    wndo.setUpScrollControls('scrollbar');
}

// if code supported, link in the style sheet and call the init function onload
if (dw_scrollObj.isSupported()) {
    //dw_writeStyleSheet('/Themes/scrollbar_demo.css')
    dw_Event.add(window, 'load', init_dw_Scroll);
}
jQuery(document).ready(function() {
    var height = 0;

    if (jQuery(window).height() > jQuery("#mainPage").height()) {
        height = jQuery(window).height() - jQuery("#mainPage").height();
        jQuery("#mainPage").css('margin-top', parseFloat((height - 2) / 2).toFixed(0) + 'px');
        jQuery("#mainPage").css('margin-bottom', parseFloat((height - 2) / 2).toFixed(0) + 'px');
    }
    if (jQuery.cookie('cookieShow') == '1') {
        jQuery.cookie('cookieShow', '1');
        jQuery(".showI").css("display", "none");
        jQuery(".next").css("display", "none");
        jQuery(".previous").css("display", "block");
        jQuery(".showII").css("display", "block");
    }
    if (jQuery.cookie('cookieShow') == '2' || jQuery.cookie('cookieShow') == null) {
        jQuery(".showII").css("display", "none");
        jQuery(".previous").css("display", "none");
        jQuery(".next").css("display", "block");
        jQuery(".showI").css("display", "block");
    }
    jQuery(".next").click(function() {
        jQuery.cookie('cookieShow', '1');
        jQuery(".showI").css("display", "none");
        jQuery(".next").css("display", "none");
        jQuery(".previous").css("display", "block");
        jQuery(".showII").css("display", "block");
    });
    jQuery(".previous").click(function() {
        jQuery.cookie('cookieShow', '2');
        jQuery(".showII").css("display", "none");
        jQuery(".previous").css("display", "none");
        jQuery(".next").css("display", "block");
        jQuery(".showI").css("display", "block");
    });
    jQuery('#slider').s3Slider({
        timeOut: 3000
    });
});
