﻿//
// (SWH) - this will loop through and find the scroll-window and
// then related scroll-layer and scroll-links to register the control ids
//
function init_dw_Scroll()
{
    var $scrollWindows = $(".scroll-window");

    if ($scrollWindows)
    {
        if ($scrollWindows.length > 0)
        {
            var $scrollLayers = $(".scroll-layer");
            var $scrollLinks = $(".scroll-links");

            for (var x = 0; x < $scrollWindows.length; x++)
            {
                var windo = new dw_scrollObj($scrollWindows[x].id, $scrollLayers[x].id);
                windo.setUpScrollControls($scrollLinks[x].id);
            }
        }
    }
}

// if code supported, link in the style sheet and call the init function onload
if (dw_scrollObj.isSupported())
{
    //dw_writeStyleSheet('css/scroll.css');
    dw_Event.add(window, 'load', init_dw_Scroll);
}

