/*
function showChatBox(){
	$('#chatBox').animate({top:$(window).scrollTop() }, "slow");
	$('#chatBox').fadeTo("slow", 1);
}

$(document).ready(function(){
	$("#chatBox").css("opacity","0");
	
	setTimeout ("showChatBox()", 10000); //10 secs
	
	$(window).scroll(function(){
		$('#chatBox').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 0});
	});
	
});
*/

var GblTop;
 
function GetVertOffset (srchStr){
    GblTop = $(srchStr).offset().top - parseFloat($(srchStr).css('marginTop').replace(/auto/, 0));
}
 
$(document).ready(function (){
 
    GetVertOffset ('#chatBox');     //-- Sets GblTop
 
    $(window).scroll (function (){
		
        // what is the y position of the scroll?
        var y = $(window).scrollTop();
        // whether that's below the start of article?
        if (y >= GblTop){
            // if so, add the fixed class
            $('#chatBox').addClass('fixed');
        }
        else{
            // otherwise, remove it
            $('#chatBox').removeClass('fixed');
        }
    });
 
});



