function alwaysOnTop(element) {
    setTimeout(function(){
        if(jQuery(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;
            }
            
                jQuery(element).css("top",yScroll);
                alwaysOnTop(element);
        }
    },10);
}

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

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

