$(document).ready(function()
{
	// ========================================
	// HANDLE SMALL GRID RECENT ROLLOVER
	// ========================================
	$('.recent_item').mouseover(function()
	{
		$(this).find('.recent_mini_img_lg').css({'display':'block'});  // lrg image
	});
	
	$('.recent_item').mouseout(function()
	{
		$(this).find('.recent_mini_img_lg').css({'display':'none'});  // lrg image
	});
	
	
	//  init popup countdown
	setTimeout('delayedPopup()', 1500);
});


var z_ind = 10;
function loadPhotoName(a_name, a_id)
{
	var item = $(a_id)[0];
	item.style.zIndex = ++z_ind;
	var _left = item.offsetLeft + item.offsetWidth;

	$('#wn_recent_activity_static').html("<p class='recent_rollover'>" + a_name + "</p>");

	
	if(_left < 415)
	{
		_left += 40;
		$('#wn_recent_activity_static > p').css({'textAlign':'left'});
	}
	else
	{
		var column = parseInt(a_id.substr(6));
		if(column % 10 == 0)
		{
			$(a_id).find('.recent_mini_img_lg').css({'left':'-38px'});
			_left -= 942;
		}
		else
		{
			_left -= 905;
		}
		
		$('#wn_recent_activity_static > p').css({'textAlign':'right'});
	}

	$('#wn_recent_activity_static').css({'left':_left + 'px'});
}

function removePhotoName()
{
	$('#wn_recent_activity_static').css({'left':0 + 'px'});
	$('#wn_recent_activity_static').html("<img id='wn_recent_activity_static_img' src='/assets/img/wn/wn_recent_activity.gif' width='120' height='26' alt='Warrior Nation Recent Activity' />");
}


function delayedPopup()
{
	//popup :-(
	var cook = $.cookie('warrior_nation_about');
	if(cook != 'shown')
	{
		$.cookie('warrior_nation_about', 'shown', { expires: 60 });
		$('#base_sign_up').click();
	}
}
