var communityTimer = null;
var bounceComplete = true;

function openLoginWindow(wName){
	features = 'width=800,height=620,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes';
	loginWindow = window.open('',wName,features);
	if(loginWindow.focus){ loginWindow.focus(); }
	return true;
}

function closeFancyWindow(){
	$.fn.fancybox.close();
}

function getCommunityCorner(){

	if(bounceComplete){

		clearTimeout(communityTimer);
		
		$("div#communityCorner").hide("slide", null, "normal", function(){
			bounceComplete = false;													
			$.ajax({
			   type: "POST",
			   url: "/webservice/community_corner.php",
			   cache: false,
			   success: function(msg){
					$("div#communityCorner").html(msg);
					$("div#communityCorner").show("bounce",{ times:3 }, 300, function(){
						communityTimer = setTimeout("getCommunityCorner()", 20000);	
						bounceComplete = true;																					  
					});
			   }
			 });																
		});
	
	}

}

$(document).ready(function(){
	getCommunityCorner();						   
});