// --------------------------------------------------------------------------------
// default.js
// --------------------------------------------------------------------------------
// description - output common elements to each page
// --------------------------------------------------------------------------------




// Record the original width and original height 
// and call the reloadPage() function
if ( document.layers )
{
	origWidth - innerWidth;
	origHeight - innerHeight;
	
	onresize = reloadPage();
}




// --------------------------------------------------------------------------------
// function :: writeHeader()
// --------------------------------------------------------------------------------
// This function will check if the original width and height have changed and 
// will force the page to reload to insure all CSS styles are reapplied.
//
// This also acst as a fix for absolute positioning of an element and it not being 
// recalculated if a popup warning is displayed on the browser area.  
// --------------------------------------------------------------------------------
function reloadPage()
{
	if( innerWidth != origWidth || innerHeight != origHeight )
	{
		location.reload();
	}
}


// --------------------------------------------------------------------------------
// function :: writeTop( icon, titleStyle, title)
// --------------------------------------------------------------------------------
// This function will push markup to browser starting after the <body> tag and 
// ending just before the HTML PAGE CONTENT AREA.
//
// icon: graphic file name (including extentsion - i.e. - iconFlower.jpg
// titleStyle: THICK or THIN (pageTitle will not display for the THICK style)
// title: Title of Page - will not display if titleStyle is set to THICK
// --------------------------------------------------------------------------------
function writeTop( icon, titleStyle, title )
{
	writeBaseStart( icon );
	//writeHeader();
	//writeMenu();
	
	//writeTitle( titleStyle );
	
	// Build the title area according to THICK or THIN parameters
	// Carmichael only supports the THICK parameter - all other will be ignored
	//if( titleStyle == "THICK" )
	//{
	//	writeTitleThick();
	//}
		
	writeContentStart();
}


// --------------------------------------------------------------------------------
// function :: writeBottom()
// --------------------------------------------------------------------------------
// This function will push markup to browser starting just after the HTML PAGE
// CONTENT AREA and ending at the </body> tag.
// --------------------------------------------------------------------------------
function writeBottom()
{
	writeContentEnd();
	writeFooter();
	writeBaseEnd();
}


// --------------------------------------------------------------------------------
// function :: writeBaseStart( icon)
// --------------------------------------------------------------------------------
// This function outputs the start of the document.
// The ABSOLUTE POSITIONED css element ICON is defined here.
// icon: graphic file name (including extentsion - i.e. - iconFlower.jpg
// --------------------------------------------------------------------------------
function writeBaseStart( icon )
{
	document.write( "<div id='base'>" );
	document.write( "	<table class='structure'>" );
}


// --------------------------------------------------------------------------------
// function :: writeHeader()
// --------------------------------------------------------------------------------
// This function outputs the header.
// --------------------------------------------------------------------------------
function writeHeader()
{
	document.write( "		<tr valign='top'>" );
	document.write( "			<td width='100%'>" );

	//document.write( "	<div id='icon'><a href='index.html'><img src='images/" + icon + "' border='0' alt=''></a></div>" );
	//document.write( "	<div id='logo'><a href='index.html'><img src='images/logo2.jpg' border='0' alt=''></a></div>" );

	document.write( "				<div id='header'>" );

	//document.write( "					<a href='http://www.carmichaelinn.com/tourCarmichaelInnAndSpa.html'  rel='tour' class='linkHeader'>TOUR&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );	
	//document.write( "					<a href='http://www.carmichaelinn.com/tourVideo.html'                rel='tour' class='linkHeader'>VIDEO&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );		
	//document.write( "					<a href='http://www.carmichaelinn.com/aboutOttawa.html'                         class='linkHeader'>OTTAWA &amp; EVENTS&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );
	//document.write( "					<a href='http://www.carmichaelinn.com/restaurants.html'                         class='linkHeader'>RESTAURANTS&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );
	//document.write( "					<a href='http://www.carmichaelinn.com/faq.html'                                 class='linkHeader'>FAQ&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );
	//document.write( "					<a href='http://www.carmichaelinn.com/links.html'                               class='linkHeader'>LINKS&nbsp;&nbsp;|&nbsp;&nbsp;</a>" );	
	//document.write( "					<a href='http://www.carmichaelinn.com/contacts.html'                            class='linkHeader'>CONTACTS</a>" );
	//document.write( "					613.236.4667<br>" );
	//document.write( "					<a href='mailto:gc@carmichaelinn.com' class='linkFooter'>gc@carmichaelinn.com</a>" );
	
	document.write( "					<br><br><br><br>" );
	document.write( "				</div>" );
	document.write( "			</td>" );
	document.write( "		</tr>" );
}


