/*
*  This js file adds teh stat description header when stats are being used
*/

$(function () {

	var qs = new Querystring();

	var stat_type = qs.get('var_stat_type', false);
	
	var position = $('#botNav').position();
	
	
		
	var theText = false;
	
	switch (stat_type) {
	
		case 'most':
				
				theText = 'Hottest Videos';
			
			break;
			
		case 'recent':
		
				theText = 'Newest Videos';
		
			break;
			
		case 'rated':
			
			   theText = 'Top Rated Videos';
			
			break;
				
	}
	
	if (theText) {
			
			
			var theWidth = $('#botNav').width() + 2;		
			
			var offset = 5;
			
			if ($('#rowBottom').is('*')) {

				offset = -12;
			}
			
			$('#wrapper').append('<div id="statHeader">'+theText+'</div>');
			
			var leftPos = Math.round(position.left);
			
			var topPos = Math.round(position.top + offset);
			
			$('#statHeader').css({width:theWidth, left:leftPos , top:topPos }).fadeIn(2000);
			
	
	}else{
		
		$('#statHeader').fadeOut('slow', function () { $(this).remove(); });
	
	}
	
	
});
