(function($) {
    $(document).ready(function() {
        var scrollers = $('a[rel*=scroller]');
        scrollers.each(function() {
            var obj = $(this);
            var options = {};
            options.width = obj.attr("width");
            options.height = obj.attr("height");
            options.scrollMode = obj.attr("mode");
            options.direction = obj.attr("direction");
            options.orientation = obj.attr("orientation");
            options.speed = 11 - parseInt(obj.attr("speed"));

            if (obj.attr("background") != undefined)
                options.background = obj.attr("background");
            
            if (obj.attr("bordersize") != undefined)    
                options.borderSize = obj.attr("bordersize");
               
            if (obj.attr("bordercolor") != undefined)
                options.borderColor = obj.attr("bordercolor");
                
            if (obj.attr("watermark") != undefined)
                options.watermark = obj.attr("watermark");

            var pages = decodeURI(obj.attr("href")).split("|");
            obj.scroll(options, pages, 'GetScrollerContent.aspx');
            
            // -- For local testing -- 
//            obj.scroll(options, pages, 'http://localhost/YourWebPro.WebUI/MemberArea/GetScrollerContent.aspx');
        });
    });
})(jQuery);