// --------------------------------------------------------------------------------
// function :: writeMenu()
// --------------------------------------------------------------------------------
// Writes out the menu markup
// --------------------------------------------------------------------------------
function writeMenu()
{
	document.write( "		<tr>" );
	document.write( "			<td width='100%'>" );
	document.write( "				<div class='chromestyle' id='chromemenu'>" );
	document.write( "					<ul>" );
//	document.write( "						<li><a href='http://www.carmichaelinn.com/index.html'>>>> HOME&nbsp;&nbsp;&nbsp;&nbsp;</a></li>" );
//	document.write( "						<li><a href='http://www.carmichaelinn.com/accommodation.html' rel='accommodation'>ACCOMMODATION&nbsp;&nbsp;&nbsp;&nbsp;</a></li>" );
//	document.write( "						<li><a href='http://www.carmichaelinn.com/spa.html' rel='spa'>SPA&nbsp;&nbsp;&nbsp;&nbsp;</a></li>" );
//	document.write( "						<li><a href='https://carmichaelinn.com/giftCertificates.html'>GIFT CERTIFICATES&nbsp;&nbsp;&nbsp;&nbsp;</a></li>" );
	document.write( "					</ul>" );
	document.write( "				</div>" );
//	document.write("				<div id='accommodation' class='dropmenudiv'>");
//	document.write("					<a href='http://www.carmichaelinn.com/accommodationLeisure.html'>Leisure</a>");
//	document.write("					<a href='http://www.carmichaelinn.com/accommodationCorporate.html'>Corporate</a>");
//	document.write("					<a href='http://www.carmichaelinn.com/accommodationCancellationPolicy.html'>Cancellation Policy</a>");
//	document.write("				</div>");		
//	document.write("				<div id='spa' class='dropmenudiv'>");
//	document.write("					<a href='http://www.carmichaelinn.com/spaTreatments.html'>Treatments</a>");
//	document.write("					<a href='http://www.carmichaelinn.com/spaPackages.html'>Packages</a>");
//	document.write("					<a href='http://www.carmichaelinn.com/spaProducts.html'>Products</a>");
//	document.write("					<a href='http://www.carmichaelinn.com/spaCancellationPolicy.html'>Cancellation Policy</a>");
//	document.write("				</div>");		
	document.write("				<script type='text/javascript'>cssdropdown.startchrome('chromemenu')</script>");	
	document.write( "			</td>" );
	document.write( "		</tr>" );
}

// --------------------------------------------------------------------------------
// function :: writeTitleThick()
// --------------------------------------------------------------------------------
// Writes out the title in a THICK style.
// --------------------------------------------------------------------------------
function writeTitle( titleStyle )
{
	document.write( "		<tr>" );
	document.write( "			<td width='100%'>" );
	
	if( titleStyle == "INDEX" )
	{
		//document.write( "			    <div id='banner'><img src='images/banners/index.jpg' border='0' alt=''></div>" );
		document.write( "			    <div id='banner'><br><img src='images/banners/close.jpg' border='0' alt=''></div>" );
	}

	if( titleStyle == "LEISURE" )
	{
		document.write( "			    <div id='banner' align='right'><img src='images/banners/leisure.jpg' border='0' alt=''></div>" );
	}
	
	if( titleStyle == "SPA" )
	{
		document.write( "			    <div id='banner' align='right'><img src='images/banners/spa.jpg' border='0' alt=''></div>" );
	}
	
	if( titleStyle == "INFO" )
	{
		document.write( "			    <div id='banner' align='right'><img src='images/banners/info.jpg' border='0' alt=''></div>" );
	}

	document.write( "			</td>" );
	document.write( "		</tr>" );
}


// --------------------------------------------------------------------------------
// function :: writeContentStart()
// --------------------------------------------------------------------------------
// Writes out the start of the content area.
// --------------------------------------------------------------------------------
function writeContentStart()
{
	document.write( "		<tr>" );
	document.write( "			<td>" );
}


// --------------------------------------------------------------------------------
// function :: writeContentEnd()
// --------------------------------------------------------------------------------
// Writes out the end of the content area.
// --------------------------------------------------------------------------------
function writeContentEnd()
{

	document.write( "			</td>" );
	document.write( "		</tr>" );
}


// --------------------------------------------------------------------------------
// function :: writeFooter()
// --------------------------------------------------------------------------------
// Writes out the footer information.
// --------------------------------------------------------------------------------
function writeFooter()
{
	document.write( "		<tr>" );
	document.write( "			<td width='100%'>" );
	document.write( "				<div id='footer'>" );
	document.write( "					<br>" );
	//document.write( "					<span class='fontNormal'>tel</span>. 613.236.4667&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" );
	//document.write( "					<span class='fontNormal'>toll free</span>. 877.416.2417&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" );
	//document.write( "					<span class='fontNormal'>fax</span>. 613.563.7529&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" );
	//document.write( "					<span class='fontNormal'>email</span>. <a href='mailto:info@carmichaelinn.com' class='linkFooter'>info@carmichaelinn.com</a>" );
	document.write( "				</div>" );
	document.write( "			</td>" );
	document.write( "		</tr>" );
}


// --------------------------------------------------------------------------------
// function :: writeBaseEnd()
// --------------------------------------------------------------------------------
// This function outputs the end of the document.
// --------------------------------------------------------------------------------
function writeBaseEnd()
{
	document.write( "	</table>" );
	document.write( "</div>" );
	
	//document.write( "<div id='subFooter' align='center'>" );
	//document.write( "	&copy; 2006, All rights reserved. Carmichael Inn &amp; Spa<br>" );
	//document.write( "	<a href='http://www.carmichaelinn.com/credits.html' class='linkSubFooter'>credits</a><br><br>" );
	//document.write( "	<a href='http://www.ontariosfinestinns.com/' class='linkNormal' target='_blank'><img src='images/charities/OFI.jpg' border='0' alt=''></a>" );
	//document.write( "	<a href='http://www.cibcrunforthecure.com/' class='linkNormal' target='_blank'><img src='images/charities/RFC.jpg' border='0' alt=''></a>" );
	//document.write( "	<a href='http://www.cbcf.org/' class='linkNormal' target='_blank'><img src='images/charities/CBCF.jpg' border='0' alt=''></a>" );
	//document.write( "</div>" );
}
