	// 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
	// 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.

	var i = 0;
	var working_width = 10;
	var mie = true;

	//Detect IE
	if(document.all)
	{
		for (i = 0; i < 2; i++)
		{
			working_width=(i==1)?screen.width:640;
			document.writeln('<style type="text/css" MEDIA="'+((i==1)?'screen':'print')+'">');
			do_style_sheet(working_width);
		}
		mie = true;
	}
	// Detect NN4
	if(document.layers)
	{
		working_width=screen.width;
		if(window.innerWidth==0) working_width=640; // detect printing context for NN4
		document.writeln('<style type="text/css">');
		do_style_sheet(working_width);
		mie = false;
		//alert("NSNSNS");
	}
	
function do_style_sheet(screenWidth)
{
	//screenWidth = 800; // This is for testing layout at various screen resolutions  (Normaly commented out)
	// 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

	var screenMultiplier = screenPercentage / 100; // Design is based on 1280 screen
	// Then we calculate the sizes of all screen elements

	//IMAGE STYLES

	var BannerImageWidth = Math.floor(800 * screenMultiplier);
	var BannerImageHeight = Math.floor(175 * screenMultiplier);
	var Banner4ImageWidth = Math.floor(640 * screenMultiplier);
	var Banner4ImageHeight = Math.floor(140 * screenMultiplier);
	var ButtonImageWidth = Math.floor(160 * screenMultiplier);
	var ButtonImageHeight = Math.floor(120 * screenMultiplier);
	var Center4ImageWidth = Math.floor(320 * screenMultiplier);
	var Center4ImageHeight = Math.floor(240 * screenMultiplier);
	var Center5ImageWidth = Math.floor(480 * screenMultiplier);
	var Center5ImageHeight = Math.floor(360 * screenMultiplier);
	var Center6ImageWidth = Math.floor(640 * screenMultiplier);
	var Center6ImageHeight = Math.floor(480 * screenMultiplier);
	var FullVidImageWidth = Math.floor(640 * screenMultiplier);
	var FullVidImageHeight = Math.floor(480 * screenMultiplier);
	var HalfVidImageWidth = Math.floor(320 * screenMultiplier);
	var HalfVidImageHeight = Math.floor(240 * screenMultiplier);
	var QuartVidImageWidth = Math.floor(160 * screenMultiplier);
	var QuartVidImageHeight = Math.floor(120 * screenMultiplier);
	//var FullDCamImageWidth = Math.floor(726 * screenMultiplier);
	//var FullDCamImageHeight = Math.floor(480 * screenMultiplier);
	var FullDCamImageWidth = Math.floor(896 * screenMultiplier);
	var FullDCamImageHeight = Math.floor(592 * screenMultiplier);
	var HalfDCamImageWidth = Math.floor(363 * screenMultiplier);
	var HalfDCamImageHeight = Math.floor(240 * screenMultiplier);
	var QuartDCamImageWidth = Math.floor(160 * screenMultiplier);
	var QuartDCamImageHeight = Math.floor(120 * screenMultiplier);
	var MapImageWidth = Math.floor(825 * screenMultiplier);
	var MapNormImageHeight = Math.floor(483 * screenMultiplier);
	var MapTallImageHeight = Math.floor(634 * screenMultiplier);
	var RouteImageWidth = Math.floor(675 * screenMultiplier);
	var RouteImageHeight = Math.floor(450 * screenMultiplier);
	var BigFishImageWidth = Math.floor(811 * screenMultiplier);
	var BigFishImageHeight = Math.floor(84 * screenMultiplier);
	var LittleFishImageWidth = Math.floor(532 * screenMultiplier);
	var LittleFishImageHeight = Math.floor(66 * screenMultiplier);
	var MyFaceImageWidth = Math.floor(380 * screenMultiplier);
	var MyFaceImageHeight = Math.floor(451 * screenMultiplier);

	// Write style rule for Site Banner images.
	document.write('img.banner{width: ' + BannerImageWidth + '; height: ' + BannerImageHeight + '; border: 0}');
	document.write('img.banner4{width: ' + Banner4ImageWidth + '; height: ' + Banner4ImageHeight + '; border: 0}');

	// Write style rules for map imags.
	document.write('img.mapNorm{width: ' + MapImageWidth + '; height: ' + MapNormImageHeight + '; border: 0}');
	document.write('img.mapTall{width: ' + MapImageWidth + '; height: ' + MapTallImageHeight + '; border: 0}');
	document.write('img.mapRoute{width: ' + RouteImageWidth + '; height: ' + RouteImageHeight + '; border: 0}');

	// Write style rule for Home and Hub Page Center Images.
	document.write('img.center4{width: ' + Center4ImageWidth + '; height: ' + Center4ImageHeight + '; border: 0}');
	document.write('img.center5{width: ' + Center5ImageWidth + '; height: ' + Center5ImageHeight + '; border: 0}');
	document.write('img.center6{width: ' + Center6ImageWidth + '; height: ' + Center6ImageHeight + '; border: 0}');

	// Write style rule for ImageButton images on all pages.
	document.write('img.button{width: ' + ButtonImageWidth + '; height: ' + ButtonImageHeight + '; border: 0}');

	// Write style rule for full, half and quarter size captured video images.
	document.write('img.fullVid{width: ' + FullVidImageWidth + '; height: ' + FullVidImageHeight + '; border: 0}');
	document.write('img.halfVid{width: ' + HalfVidImageWidth + '; height: ' + HalfVidImageHeight + '; border: 0}');
	document.write('img.quartVid{width: ' + QuartVidImageWidth + '; height: ' + QuartVidImageHeight + '; border: 0}');
	// And for full and half size portrait oriented captured video images
	document.write('img.portFullVid{width: ' + FullVidImageHeight + '; height: ' + FullVidImageWidth + '; border: 0}');
	document.write('img.portHalfVid{width: ' + HalfVidImageHeight + '; height: ' + HalfVidImageWidth + '; border: 0}');

	// Write style rule for full, half and quarter size Digital Camera images.
	document.write('img.fullDCam{width: ' + FullDCamImageWidth + '; height: ' + FullDCamImageHeight + '; border: 0}');
	document.write('img.halfDCam{width: ' + HalfDCamImageWidth + '; height: ' + HalfDCamImageHeight + '; border: 0}');
	document.write('img.quartDCam{width: ' + QuartDCamImageWidth + '; height: ' + QuartDCamImageHeight + '; border: 0}');
	// And for full and half size portrait oriented Digital Camera images
	document.write('img.portFullDCam{width: ' + FullDCamImageHeight + '; height: ' + FullDCamImageWidth + '; border: 0}');
	document.write('img.portHalfDCam{width: ' + HalfDCamImageHeight + '; height: ' + HalfDCamImageWidth + '; border: 0}');

	// And for Big and Little Fish animated GIF images
	document.write('img.bigFish{width: ' + BigFishImageWidth + '; height: ' + BigFishImageHeight + '; border: 0}');
	document.write('img.littleFish{width: ' + LittleFishImageWidth + '; height: ' + LittleFishImageHeight + '; border: 0}');

	// And for My Portrait
	document.write('img.myFace{width: ' + MyFaceImageWidth + '; height: ' + MyFaceImageHeight + '; border: 0}');

	// Table and Cell STYLES Folow Image sizes
	document.write('table.buttonTable( width: 0 border: 0)');
	document.write('cell.banner(width: ' + BannerImageWidth + '; height: ' + BannerImageHeight + '; border: 0)');
	document.write('cell.banner4(width: ' + Banner4ImageWidth + '; height: ' + Banner4ImageHeight + '; border: 0)');
	document.write('cell.mapNorm(width: ' + MapImageWidth + '; height: ' + MapNormImageHeight + '; border: 0)');
	document.write('cell.mapTall(width: ' + MapImageWidth + '; height: ' + MapTallImageHeight + '; border: 0)');
	document.write('cell.center4(width: ' + Center4ImageWidth + '; height: ' + Center4ImageHeight + '; border: 0)');
	document.write('cell.center5(width: ' + Center5ImageWidth + '; height: ' + Center5ImageHeight + '; border: 0)');
	document.write('cell.center6(width: ' + Center6ImageWidth + '; height: ' + Center6ImageHeight + '; border: 0)');
	document.write('cell.button(width: ' + ButtonImageWidth + '; height: ' + ButtonImageHeight + '; border: 0)');
	document.write('cell.halfVid{width: ' + HalfVidImageWidth + ';border: 0}');
	document.write('cell.quartVid{width: ' + QuartVidImageWidth + ';border: 0}');

	// FONT STYLES

	var Base24FontSize = Math.floor(24 - ((24 - (24 * screenMultiplier)) / 2));
	var Base20FontSize = Math.floor(20 - ((20 - (20 * screenMultiplier)) / 2));
	var Base18FontSize = Math.floor(18 - ((18 - (18 * screenMultiplier)) / 2));
	var Base16FontSize = Math.floor(16 - ((16 - (16 * screenMultiplier)) / 2));
	var Base14FontSize = Math.floor(14 - ((14 - (14 * screenMultiplier)) / 2));
	var Base12FontSize = Math.floor(12 - ((12 - (12 * screenMultiplier)) / 2));
	var Base08FontSize = Math.floor(8 - ((8 - (8 * screenMultiplier)) / 2));
	var Base07FontSize = Math.floor(7 - ((7 - (7 * screenMultiplier)) / 2));
	
	var Abs10FontSize = 10;
    // Write style rule for Various text styles, used on each page
	document.write('font.title{font-family: Arial; font-size: ' + Base24FontSize + 'pt; color: #FFFF00}');
	document.write('font.pageTitle{font-family: Arial; font-size: ' + Base24FontSize + 'pt; color: #FFFF00}');
	document.write('font.subTitle{font-family: Arial; font-weight: bold; font-size: ' + Base18FontSize + 'pt; color: #FFFF00}');
	document.write('font.buttonInfo{font-family: Century; font-weight: bold; font-size: ' + Base07FontSize + 'pt; color: #FFFF00}');
	document.write('font.mainContent{font-family: Arial; font-size: ' + Base18FontSize + 'pt; color: #FFFFFF}');
	document.write('font.menuLegend{font-family: Arial; font-weight: bold; font-size: ' + Base14FontSize + 'pt; color: #FFFFFF}');
	document.write('font.imageLegend{font-family: Arial; font-weight: bold; font-size: ' + Base12FontSize + 'pt; color: #FFFFFF}');
	document.write('font.address{font-family: Arial; font-weight: bold; font-size: ' + Base12FontSize + 'pt; color: #FFFF00}');
	document.write('font.getMicrosoft{font-family: Arial; font-weight: bold; font-size: ' + Abs10FontSize + 'pt; color: #FFFF00}');

	document.writeln('</style>');
}
