
function GetScreenSize()
{
	var screenSize;
	screenSize = "800x600";
	if (screen.width > 800)
	{
		if (screen.width > 1024)
		{
			if (screen.width > 1280)
			{
				screenSize = "1600x1200";
			}
			else
			{
				screenSize = "1280x1024";
			}
		}
		else
		{
			screenSize = "1024x768";
		}
	}
	return screenSize;
}

function WriteBody(pictureName, extName)
{
	var screenSize = GetScreenSize();
	document.write("<body background=\"" +
		       pictureName + "-" + screenSize + extName + "\">");
}

function ScaleImage(pictureName, extName)
{
	var screenSize = GetScreenSize();
	document.write("<img src=\"" +
		       pictureName + "-" + screenSize + extName + "\">");
}

function WriteCalendar()
{
	//The calendar size will be programmatically calculated to fill 90% of the available screen width and
	//(height - 200 pixels) of the available screen height

	width = screen.width * 0.9;
	height = screen.height - 200;

	//We will aggregate nine calendars (seven for the departments at vienna church, one for school, one for sundown) to make the church calendar.
	//
	//To add a calender:
	//1. Login to google calendar
	//2. Under 'my calendars' left click on the \/ (down arrow) corresponding to the calendar you want to add
	//3. Select 'calendar settings'
	//4. Under 'embed this calendar' select 'Customize the color, size, and other options'
	//5. In the 'Copy and paste the HTML below to include this calendar on your webpage' window select and copy the following:
	//   a. First find and copy the "src=...%40group.calendar.google.com&amp;" string
	//   b. Second find and copy the "color=%........&amp" string
        //   c. Form these two strings together to make a new line at the start of the listed calendars below
	//6. You must edit the list below (for web browsers that support scripts) and the list in
	//   calendar.php file (for web browsers that don't allow scripts).
	//7. Test (clear web browser cache) and reload the page. Use FireFox with no-script add-on to test both
	//   ways to load the calender page.

	document.write("<iframe src=\"http://www.google.com/calendar/embed?showTitle=0&amp;height=600&amp;" + 
	               "wkst=1&amp;bgcolor=%239999FF&amp;" + 

	               //Church Office calendar
	               "src=garrygenser%40gmail.com&amp;color=%23A32929&amp;" + 

	               //Church Life calendar
	               "src=eqb94hgdr8ua44vno3uithkdho%40group.calendar.google.com&amp;color=%235229A3&amp;" + 

	               //Sabbath School calendar
	               "src=19blplts8r3ko5606tde6b2g00%40group.calendar.google.com&amp;color=%230D7813&amp;" +

	               //School calendar
	               "src=f8el1hkvd1fs8fdg5d32ktiljc%40group.calendar.google.com&amp;color=%23528800&amp;" +

	               //Worship calendar
	               "src=tne7u6qkef5qpcrjl9idu8b3a8%40group.calendar.google.com&amp;color=%23AB8B00&amp;" +

	               //Youth Calendar
	               "src=j8e31ndgm4925rlbtkr045jst0%40group.calendar.google.com&amp;color=%23BE6D00&amp;" + 

	               //Pathfinder and Adventurer Calendar
	               "src=7atblvgb7q3vc53jop9n9e199k%40group.calendar.google.com&amp;color=%23B1365F&amp;" + 

	               //Deaf Calendar
	               "src=2jv2l3jt1ngu9rofgj6f9rnun8%40group.calendar.google.com&amp;color=%232952A3\" " + 

	               "style=\" border-width:0 \" width=\"" + width + "\" height=\"" + height + "\" " + 
	               "frameborder=\"0\" scrolling=\"no\"></iframe>");
}

