	// The following code scales all page content to display
	// consistently on any resolution screen.  The goal is to
	// keep the basic page appearance the same across resolution,
	// but to render it at lower resolution (similar size) on
	// monitors with less than 1280 pixels horizontal resolution

	// First we calculate the neccesary scaling factor
	var screenPercentage = ((screen.width * 100) / 1280); // Design is based on 1280 screen
	if(screenPercentage > 100) screenPercentage = 100; // But, we do not want to multiply pixels for larger screens

	var screenMultiplier = screenPercentage / 100; // Design is based on 1280 screen
	
	// Then we calculate the sizes of all screen elements
	// IMAGES
	var photoFrameWidth = 590 * screenMultiplier;
	var MainImageWidth = 584 * screenMultiplier;
	var MainImageHeight = 401 * screenMultiplier;
	var FaceImageWidth = 125 * screenMultiplier;
	var FaceImageHeight = 150 * screenMultiplier;
	var AntiqueImageWidth = 150 * screenMultiplier;
	var AntiqueImageHeight = 200 * screenMultiplier;
	var PansyImageWidth = 400 * screenMultiplier;
	var PansyImageHeight = 525 * screenMultiplier;
	var HeirloomImageWidth = 531 * screenMultiplier;
	var HeirloomImageHeight = 398 * screenMultiplier
	var CulinaryImageWidth = 714 * screenMultiplier;
	var CulinaryImageHeight = 479 * screenMultiplier
	var FullImageWidth = 640 * screenMultiplier;
	var FullImageHeight = 480 * screenMultiplier
	var HalfImageWidth = 320 * screenMultiplier;
	var HalfImageHeight = 240 * screenMultiplier
	var SquareImageWnH = 400 * screenMultiplier;
	var LittleSquareWnH = 250 * screenMultiplier;
	var BorderImageWidth = 63 * screenMultiplier;
	var BorderImageHeight = 53 * screenMultiplier;
	var SmallPortraitWidth = 240 * screenMultiplier;
	var SmallPortraitHeight = 320 * screenMultiplier;
	var ShepherdessWidth = 508 * screenMultiplier;
	var ShepherdessHeight = 297 * screenMultiplier;
	var ViolaWidth = 514 * screenMultiplier;
	var ViolaHeight = 480 * screenMultiplier;
	var DandelionWidth = 322 * screenMultiplier;
	var DandelionHeight = 480 * screenMultiplier;
	var DurerWidth = 726 * screenMultiplier;
	var DurerHeight = 560 * screenMultiplier;
	var PostCardWidth = 769 * screenMultiplier;
	var PostCardHeight = 576 * screenMultiplier;
	var DButtonWidth = 400 * screenMultiplier;
	var DButtonHeight = 60 * screenMultiplier;
	var JackWidth = 263 * screenMultiplier;
	var JackHeight = 153 * screenMultiplier;
	var PatchWidth = 480 * screenMultiplier;
	var PatchHeight = 360 * screenMultiplier;
	var MozartWidth = 229 * screenMultiplier;
	var MozartHeight = 362 * screenMultiplier;
	var FieldEngWidth = 338 * screenMultiplier;
	var FieldEngHeight = 254 * screenMultiplier;
	var OpheliaWidth = 500 * screenMultiplier;
	var OpheliaHeight = 224 * screenMultiplier;
	var NathalieWidth = 540 * screenMultiplier;
	var NathalieHeight = 90 * screenMultiplier;
	var PlantFungiWidth = 160 * screenMultiplier;
	var PlantFungiHeight = 120 * screenMultiplier;
	var SunshineWidth = 540 * screenMultiplier;
	var SunshineHeight = 115 * screenMultiplier;
	var ElkWidth = 400 * screenMultiplier;
	var ElkHeight = 162 * screenMultiplier;
	var AHSWidth = 540 * screenMultiplier;
	var AHSHeight = 162 * screenMultiplier;
	// FONTS
	var avsTitleFontSize = 36 * screenMultiplier;
	var pageTitleFontSize = 24 * screenMultiplier;
	var photoTitleFontSize = 18 * screenMultiplier;
	var photoCreditFontSize = 10 * screenMultiplier;
	var photoTextFontSize = 12 * screenMultiplier;
	var linkListFontSize = 14 * screenMultiplier;
	var TROVLinkFontSize = 16 * screenMultiplier;
	var TROVFontSize = 24 * screenMultiplier;
	var pageTextFontSize = 16 * screenMultiplier;
	var pageTextArialFontSize = 14 * screenMultiplier;
	var microsoftFontSize = 12 * screenMultiplier;
	var getIEFontSize = 12 * screenMultiplier;
	var dividerThickness = 7 * screenMultiplier;
	var PoemWidth = 600 * screenMultiplier;
	
	var BorderLine = "<img src=\"../American_Violet_Society_Images/Border_Viola_rostrata.gif\" width=\"" + BorderImageWidth + "\" height=\"" + BorderImageHeight + "\" border = \"0\">";

	// Next we generate the style sheet rules for the various elements on the page
	
	document.writeln('<style type="text/css">');
	
	// Write style rule for photo frame around window and associated text, used on each page
	document.write('table.photoFrame{width: ' + photoFrameWidth + '}');
 	
	// Write style rule for main image cell, used on each page
	document.write('td.imageCell{border-width: thick; border-color: #339933; border-style: ridge;}');
	
	// Write style rule for main image.
	document.write('img.main{width: ' + MainImageWidth + '; height: ' + MainImageHeight + '}');
	
	// Write style rule for half image.
	document.write('img.half{width: ' + HalfImageWidth + '; height: ' + HalfImageHeight + '}');
	
	// Write style rule for main portrait image.
	document.write('img.mainPortrait{width: ' + MainImageHeight + '; height: ' + MainImageWidth + '}');
	
	// Write style rule for small portrait image.
	document.write('img.smallPortrait{width: ' + SmallPortraitWidth + '; height: ' + SmallPortraitHeight + '}');
	
	// Write style rule for viola image.
	document.write('img.viola{width: ' + ViolaWidth + '; height: ' + ViolaHeight + '}');
	
	// Write style rule for Dandelion image.
	document.write('img.dandelion{width: ' + DandelionWidth + '; height: ' + DandelionHeight + '}');
	
	// Write style rule for Dandelion image.
	document.write('img.durer{width: ' + DurerWidth + '; height: ' + DurerHeight + '}');
	
	// Write style rule for Postcard image.
	document.write('img.postcard{width: ' + PostCardWidth + '; height: ' + PostCardHeight + '}');
	
	// Write style rule for face image.
	document.write('img.face{width: ' + FaceImageWidth + '; height: ' + FaceImageHeight + '}');
	
	// Write style rule for antique image.
	document.write('img.antique{width: ' + AntiqueImageWidth + '; height: ' + AntiqueImageHeight + '}');
	
	// Write style rule for pansy image.
	document.write('img.pansy{width: ' + PansyImageWidth + '; height: ' + PansyImageHeight + '}');
	
	// Write style rule for heirloom images.
	document.write('img.heirloom{width: ' + HeirloomImageWidth + '; height: ' + HeirloomImageHeight + '}');
	
	// Write style rule for culinary images.
	document.write('img.culinary{width: ' + CulinaryImageWidth + '; height: ' + CulinaryImageHeight + '}');
	
	// Write style rule for full size image.
	document.write('img.fullSize{width: ' + FullImageWidth + '; height: ' + FullImageHeight + '}');
	
	// Write style rule for full size image.
	document.write('img.full{width: ' + FullImageWidth + '; height: ' + FullImageHeight + '}');
	
	// Write style rule for main image.
	document.write('img.scaledImage{width: ' + screenPercentage + '%; height: ' + screenPercentage + '%}');
	
	// Write style rule for square image.
	document.write('img.square{width: ' + SquareImageWnH + '; height: ' + SquareImageWnH + '}');
	
	// Write style rule for little square image.
	document.write('img.littleSquare{width: ' + LittleSquareWnH + '; height: ' + LittleSquareWnH + '}');
	
	// Write style rule for shepherdess image.
	document.write('img.shepherdess{width: ' + ShepherdessWidth + '; height: ' + ShepherdessHeight + '}');
	
	// Write style rule for jack image.
	document.write('img.jack{width: ' + JackWidth + '; height: ' + JackHeight + '}');
	
	// Write style rule for patch image.
	document.write('img.patch{width: ' + PatchWidth + '; height: ' + PatchHeight + '}');
	
	// Write style rule for mozart image.
	document.write('img.mozart{width: ' + MozartWidth + '; height: ' + MozartHeight + '}');
	
	// Write style rule for fieldeng image.
	document.write('img.fieldeng{width: ' + FieldEngWidth + '; height: ' + FieldEngHeight + '}');
	
	// Write style rule for ophelia image.
	document.write('img.ophelia{width: ' + OpheliaWidth + '; height: ' + OpheliaHeight + '}');
	
	// Write style rule for nathalie image.
	document.write('img.nathalie{width: ' + NathalieWidth + '; height: ' + NathalieHeight + '}');
	
	// Write style rule for plantfungi image.
	document.write('img.plantfungi{width: ' + PlantFungiWidth + '; height: ' + PlantFungiHeight + '}');
	
	// Write style rule for sunshine image.
	document.write('img.sunshine{width: ' + SunshineWidth + '; height: ' + SunshineHeight + '}');
	
	// Write style rule for elkmountain image.
	document.write('img.elk{width: ' + ElkWidth + '; height: ' + ElkHeight + '}');
	
	// Write style rule for elkmountain image.
	document.write('img.ahs{width: ' + AHSWidth + '; height: ' + AHSHeight + '}');
	
	// Write style rule for border images.
	document.write('img.border{border-width: none; width: ' + BorderImageWidth + '; height: ' + BorderImageHeight + '}');
	
	// Write style rule for DButton image.
	document.write('img.DButton{border-width: none; width: ' + DButtonWidth + '; height: ' + DButtonHeight + '}');
	
	// Write style rule for avs title, used on each page
	document.write('font.avsTitleFont{font-family: Script MT Bold; font-weight: bold; font-size: ' + avsTitleFontSize + 'pt; color: #CC33FF}');
	
	// Write style rule for avs title, used on each page
	document.write('font.gazetteTitleFont{font-family: Harington; font-weight: bold; font-size: ' + avsTitleFontSize + 'pt; color: #CC33FF}');
	
	// Write style rule for page title, used on each page
	document.write('font.pageTitleFont{font-weight: bold; font-size: ' + pageTitleFontSize + 'pt; color: #000000}');
	
	// Write style rule for page title, used on each page
	document.write('font.pageLinkFont{font-family: Script MT Bold; font-weight: bold; font-size: ' + pageTitleFontSize + 'pt; color: #0000FF}');
	
	// Write style rule for photo title A, used on each main page
	document.write('font.photoTitleAFont{font-weight: bold; font-size: ' + photoTitleFontSize + 'pt; color: #000000}');
	
	// Write style rule for photo title A, used on each main page
	document.write('font.LinkBarFont{font-family: Arial; font-weight: bold; font-size: ' + linkListFontSize + 'pt; color: #0000FF}');
	
	// Write style rule for photo title A, used on each main page
	document.write('font.LinkComingFont{font-family: Arial; font-weight: bold; font-size: ' + linkListFontSize + 'pt; color: #FF0000}');
	
	// Write style rule for photo title B, used on each main page
	document.write('font.photoTitleBFont{font-weight: bold; font-size: ' + photoTitleFontSize + 'pt; color: #FF66CC}');
	
	// Write style rule for photo credit, used on each page
	document.write('font.photoCreditFont{font-weight: bold; font-size: ' + photoCreditFontSize + 'pt; color: #000000}');
	
	// Write style rule for photo text, used on each page
	document.write('font.photoTextFont{font-weight: bold; font-size: ' + photoTextFontSize + 'pt; color: #000000}');
	
	// Write style rule for link list cell, used on each page
	document.write('td.linkListCell{width: 20%}');
	
	// Write style rule for link list cell, used on each page
	document.write('td.PoemCell{width: ' + PoemWidth + '}');
	
	// Write style rule for link list, used on each page
	document.write('font.linkListFont{font-weight: bold; font-size: ' + linkListFontSize + 'pt; color: #000000}');
	
	// Write style rule for avs title, used on each page
	document.write('font.TROVFont{font-family: Script MT Bold; weight: bold; font-size: ' + TROVFontSize + 'pt; color: #CC33FF}');
	
	// Write style rule for avs title, used on each page
	document.write('font.TROVLinkFont{font-family: Script MT Bold; weight: bold; font-size: ' + TROVLinkFontSize + 'pt; color: #CC33FF}');
	
	// Write style rule for page text, used on each page
	document.write('font.pageTextFont{font-weight: bold; font-size: ' + pageTextFontSize + 'pt; color: #000000}');
	
	// Write style rule for page text, used on each page
	document.write('font.pageTextArialFont{font-family: Arial; font-size: ' + pageTextArialFontSize + 'pt; color: #000000; line-height: 200%}');
	
	// Write style rule for page text, used on each page
	document.write('font.pageTextHarringtonFont{font-family: Arial; font-size: ' + pageTextArialFontSize + 'pt; color: #000000}');
	
	// Write style rule for microsoft ie text used on each page
	document.write('font.microsoftFont{font-weight: bold; font-size: ' + microsoftFontSize + 'pt; color: #000000}');
	
	// Write style rule for get ie text, used on each page
	document.write('font.getIEFont{font-weight: bold; font-size: ' + getIEFontSize + 'pt; color: #000000}');

	// Write style rule for get ie text, used on each page
	document.write('hr.divider{weight: ' + dividerThickness + '; width: 90%; color: #CC33FF}');

	//dividerThickness
	document.writeln('</style>');

	function sideBorder(count)
	{
		var i = 0;
		
		for(i = 0; i < count; i++)
		{
			document.write(BorderLine + "<br>")
			
		} // for(i = 0; i < count; i++)
	}
	
	function topBotBorder(count)
	{
		var i = 0;
		
		for(i = 0; i < count; i++)
		{
			document.write(BorderLine)
		
		} // for(i = 0; i < count; i++)
	
	}

	function redrawPage()
	{
		//document.reload();
	}

