function alwaysOnTop(element) {
    setTimeout(function(){
        if($(element).filter(".alwaysOnTop").size() > 0) {
            var yScroll;
        
            if (self.pageYOffset) {
                yScroll = self.pageYOffset;
            } else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
                yScroll = document.documentElement.scrollTop;
            } else if (document.body) {// all other Explorers
                yScroll = document.body.scrollTop;
            }
            
                $(element).css("top",yScroll);
                alwaysOnTop(element);
        }
    },10);
}

jQuery.fn.alwaysOnTop = function(){
    return this.each(function(){
        if($.browser.msie && navigator.appVersion.indexOf("MSIE 6.0") != -1) {
            $(this).remove().appendTo("body").css("position","absolute").css("top",0);
            $(this).addClass("alwaysOnTop");
            alwaysOnTop(this);
        }
        else {
            $(this).css("position","fixed").css("top",0);
        }
    });
};

jQuery.fn.stopAlwaysOnTop = function(){
    return this.each(function(){
        $(this).removeClass("alwaysOnTop");
    });
};
