// JavaScript Document

var curdate = new Date();
var mday = curdate.getDate();

/* Max number of images that can be loaded is 20.*/
function movedate(day)
{
	if(day > 20)
	{return day = day - 20;}
	else{return day;}
}

/*Sets the background image based on the day of the month and the screen resolution.*/
function setBackground()
{
	 bg = movedate(mday);
	
  if (document.body)
  {if((screen.width >= 1600) && (screen.height >= 900))
		{
			
				var myimage = "background-images/1680X1050/image" + bg + ".jpg";	
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";
			
		}
	else if((screen.width >= 1440) && (screen.height >= 768))
		{
			
				var myimage = "background-images/1440X900/image" + bg + ".jpg";
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";

		}
			

	else if((screen.width >= 1360) && (screen.height >= 768))
		{
			
				var myimage = "background-images/1360X768/image" + bg + ".jpg";
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";
		}
	else if((screen.width >= 1280) && (screen.height >= 1024))
		{
		
				var myimage = "background-images/1280X1024/image" + bg + ".jpg";
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";
		}
	else if((screen.width >= 1280) && (screen.height >= 768))
		{
		
				var myimage = "background-images/1680X1050/image" + bg + ".jpg";
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";
			
		}
	else
		{
		
				var myimage = "background-images/1680X1050/image" + bg + ".jpg";
				document.body.style.background = "url(" + myimage + ")";
				document.body.style.backgroundRepeat = "no-repeat";
		}
	
  }
}

