// 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

var i = 0;
var working_width = 10;
var BorderImageWidth = 10;
var BorderImageHeight = 10;
var BorderSpaceWidth = 63;
var BorderSpaceHeight = 53;
var mie = false;
var pageX = 0;
var pageW = 0;
var pageY = 0;
var pageH = 0;
var browserPageWidth = 0;
var browserPageHeight = 0;
var screenMultiplier = 1;
var mie = false;
var nsn = false;

// We create two style sheet entry sets.  One for the screen and one for printing, because if the screen
// size is greater than 640, print pages will overflow.  This code will work for IE, but not NN.
// Still looking for a solution for NN.
//alert("check");
//Detect IE
if(document.all)
{
	mie = true;

	for (i = 0; i < 2; i++)
	{
		working_width=(i==1)?screen.width:640;
		document.writeln("<style type=\"text/css\" MEDIA=\""+((i==1)?"screen":"print")+"\">\n");
		do_style_sheet(working_width);
	}
}
// Detect NN4
if(navigator.appName == "Netscape")
{
	nsn = true;
	//alert("NS");
	working_width=screen.width;
	if(window.innerWidth==0) working_width=640; // detect printing context for NN4
	document.writeln('<style type="text/css">\n');
	do_style_sheet(working_width);
}
	
function do_style_sheet(screenWidth)
{
	// First we calculate the neccesary scaling factor
	var screenPercentage = ((screenWidth * 100) / 1280); // Design is based on 1280 screen
	if(screenPercentage > 100) screenPercentage = 100; // But, we do not want to multiply pixels for larger screens

	screenMultiplier = screenPercentage / 100; // Design is based on 1280 screen
	// Then we calculate the sizes of all screen elements

	// TABLE / PICTURE FRAME
	var PictureFrameWidth = Math.floor(20 * screenMultiplier);
	var PoemWidth = Math.floor(600 - ((600 - (600 * screenMultiplier)) / 2));

	// IMAGES
	// Landscape
	BorderImageWidth = Math.floor(63 * screenMultiplier);
	BorderImageHeight = Math.floor(53 * screenMultiplier);
	BorderSpaceWidth = Math.floor(63 * screenMultiplier) + 32; // We add some so as to give proper spacing of border
	BorderSpaceHeight = Math.floor(53 * screenMultiplier) + 27;  // We add some so as to give proper spacing of border
	var ButtonWidth = Math.floor(160 * screenMultiplier);
	var ButtonHeight = Math.floor(120 * screenMultiplier);
	var PlantFungiWidth = Math.floor(160 * screenMultiplier);
	var PlantFungiHeight = Math.floor(120 * screenMultiplier);
	var GopherWidth = Math.floor(240 * screenMultiplier);
	var GopherHeight = Math.floor(180 * screenMultiplier);
	var JackWidth = Math.floor(263 * screenMultiplier);
	var JackHeight = Math.floor(153 * screenMultiplier);
	var HalfImageWidth = Math.floor(320 * screenMultiplier);
	var HalfImageHeight = Math.floor(240 * screenMultiplier);
	var ChopVioWidth = Math.floor(323 * screenMultiplier);
	var ChopVioHeight = Math.floor(224 * screenMultiplier);
	var FlagWidth = Math.floor(337 * screenMultiplier);
	var FlagHeight = Math.floor(193 * screenMultiplier);
	var FieldEngWidth = Math.floor(338 * screenMultiplier);
	var FieldEngHeight = Math.floor(254 * screenMultiplier);
	var MenuImageWidth = Math.floor(360 * screenMultiplier);
	var MenuImageHeight = Math.floor(270 * screenMultiplier);
	var DButtonWidth = Math.floor(400 * screenMultiplier);
	var DButtonHeight = Math.floor(60 * screenMultiplier);
	var ElkWidth = Math.floor(400 * screenMultiplier);
	var ElkHeight = Math.floor(162 * screenMultiplier);
	var PartImageWidth = Math.floor(480 * screenMultiplier);
	var PartImageHeight = Math.floor(360 * screenMultiplier);
	var PatchWidth = Math.floor(480 * screenMultiplier);
	var PatchHeight = Math.floor(360 * screenMultiplier);
	var OpheliaWidth = Math.floor(500 * screenMultiplier);
	var OpheliaHeight = Math.floor(224 * screenMultiplier);
	var ShepherdessWidth = Math.floor(508 * screenMultiplier);
	var ShepherdessHeight = Math.floor(297 * screenMultiplier);
	var ViolaWidth = Math.floor(514 * screenMultiplier);
	var ViolaHeight = Math.floor(480 * screenMultiplier);
	var HeirloomImageWidth = Math.floor(531 * screenMultiplier);
	var HeirloomImageHeight = Math.floor(398 * screenMultiplier);
	var NathalieWidth = Math.floor(540 * screenMultiplier);
	var NathalieHeight = Math.floor(90 * screenMultiplier);
	var SunshineWidth = Math.floor(540 * screenMultiplier);
	var SunshineHeight = Math.floor(115 * screenMultiplier);
	var AHSWidth = Math.floor(540 * screenMultiplier);
	var AHSHeight = Math.floor(162 * screenMultiplier);
	var MainImageWidth = Math.floor(584 * screenMultiplier);
	var MainImageHeight = Math.floor(401 * screenMultiplier);
	var DigitalPhotoWidth = Math.floor(640 * screenMultiplier);
	var DigitalPhotoHeight = Math.floor(423 * screenMultiplier);
	var halfDigitalPhotoWidth = Math.floor(320 * screenMultiplier);
	var halfDigitalPhotoHeight = Math.floor(212 * screenMultiplier);
	var FullImageWidth = Math.floor(640 * screenMultiplier);
	var FullImageHeight = Math.floor(480 * screenMultiplier);
	var CulinaryImageWidth = Math.floor(714 * screenMultiplier);
	var CulinaryImageHeight = Math.floor(479 * screenMultiplier);
	var DurerWidth = Math.floor(726 * screenMultiplier);
	var DurerHeight = Math.floor(560 * screenMultiplier);
	var PostCardWidth = Math.floor(769 * screenMultiplier);
	var PostCardHeight = Math.floor(576 * screenMultiplier);
	var SuperImageWidth = Math.floor(800 * screenMultiplier);
	var SuperImageHeight = Math.floor(600 * screenMultiplier);
	// Portrait
	var FaceImageWidth = Math.floor(125 * screenMultiplier);
	var FaceImageHeight = Math.floor(150 * screenMultiplier);
	var AntiqueImageWidth = Math.floor(150 * screenMultiplier);
	var AntiqueImageHeight = Math.floor(200 * screenMultiplier);
	var MastHeadWidth = Math.floor(200 * screenMultiplier);
	var MastHeadHeight = Math.floor(317 * screenMultiplier);
	var ChopinWidth = Math.floor(207 * screenMultiplier);
	var ChopinHeight = Math.floor(253 * screenMultiplier);
	var MozartWidth = Math.floor(229 * screenMultiplier);
	var MozartHeight = Math.floor(362 * screenMultiplier);
	var SmallPortraitWidth = Math.floor(240 * screenMultiplier);
	var SmallPortraitHeight = Math.floor(320 * screenMultiplier);
	var VictoriaWidth = Math.floor(242 * screenMultiplier);
	var VictoriaHeight = Math.floor(407 * screenMultiplier);
	var SandWidth = Math.floor(245 * screenMultiplier);
	var SandHeight = Math.floor(252 * screenMultiplier);
	var DandelionWidth = Math.floor(322 * screenMultiplier);
	var DandelionHeight = Math.floor(480 * screenMultiplier);
	var PostCardPortWidth = Math.floor(350 * screenMultiplier);
	var PostCardPortHeight = Math.floor(556 * screenMultiplier);
	var PansyImageWidth = Math.floor(400 * screenMultiplier);
	var PansyImageHeight = Math.floor(525 * screenMultiplier);
	var EasterWidth = Math.floor(431 * screenMultiplier);
	var EasterHeight = Math.floor(566 * screenMultiplier);
	var PortraitWidth = Math.floor(480 * screenMultiplier);
	var PortraitHeight = Math.floor(640 * screenMultiplier);
	var PortraitHalfWidth = 240 * screenMultiplier;
	var PortraitHalfHeight = 320 * screenMultiplier;
	var VictorFrameWidth = Math.floor(500 * screenMultiplier);
	var VictorFrameHeight = Math.floor(780 * screenMultiplier);
	// Square
	var LittleSquareWnH = Math.floor(250 * screenMultiplier);
	var photoFrameWidth = Math.floor(590 * screenMultiplier);
	var SquareImageWnH = Math.floor(400 * screenMultiplier);
	

	// PAGE MINIMUM WIDTH
	var pageMinimumWidth = FullImageWidth + 150;

	// FONTS

	var avsTitleFontSize = Math.floor(36 - ((36 - (36 * screenMultiplier)) / 2));
	var buttonTextFontSize = Math.floor(16 - ((16 - (16 * screenMultiplier)) / 2));
	var getIEFontSize = Math.floor(12 - ((12 - (12 * screenMultiplier)) / 2));
	var legendTextFontSize = Math.floor(11 - ((11 - (11 * screenMultiplier)) / 2));
	var legendTitleFontSize = Math.floor(12 - ((12 - (12 * screenMultiplier)) / 2));
//	var linkListFontSize = Math.floor(14 * screenMultiplier);
	var linkListFontSize = Math.floor(14 - ((12 - (12 * screenMultiplier)) / 2));
	var microsoftFontSize = Math.floor(12 - ((12 - (12 * screenMultiplier)) / 2));
//	var pageTextFontSize = Math.floor(16 * screenMultiplier);
	var pageTextFontSize = Math.floor(14 - ((14 - (14 * screenMultiplier)) / 2));
	var pageTextArialFontSize = Math.floor(14 - ((14 - (14 * screenMultiplier)) / 2));
	var introTextArialFontSize = Math.floor(13 - ((13 - (13 * screenMultiplier)) / 2));
	var pageTitleFontSize = Math.floor(24 - ((24 - (24 * screenMultiplier)) / 2));
	var pageTitleFontSizeSmall = Math.floor(20 -((20 - (20 * screenMultiplier)) / 2));
	var photoCreditFontSize = Math.floor(10 - ((10 - (10 * screenMultiplier)) / 2));
	var photoTextFontSize = Math.floor(12 - ((12 - (12 * screenMultiplier)) / 2));
	var photoTitleFontSize = Math.floor(18 - ((18 - (18 * screenMultiplier)) / 2));
	var poetryFontSize = Math.floor(12 * screenMultiplier);
	var SignatureFontSize = Math.floor(36 - ((36 - (36 * screenMultiplier)) / 2));
	var TROVFontSize = Math.floor(24 - ((24 - (24 * screenMultiplier)) / 2));
	var TROVLinkFontSize = Math.floor(17 - ((17 - (17 * screenMultiplier)) / 2));

	var dividerThickness = Math.floor(7 - ((7 - (7 * screenMultiplier)) / 2));

	// TABLE STYLES
	// Write style rule for image backed menus This will have to be modified later to allow different images for various menus.
	// The current configuration is for the "Violet Basket" menu on the home page.
	if(screenWidth < 800)
	{
		MenuImage = "American_Violet_Society_Images/VioletBasket_28.gif";

	}
	else if(screenWidth < 1024)
	{
		MenuImage = "American_Violet_Society_Images/VioletBasket_35.gif";
	}
	else if(screenWidth < 1152)
	{
		MenuImage = "American_Violet_Society_Images/VioletBasket_45.gif";
	}
	else if(screenWidth < 1280)
	{
		MenuImage = "American_Violet_Society_Images/VioletBasket_50.gif";
	}
	else
	{
		MenuImage = "American_Violet_Society_Images/VioletBasket_56.gif";
	}

	if(mie)
	{
		document.write('table.menuFrame{width: ' + MenuImageWidth + '; height: ' + MenuImageHeight + '; border: 0;  background-image: url(' + MenuImage + '); background-image.width: ' + MenuImageWidth + '; background-image.height: ' + MenuImageHeight + ';}\n');
	}
	else
	{
		document.write('table.menuFrame{width: ' + MenuImageWidth + '; height: ' + MenuImageHeight + '; border: 0;}\n');
	}

	// Write style rule for photo frame table, used on each page
	document.write('table.photoFrame{width: ' + photoFrameWidth + '}\n');

	// Write style rule for button image.
	document.write('table.pictureFrame{border: ' + PictureFrameWidth + 'px; border-style: outset; border-color: #909090;}\n');

	// Write style rule for diagram text frame, used with super size drawings
	document.write('table.superTextFrame{width: ' + SuperImageWidth + 'px}\n');

	// Write style rule for page minimum width based on large image flow
	document.write('table.pageMinimumWidth{width: ' + pageMinimumWidth + 'px}\n');

	// TABLE CELL STYLES

 	// Write style rule for main image cell, used on each page
	document.write('td.imageCell{border-width: thick; border-color: #339933; border-style: ridge;}\n');

	// Write style rule for link list cell, used on each page
	document.write('td.linkListCell{width: 20%}\n');

	// Write style rule for link list cell, used on each page
	document.write('td.PoemCell{width: ' + PoemWidth + '}\n');

	// HORIZONTAL LINE STYLES

	// Write style rule for get ie text, used on each page
	document.write('hr.divider{weight: ' + dividerThickness + '; width: 90%; color: #CC33FF}\n');

	//IMAGE STYLES

	// Write style rule for elkmountain image.
	document.write('img.ahs{width: ' + AHSWidth + '; height: ' + AHSHeight + '}\n');

	// Write style rule for antique image.
	document.write('img.antique{width: ' + AntiqueImageWidth + '; height: ' + AntiqueImageHeight + '}\n');

	// Write style rule for border images.
	document.write('img.border{border-width: none; width: ' + BorderImageWidth + '; height: ' + BorderImageHeight + '}\n');

	// Write style rule for button image.
	document.write('img.button{width: ' + ButtonWidth + '; height: ' + ButtonHeight + '}\n');

	// Write style rule for Violet Gazette Masthead image.
	document.write('img.chopin{width: ' + ChopinWidth + '; height: ' + ChopinHeight + '}\n');

	// Write style rule for culinary images.
	document.write('img.culinary{width: ' + CulinaryImageWidth + '; height: ' + CulinaryImageHeight + '}\n');

	// Write style rule for Dandelion image.
	document.write('img.dandelion{width: ' + DandelionWidth + '; height: ' + DandelionHeight + '}\n');

	// Write style rule for DButton image.
	document.write('img.DButton{border-width: none; width: ' + DButtonWidth + '; height: ' + DButtonHeight + '}\n');

	// Write style rule for DButton image.
	document.write('img.DigitalPhoto{border-width: none; width: ' + DigitalPhotoWidth + '; height: ' + DigitalPhotoHeight + '}\n');

	// Write style rule for DButton image.
	document.write('img.portraitDigitalPhoto{border-width: none; width: ' + DigitalPhotoHeight + '; height: ' + DigitalPhotoWidth + '}\n');

	// Write style rule for DButton image.
	document.write('img.halfDigitalPhoto{border-width: none; width: ' + halfDigitalPhotoWidth + '; height: ' + halfDigitalPhotoHeight + '}\n');

	// Write style rule for DButton image.
	document.write('img.halfPortraitDigitalPhoto{border-width: none; width: ' + halfDigitalPhotoHeight + '; height: ' + halfDigitalPhotoWidth + '}\n');

	// Write style rule for Durer image.
	document.write('img.durer{width: ' + DurerWidth + '; height: ' + DurerHeight + '}\n');

	// Write style rule for Easter image.
	document.write('img.easter{width: ' + EasterWidth + '; height: ' + EasterHeight + '}\n');

	// Write style rule for elkmountain image.
	document.write('img.elk{width: ' + ElkWidth + '; height: ' + ElkHeight + '}\n');

	// Write style rule for face image.
	document.write('img.face{width: ' + FaceImageWidth + '; height: ' + FaceImageHeight + '}\n');

	// Write style rule for fieldeng image.
	document.write('img.fieldeng{width: ' + FieldEngWidth + '; height: ' + FieldEngHeight + '}\n');

	// Write style rule for flag image.
	document.write('img.flag{width: ' + FlagWidth + '; height: ' + FlagHeight + '}\n');

	// Write style rule for full size image.
	document.write('img.full{width: ' + FullImageWidth + '; height: ' + FullImageHeight + '}\n');

	// Write style rule for full size image.
	document.write('img.super{width: ' + SuperImageWidth + '; height: ' + SuperImageHeight + '}\n');

	// Write style rule for full size image.
	document.write('img.fullSize{width: ' + FullImageWidth + '; height: ' + FullImageHeight + '}\n');

	// 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}\n');

	// Write style rule for gopher image.
	document.write('img.gopher{width: ' + GopherWidth + '; height: ' + GopherHeight + '}\n');

	// Write style rule for half image.
	document.write('img.half{width: ' + HalfImageWidth + '; height: ' + HalfImageHeight + '}\n');

	// Write style rule for half wide image.
	document.write('img.halfWide{width: ' + HalfImageWidth + '; height: ' + FullImageHeight + '}\n');

	// Write style rule for heirloom images.
	document.write('img.heirloom{width: ' + HeirloomImageWidth + '; height: ' + HeirloomImageHeight + '}\n');

	// Write style rule for jack image.
	document.write('img.jack{width: ' + JackWidth + '; height: ' + JackHeight + '}\n');

	// Write style rule for little square image.
	document.write('img.littleSquare{width: ' + LittleSquareWnH + '; height: ' + LittleSquareWnH + '}\n');

	// Write style rule for main image.
	document.write('img.main{width: ' + MainImageWidth + '; height: ' + MainImageHeight + '}\n');

	// Write style rule for main portrait image.
	document.write('img.mainPortrait{width: ' + MainImageHeight + '; height: ' + MainImageWidth + '}\n');

	// Write style rule for Violet Gazette Masthead image.
	document.write('img.mastHead{width: ' + MastHeadWidth + '; height: ' + MastHeadHeight + '}\n');

	// Write style rule for mozart image.
	document.write('img.mozart{width: ' + MozartWidth + '; height: ' + MozartHeight + '}\n');

	// Write style rule for nathalie image.
	document.write('img.nathalie{width: ' + NathalieWidth + '; height: ' + NathalieHeight + '}\n');

	// Write style rule for ophelia image.
	document.write('img.ophelia{width: ' + OpheliaWidth + '; height: ' + OpheliaHeight + '}\n');

	// Write style rule for pansy images.
	document.write('img.pansy{width: ' + PansyImageWidth + '; height: ' + PansyImageHeight + '}\n');

	// Write style rule for full size image.
	document.write('img.part{width: ' + PartImageWidth + '; height: ' + PartImageHeight + '}\n');

	// Write style rule for patch image.
	document.write('img.patch{width: ' + PatchWidth + '; height: ' + PatchHeight + '}\n');

	// Write style rule for photo credit, used on each page
	document.write('font.photoCreditFont{font-weight: bold; font-size: ' + photoCreditFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo text, used on each page
	document.write('font.photoTextFont{font-weight: bold; font-size: ' + photoTextFontSize + 'pt; color: #000000}\n');

	// 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}\n');

	// 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}\n');

	// Write style rule for plantfungi image.
	document.write('img.plantfungi{width: ' + PlantFungiWidth + '; height: ' + PlantFungiHeight + '}\n');

	// Write style rule for portrait image.
	document.write('img.portrait{width: ' + PortraitWidth + '; height: ' + PortraitHeight + '}\n');

	// Write style rule for portrait image.
	document.write('img.halfPortrait{width: ' + PortraitHalfWidth + '; height: ' + PortraitHalfHeight + '}');
	
	// Write style rule for Postcard image.
	document.write('img.postcard{width: ' + PostCardWidth + '; height: ' + PostCardHeight + '}\n');

	// Write style rule for Postcard image.
	document.write('img.postcardport{width: ' + PostCardPortWidth + '; height: ' + PostCardPortHeight + '}\n');

	// Write style rule for main image.
	document.write('img.scaledImage{width: ' + screenPercentage + '%; height: ' + screenPercentage + '%}\n');

	// Write style rule for Violet Gazette Masthead image.
	document.write('img.sand{width: ' + SandWidth + '; height: ' + SandHeight + '}\n');

	// Write style rule for shepherdess image.
	document.write('img.shepherdess{width: ' + ShepherdessWidth + '; height: ' + ShepherdessHeight + '}\n');

	// Write style rule for small portrait image.
	document.write('img.smallPortrait{width: ' + SmallPortraitWidth + '; height: ' + SmallPortraitHeight + '}\n');

	// Write style rule for square image.
	document.write('img.square{width: ' + SquareImageWnH + '; height: ' + SquareImageWnH + '}\n');

	// Write style rule for sunshine image.
	document.write('img.sunshine{width: ' + SunshineWidth + '; height: ' + SunshineHeight + '}\n');

	// Write style rule for victoria image.
	document.write('img.victoria{width: ' + VictoriaWidth + '; height: ' + VictoriaHeight + '}\n');

	// Write style rule for victoria image.
	document.write('img.victorframe{width: ' + VictorFrameWidth + '; height: ' + VictorFrameHeight + '}\n');

	// Write style rule for viola image.
	document.write('img.viola{width: ' + ViolaWidth + '; height: ' + ViolaHeight + '}\n');

	// Write style rule for Violet Gazette Masthead image.
	document.write('img.violet{width: ' + ChopVioWidth + '; height: ' + ChopVioHeight + '}\n');

	// FONT STYLES

	// 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}\n');

	// Write style rule for Button text, used on each page
	document.write('font.buttonText{font-family: Arial; font-weight: bold; font-size: ' + buttonTextFontSize + 'pt; color: #FFFFFF}\n');

	// 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}\n');

	// Write style rule for get ie text, used on each page
	document.write('font.getIEFont{font-family: Arial; font-weight: bold; font-size: ' + getIEFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo title A, used on each main page
	document.write('font.legendTextFont{font-family: Arial; font-size: ' + legendTextFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo title A, used on each main page
	document.write('font.legendTitleFont{font-family: Arial; font-weight: bold; font-size: ' + legendTitleFontSize + 'pt; color: #0000FF}\n');

	// 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}\n');

	// 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}\n');

	// Write style rule for link list, used on each page
	document.write('font.linkListFont{font-family: Arial; font-weight: bold; font-size: ' + linkListFontSize + 'pt; color: #000000}\n');

	// Write style rule for microsoft ie text used on each page
	document.write('font.microsoftFont{font-family: Arial; font-weight: bold; font-size: ' + microsoftFontSize + 'pt; color: #000000}\n');

	// 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}\n');

	// Write style rule for page title, used on each page
	document.write('font.pageLinkFontSmall{font-family: Script MT Bold; font-weight: bold; font-size: ' + pageTitleFontSizeSmall + 'pt; color: #0000FF}\n');

	// 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: 150%}\n');

	// Write style rule for page text, used on each page
	document.write('font.introTextArialFont{font-family: Arial; font-size: ' + introTextArialFontSize + 'pt; color: #000000; line-height: 150%}\n');

	// Write style rule for page text, used on each page
	document.write('font.pageTextFont{font-family: Arial; font-weight: bold; font-size: ' + pageTextFontSize + 'pt; color: #000000; line-height: 150%}\n');

	// Write style rule for page text, used on each page
	document.write('font.pageTextHarringtonFont{font-family: Arial; font-size: ' + pageTextArialFontSize + 'pt; color: #000000}\n');

	// Write style rule for page title, used on each page
	document.write('font.pageTitleFont{font-family: Arial; font-weight: bold; font-size: ' + pageTitleFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo credit, used on each page
	document.write('font.photoCreditFont{font-family: Arial; font-weight: bold; font-size: ' + photoCreditFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo text, used on each page
	document.write('font.photoTextFont{font-family: Arial; font-weight: bold; font-size: ' + photoTextFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo title A, used on each main page
	document.write('font.photoTitleAFont{font-family: Arial; font-weight: bold; font-size: ' + photoTitleFontSize + 'pt; color: #000000}\n');

	// Write style rule for photo title B, used on each main page
	document.write('font.photoTitleBFont{font-family: Arial; font-weight: bold; font-size: ' + photoTitleFontSize + 'pt; color: #FF66CC}\n');

	// Write style rule for photo title B, used on each main page
	document.write('font.photoTitleBFont{font-family: Arial; font-weight: bold; font-size: ' + photoTitleFontSize + 'pt; color: #FF66CC}\n');

	// Write style rule for poetry text
	document.write('font.poetryFont{font-family: Arial; font-size: ' + poetryFontSize + 'pt; color: #000000}\n');

	// Write style rule for avs title, used on each page
	document.write('font.Signature{font-family: Harlow Solid Italic; weight: bold; font-size: ' + SignatureFontSize + 'pt; color: #000000}\n');

	// 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}\n');

	// 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}\n');

	// LINK RULES

	//document.write('A:link{color:yellow}\n');
	//document.write('A:active{color:yellow}\n');
	//document.write('A:visited{color:orange}\n');

	// Dynamic content Divs
	
	document.write('div.pageBorder{position:relative}; z-index:30\n');
	document.write('div.menuBackground{position:absolute; left:0 top:0;};\n');
	document.write('div.menuSlot{position:relative;};\n');
	document.write('div.page{position:relative; left:0; top:0; z-index:10; width:100%;};\n');
	document.write('div.page_content{position:absolute; left:0; top:0; z-index:20; width:100%;};\n');
	document.write('div.flower{position:absolute; width:100px; height:150px; z-index:15;};\n');
	document.write('div.bug{position:absolute; width:72px; height:51px; z-index:25;};\n');
	document.write('div.featureTitle{position:absolute; z-index:21;};\n');
	document.write('div.featureImage{position:absolute; z-index:30;};\n');
	document.write('div.FeatureText{position:absolute; z-index:21;};\n');
	document.write('div.featureLocator{position:relative;};\n');
	
	document.writeln('</style>\n');

}

	// Border Writing Functions for most pages.
	function redoALLBorders()
	{
		getPageStats();
		// We will recalculate count based on the actual browser rendering of the page
		// The Border Image Height should be passed as an argument, but that would require
		// recoding of all of our html pages, so for now we will assume the height of the
		// image that we currently use which is : BorderImageHeight

		//sideCount = Math.floor(browserPageHeight / BorderImageHeight) - (6 + Math.floor((1 - screenMultiplier) * 28));
		//TopBotCount = Math.floor(browserPageWidth / BorderImageWidth) - (6 + Math.floor((1 - screenMultiplier) * 10));
		sideCount = Math.floor(browserPageHeight / BorderSpaceHeight) - 3;
		TopBotCount = Math.floor(browserPageWidth / BorderSpaceWidth) - 2;
		//window.status = "sideCount = " + sideCount + " and TopBotCount = " + TopBotCount + ".";
		//window.status = "pageHeight = " + browserPageHeight + " and borderSpaceHeight = " + BorderSpaceHeight + ".";
		redoSideBorder(theObject("Left"));
		redoTopBotBorder(theObject("Top"));
		redoTopBotBorder(theObject("Bottom"));
		redoSideBorder(theObject("Right"));

	}
	
	function theObject(id)
	{
		if(mie)
		{
			var identity = eval('document.all.' + id);
		}
		else
		{
			var identity = eval('document.layers["' + id + '"].document');
			//var identity = document.layers[id].document; 
alert("NS" + identitiy);
		}
		return identity;
	}
	
	function redoSideBorder(borderObject)
	{		
		// Re do A Side Border
		var borderString = "<table width=100% heignt=100%>\n";
		var imageString = '<tr><td align="center" valign="middle" height="' + BorderSpaceHeight + 'px">' + BorderImage + '</td></tr>\n';
		
		for(i=0; i<sideCount; i++)
		{
			borderString += imageString;
		}

		borderString += "</table>\n"

		if(mie)
		{
			borderObject.innerHTML = borderString;
		}
		else
		{
			borderObject.write(borderString);
			borderObject.close();
		}
	}
	
	function redoTopBotBorder(borderObject)
	{		
		// Re do A Side Border
		if(mie) // We will skip this for NSN as it presently does not work
		{
			var borderString = "<table width=100%><tr>\n";
			var imageString = '<td align="center" width="' + BorderSpaceWidth + 'px">' + BorderImage + '</td>\n';
		
			for(i=0; i<TopBotCount; i++)
			{
				borderString += imageString;
			}

			borderString += "</tr></table>\n"

			if(mie)
			{
				borderObject.innerHTML = borderString;
			}
			else
			{
				var insideIdentity = borderObject.document;
				insideIdentity.write(borderString);
				insideIdentity.close();
			}
		}
		else
		{
			i = i;
		}
	}
	
	function sideBorder(count, BorderImage, side)
	{
		var i = 0;
		var newCount = count;
		// We have to enclose the top and bottom groups in table cells for Netscape.
		// Otherwise, it stacks them verticaly.  PLUS, the appearance is better, so
		// will do the same for vertical borders.
		var borderString = '<div id="' + side + '"><center><table width="100%" height="100%">\n';
		var imageString = '<tr height=' + BorderSpaceHeight + 'px><td align="center" valign="middle">' + BorderImage + '</td></tr>\n';

		for(i = 0; i < newCount; i++)
		{
			borderString += imageString;

		} // for(i = 0; i < newCount; i++)

		borderString += '</table></center></div>\n'
		document.write(borderString);
	}

	function topBotBorder(count, BorderImage, side)
	{
		var i = 0;
		// We have to enclose the top and bottom groups in table cells for Netscape.
		// Otherwise, it stacks them verticaly.  PLUS, the appearance is better, so
		// will do the same for vertical borders.
		
		if(mie)
		{
			var borderString = '<div id="' + side + '"><center><table width=100%><tr>\n';
		}
		else if(nsn)
		{
			var borderString = '<layer id="' + side + '"><center><table width=100%><tr>\n';
		}
		
		var imageString = '<td align="center" width="' + BorderSpaceWidth + 'px">' + BorderImage + '</td>\n';
		
		for(i=0; i<count; i++)
		{
			borderString += imageString;
		}

		if(mie)
		{
			borderString += '</tr></table></center></div>\n'
		}
		else if(nsn)
		{
			borderString += '</tr></table></center></layer>\n'
		}
		
		document.write(borderString);
	}

	function getPageStats()
	{
		if(mie)
		{
			//pageX=window.document.body.scrollLeft;
			//pageW=window.document.body.offsetWidth;
			pageW=window.document.body.scrollWidth;
			//pageY=window.document.body.scrollTop;
			//pageH=window.document.body.offsetHeight;
			pageH=window.document.body.scrollHeight;
			window.status = "IEpageY = " + pageY + " and pageH = " + pageH + ".";
		}
		else
		{
			pageX=window.pageXOffset;
			pageW=window.innerWidth;
			pageY=window.pageYOffset;
			pageH=window.innerHeight;
			window.status = "NNpageY = " + pageY + " and pageH = " + pageH + ".";
		}

		browserPageWidth = pageX + pageW;
		browserPageHeight = pageY + pageH;
	}

	function repositionDiV(objectName, xposition, yposition)
	{
		var theObject = getObject(objectName)
		theObject.top = yposition;
		theObject.left= xposition;
	}


