function background_switcher() 
{

	// browser checking
	var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;	
	var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
	var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
	
	// visitor's screen dimensions
	var screenHeight = screen.height;
	var screenWidth = screen.width;
	
	var newUrl;
	
	if(isChrome || isSafari) // user is browsing with chrome or safari:
	{	
		// find the url of our page background
		var pageBackground = $("body").css('background-image');
		
		// grab the extension of our background image
		var imgTypePos = pageBackground.indexOf('jpg');
		var imgType = pageBackground.substring(imgTypePos, 78);
		
		// grab the folder that our images reside in
		var imgBase = pageBackground.substring(62, 72); // .../images/bg/
		
		// grab the filename of our background image
		pageBackground = pageBackground.substring(72, 74);
		
		if(screenWidth > 1440 && screenHeight > 900) 
		{	
			newUrl = imgBase + 'large/' + pageBackground + '.' + imgType;
			$('body').attr('style', 'background: url("http://www.palmettoamateur.com/wp-content/themes/palmetto/' + newUrl + '") no-repeat !important;');
		}
		else 
		{
			newUrl = imgBase + 'small/' + pageBackground + '.' + imgType;
			$('body').attr('style', 'background: url("http://www.palmettoamateur.com/wp-content/themes/palmetto/' + newUrl + '") no-repeat !important;');
		}
	}
	else // user is browsing with firefox, opera or internet explorer:
	{
		// find the url of our page background
		var pageBackground = $("body").css('background-image');
		
		// grab the extension of our background image
		var imgTypePos = pageBackground.indexOf('jpg');
		var imgType = pageBackground.substring(imgTypePos, 79);
		
		// grab the folder that our images reside in
		var imgBase = pageBackground.substring(63, 73); // .../images/bg/
		
		// grab the filename of our background image
		pageBackground = pageBackground.substring(73, 75);
		
		if(screenWidth > 1440 && screenHeight > 900) 
		{	
			newUrl = imgBase + 'large/' + pageBackground + '.' + imgType;
			$('body').attr('style', 'background: url("http://www.palmettoamateur.com/wp-content/themes/palmetto/' + newUrl + '") no-repeat !important;');
		}
		else 
		{
			newUrl = imgBase + 'small/' + pageBackground + '.' + imgType;
			$('body').attr('style', 'background: url("http://www.palmettoamateur.com/wp-content/themes/palmetto/' + newUrl + '") no-repeat !important;');
		}
	}
	
}

function expander() 
{
	var x = "false";
	var y = "false";
	
	$('.entry-content h1').click(function() {
		if(x == "false") 
		{
			$(".entry-content").addClass("scroll");
			$(".entry-content").animate({
				height: "400px"
			}, { duration: "slow" });
			x = "true";
		} 
		else 
		{
			$(".entry-content").removeClass("scroll");
			$(".entry-content").animate({
				height: "20px"
			}, { duration: "slow" });
			x = "false";
		}
	});
	$('h1.leaderboard').click(function() {
		if(y == "false") 
		{
			$('#scoreboard').animate({
				height: "15px"
			}, { duration: "slow" });
			y = "true";
		} 
		
		else 
		{
			$('#scoreboard').animate({
				height: "235px"
			}, { duration: "slow" });
			y = "false";
	 	}
	});
}
