function LoadGalleries() {
  open('index1.html', '', 'width=' + screen.width + ',height=' + screen.height + ',left=0,top=0,screenX=0,screenY=0,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,copyhistory=no');
  return false;
}  

function CacheImages() {
	while (1) {
		if (getScreenWidth() >= 1024) {
			preloadImage("images/pattern1024left.png");
			preloadImage("images/pattern1024right.png");
			preloadImage("images/mainmenuhomepane1_4_.jpg");
			preloadImage("images/onlinegallery1024img.jpg");
			break;
		}
		else if (getScreenWidth() >= 800) {
			preloadImage("images/pattern800left.png");
			preloadImage("images/pattern800right.png");
			preloadImage("images/mainmenuhomepane1_4_.jpg");
			preloadImage("images/onlinegallery800img.jpg");
			break;	
		}
		
		break;
	}
}


function WritePage() {
		var Menu = new MsMenu;
		var FrameWidth, FrameHeight;
		var BannerWidth, BannerHeight;
		var FlashWidth, FlashHeight;
		var FeatureImage;
		var FeatureImageWidth, FeatureImageHeight;
		var BodyHeight, BottomEdgeHeight;
		var NewsFrameHeight;
		var NewsFrameTopMargin;

		FrameWidth  = getFrameWidth();
		BannerWidth = FrameWidth;
		if (getScreenWidth() >= 1152) {
			FrameHeight         = 690;      // Internet Explorer seems to have a problem getting the frame height;
			
			BannerHeight        = 122;
            FeatureImage        = 'images/onlinegallery1152img.jpg';
			FeatureImageWidth   = 360;
			FeatureImageHeight  = 400;
			FlashWidth          = 670;
			FlashHeight         = 120;
			BottomEdgeHeight    = 100;
		}
		else 
		if (getScreenWidth() >= 1024) {
			FrameHeight         = 585;      // Internet Explorer seems to have a problem getting the frame height;
			
			BannerHeight        = 122;
            FeatureImage        = 'images/onlinegallery1024img.jpg';
			FeatureImageWidth   = 297;
			FeatureImageHeight  = 330;
			FlashWidth          = 670;
			FlashHeight         = 120;
			BottomEdgeHeight    = 60;
		}
		else {
			FrameHeight         = 380;
			
			BannerHeight        = 100;
            FeatureImage        = 'images/onlinegallery800img.jpg';
			FeatureImageWidth   = 198;
			FeatureImageHeight  = 220;
			FlashWidth          = 523;
			FlashHeight         = 94;
			BottomEdgeHeight    = 5;
		}
		BodyHeight          = FrameHeight - BannerHeight - FlashHeight;
		NewsFrameTopMargin  = parseInt(BodyHeight * 0.15);
		NewsFrameHeight     = BodyHeight - NewsFrameTopMargin - BottomEdgeHeight -35;
		
		document.write('<table id="tablebody" width="' + FrameWidth + '" height="' + FrameHeight + '" border="0" cellpadding="0" cellspacing="0">');
		document.write('	<tr>');
		document.write('		<td width="' + FrameWidth + '" height="' + BannerHeight + '">');
		Menu.writeBanner(BannerWidth, BannerHeight);
		document.write('		</td>');
		document.write('	</tr>');
		document.write('	<tr>');
		document.write('		<td height="' + FlashHeight + '">');
		document.write('			<object data="indexflash.swf" width="' + FlashWidth + '" height="' + FlashHeight + '" type="application/x-shockwave-flash">');
		document.write('				<param name="movie" value="indexflash.swf" />');
		document.write('				<param name="FlashVars" value="allowResize=0" />');
		document.write('				Flash Movie With Resizing Content');
		document.write('			</object>');
		document.write('		</td>');
		document.write('	</tr>');
		document.write('	<tr>');
		document.write('		<td>');
		document.write('			<table width="' + FrameWidth + '" height="' + BodyHeight + '" border="0">');
		document.write('				<tr>');
		document.write('					<td width="' + FlashWidth + '" height="' + BodyHeight + '" bgcolor="#ffffff">');
		document.write('						<table width="' + FlashWidth + '" height="' + BodyHeight + '" align="left" border="0" cellpadding="0">');
		document.write('							<tr>');
		document.write('								<td align="center">');
		document.write('									<a href="about:none" class="general" onclick="return LoadGalleries()">Please click here to enter Madison Strand</a></p>');
		document.write('								</td>');
		document.write('							</tr>');
		document.write('							<tr><td width="' + FlashWidth + '" height="' + NewsFrameTopMargin + '" align="center" class="subtitle" style="vertical-align: bottom;">Corporate News</td></tr>');
		document.write('							<tr>');
		document.write('								<td width="' + FlashWidth + '" height="' + NewsFrameHeight + '" align="center">');
		document.write('									<iframe id="newsframe" src="news.php" width="' + (FlashWidth -60) + '" height="' + NewsFrameHeight + '" frameborder="1">');
		document.write('										<p>iFrames are not supported</p>');
		document.write('									</iframe>');
		document.write('								</td>');
		document.write('							</tr>');
		document.write('							<tr>');
		document.write('								<td height="' + BottomEdgeHeight + '">');
		document.write('									<p align="center"><a href="about:none" class="general" onclick="return LoadGalleries()">Please click here to enter Madison Strand</a></p>');
		document.write('								</td>');
		document.write('							</tr>');
		document.write('						</table>');
		document.write('					</td>');
		document.write('					<td width="' + (FrameWidth - FlashWidth -5) + '" height="' + BodyHeight + '" align="right">');
		document.write('						<img id="featureimage" src="' + FeatureImage + '" width="' + FeatureImageWidth + '" height="' + FeatureImageHeight + '">');
		document.write('					</td>');
		document.write('				</tr>');
		document.write('			</table>');
		document.write('		</td>');
		document.write('	</tr>');
		document.write('</table>');

}

