		
	//  code to float the table headers and retain it on top the webpage 
   	
        function scrolltableheader() {					
            $("div.floatingheaderdiv").each(function() {
                offset = $(this).offset();
                scrollTop = $(window).scrollTop();           			
                if ((scrollTop > offset.top) && (scrollTop < offset.top + $(this).height())) {
                    $(".scrollingheader", this).css("visibility", "visible");
                    
                    $(".scrollingheader", this).css("top", Math.min(scrollTop - offset.top, $(this).height() - $(".scrollingheader", this).height()) + "px");                    
                }
                else {
                    $(".scrollingheader", this).css("visibility", "hidden");
                    $(".scrollingheader", this).css("top", "0px");
                }                             
            })
        }
        
        $(document).ready(function() {			
			//keep this to maintain the width of the table at all times			
			//$("table.floatingheaderClass").css("width", "850px");
			
			if ($.browser.mozilla) { 
				//alert(document.body.offsetWidth); //900														
				//alert($("tr:first").width()); //459
			};   		 						
            $("table.floatingheaderClass").each(function() {
			
                $(this).wrap("<div class=\"floatingheaderdiv\" style=\"position:relative\"></div>");               
                $("tr:first", this).before($("tr:first", this).clone());
                $("tr").css("width", "100%"); //needed for firefox to keep the header width intact
                clonedHeaderRow = $("tr:first", this)
                clonedHeaderRow.addClass("scrollingheader");                
                clonedHeaderRow.css("position", "absolute");
                clonedHeaderRow.css("top", "0px");
                clonedHeaderRow.css("left", "0px");                
                clonedHeaderRow.css("visibility", "hidden");                
            });
            
            scrolltableheader();
            $(window).scroll(scrolltableheader);
            
                    
        });        
           