//<![CDATA[
$(window).load(function(){
    jQuery(function($) {
        $.fn.scrollBgVert = function() {
            var self = $(this),
            mount = arguments[0].mount,
            initCss = {
                'bottom': 'auto',
                'top': 'auto'
            };

            // Calculation for offset from top
            var doCalc = function(self, w) {
                return -(($(self).height() - w) * $(window).scrollTop() / ($(document).height() - w));
            };

            // Function to re-calc bg position
            var func = function() {
                self.each(function() {
                    var w = $(window).height(),
                    go = w < $(this).height(),
                    offSet = (go ? doCalc(this, w) : 'auto');

                    $(this).css('top', offSet);
                });
            };

            // Lets be sure these are only executed onload
            $(function() {
                // Reset position
                self.each(function() {
                    $(this).css(initCss);
                });

                // bind the re-calc function to the required events
                $(window).bind('scroll resize', func);
            });

            // Top or default bottom set to 0
            initCss[mount] = 0;
        };
        $('#background').scrollBgVert({
        mount: 'bottom'
        });
    });
});
jQuery.noConflict();
//]]>
