jQuery(document).ready(function()
	{
	// Background image. Note multiples of 100 to ease load on phpThumb
	function backdrop(blankingFlag)
		{
		var viewportWidth, viewportHeight, imageUrl, image;
		
		if(window.innerWidth != undefined)
			{
			viewportWidth = window.innerWidth;
			viewportHeight = window.innerHeight;
			}
		else if (document.documentElement)
			{
			viewportWidth = document.documentElement.clientWidth;
			viewportHeight = document.documentElement.clientHeight;
			}
		else	
			{
			viewportWidth = null;
			viewportHeight = null;
			}

		if (viewportWidth)
			{
			if (blankingFlag) document.body.style.background = 'white';	// Blank background while waiting for page to load
											// (safeguards against pointlessly loading default background on page load)
			
			imageURL = "../../../../phpThumb/phpThumb.php?src=../assets/images/Backdrops/SkyeAlltDearg.jpg&zc=T&h="+(50 * Math.ceil(viewportHeight/50))+"&w="+(50 * Math.ceil(viewportWidth/50)).toString()+"&fltr[]=brit|96&fltr[]=blur|1&q=55";

			image = new Image();
			image.onload = function ()
				{
				document.body.style.background = "url("+imageURL+") fixed no-repeat top center";
				};

			image.src = imageURL
			}
		}
	
	backdrop(true);
	
	jQuery(window).resize(function () { backdrop(false); } );
	});


