// Painter Outpost Site Object
// version 1.00.002 -- 6 May 2008


// browser Platform class constructor

function Platform( )
	{
	var 	agent 	= navigator.userAgent.toLowerCase( ); // convert to lower case and substitute var for ease of typing

	this.win		= agent.indexOf('win') != -1;
	this.mac		= agent.indexOf('mac') != -1;
	this.unix		= agent.indexOf('linux') != -1 || agent.indexOf('x11') != -1;

	this.major	= parseInt(navigator.appVersion);
	this.minor	= parseFloat(navigator.appVersion);

	this.nn		= agent.indexOf('mozilla') != -1 && agent.indexOf('spoofer') == -1 && 
				  agent.indexOf('compatible') == -1 && agent.indexOf('opera') == -1 && 
				  agent.indexOf('webtv') == -1 && agent.indexOf('hotjava') == -1 && 
				  agent.indexOf('konqueror') == -1 && agent.indexOf('safari') == -1 &&
				  agent.indexOf('firefox') == -1;
	this.nn2		= this.nn && this.major == 2;
	this.nn3		= this.nn && this.major == 3;
	this.nn4		= this.nn && this.major == 4;
	this.nn4up	= this.nn && this.major >= 4;
	this.nn47	= this.nn && this.minor == 4.7;
	this.nn6		= this.nn && this.major == 5;
	this.nn6up	= this.nn && this.major >= 5;
	this.gecko	= agent.indexOf('gecko') != -1;

	this.oo		= agent.indexOf('opera') != -1;
	this.kk		= agent.indexOf('konqueror') != -1;
	this.as		= agent.indexOf('safari') != -1;
	this.ff		= agent.indexOf('firefox') != -1;

	this.msie				= agent.indexOf('msie') != -1 && agent.indexOf('opera') == -1;
	this.msieWin			= this.msie && this.win
	this.msie3Win		= this.msieWin && this.major < 4;
	this.msie4Win		= this.msieWin && this.major == 4 && agent.indexOf('msie 4') != -1;
	this.msie4upWin		= this.msieWin && this.major >= 4;
	this.msie5Win		= this.msieWin && this.major == 4 && agent.indexOf('msie 5.0') != -1;
	this.msie5upWin		= this.msieWin && !this.msie4 && !this.msie3;
	this.msie55Win		= this.msieWin && this.major == 4 && agent.indexOf('msie 5.5') != -1;
	this.msie55upWin	= this.msieWin && !this.msie5 && !this.msie4 && !this.msie3;
	this.msie6Win		= this.msieWin && this.major == 4 && agent.indexOf('msie 6.0') != -1;
	this.msie6upWin		= this.msieWin && !this.msie55 && !this.msie5 && !this.msie4 && !this.msie3;

	this.msieMac			= this.msie && this.mac
	this.msie5Mac		= this.msieMac && agent.indexOf('msie 5.0') != -1;
	this.msie5plusMac	= this.msieMac && agent.indexOf('msie 5.') != -1 && !this.msie5Mac;

// contemporary - DOM1, JavaScript 1.5, JScript 5.5 (5.0), ECMAScript 3.0, CSS1, some CSS2
	this.contemp	= document.getElementById != null;  
	};


// create browser platform object
var	p = new Platform( );


// browser Page class constructor
function Page( )
	{
	var	meta	= document.getElementsByTagName('meta');
	for ( var i = 0; i < meta.length; i++)
		{
		if ( meta[i].name )
			{
			if (meta[i].name == 'Page')
				this.pageName = meta[i].content
			else if (meta[i].name == 'Version')
				{
				this.versionId	= meta[i].content.slice(0,8);
				this.versionDate	= meta[i].content.slice(12);
				};
			};
		};
	this.releaseId		=  this.versionId.slice(0,4);
	};

// create web page object
var wp = new Page( );



// browser Site class constructor
function Site( )
	{
	this.HeadingLevel1			=	
		'<h1>Painter Outpost:&nbsp; RV Park / Campground / Cabins</h1>';
	this.OutdatedBrowserNotice	=	
		'<p>Your browser is out of date.  All layout and styling is disabled.  This site is much more interesting and informative with a modern browser.</p>';
	this.NavigationMenu			=
		'<div id="navmenu">		<ul>		<li class="home" title="Go to Home Page"><a type="text/html" href="index.html">home</a></li>		<li class="maps" title="Go to Maps &amp; Photos Page"><a type="text/html" href="Maps.html">maps+photos</a></li>		<li class="lodging" title="Go to RV/Campground/Cabins Page"><a type="text/html" href="Lodging.html">lodging</a></li>		<li class="food" title="Go to Restaurant/C-Store Page"><a type="text/html" href="Food.html">food</a></li>		<li class="stores" title="Go to C-Store/Gift-Shop Page"><a type="text/html" href="Stores.html">stores</a></li>		<li class="todo" title="Go to Things-To-Do-In-The-Area  Page"><a type="text/html" href="ToDo.html">to&nbsp;do</a></li>		<li class="news" title="Go to Area News Page"><a type="text/html" href="News.html">news</a></li>		<li class="contactinfo" title="Go to Contact-Info/Reservations/About-Us Page"><a type="text/html" href="ContactInfo.html">contact&nbsp;info</a></li>		</ul>	</div>';
	this.Footer					=
		'<div id="footer">	<div id="copyright">	&copy; 2006-09 &nbsp;Painter Outpost, LLC	&nbsp; All Rights Reserved &mdash; Release ' + wp.releaseId + ' &mdash; Page last modified:&nbsp; ' + wp.versionDate + '	</div>	<div id="disclaimertermsofuse">	<span class="disclaimerhover"></span>	(see <a class="disclaimerhover" onclick="d.popUpDisclaimer(); return false;" href="Disclaimer.html">full disclaimer</a>	 &mdash; <a onclick="t.popUpTermsOfUse(); return false;" href="TermsOfUse.html">terms of use</a>)		<div id="disclaimerlayer">		<h4>Disclaimer</h4>		<p></p>		<p></p>		</div>	</div></div>';
	};


// setCenteringCorrection() method				correction for MSIE 5.5 & 5.0:Win & MSIE 5.0:Mac
Site.prototype.setCenteringCorrection = function( )  
										// correct for centering body margins (auto doesn't work)
	{
	// re-assigned if needed; only used by MSIE 5.5 & 5.0:Win & MSIE 5.0:Mac	
	};

// writeStyleSheets() method		
Site.prototype.writeStyleSheets = function( page )  
	{
	if (p.contemp)	// if contemporary platform, load presentation directives & corrections
					// contemporary - DOM1, JavaScript 1.5, JScript 5.5 (5.0), CSS1, some CSS2
					// otherwise present content with just semantic organizational markup
		{
		document.write('<link rel="stylesheet" type="text/css" media="screen,print" href="' + page + '.css" />');
		if (p.msie)		// if Microsoft browser, apply corrective directives
			{
			if (p.msieWin)		// if Microsoft Windows browser, apply corrective directives
				{
				if (p.msie6Win)	// if browser is MSIE 6.0 apply corrections
					{
					document.write('<link rel="stylesheet" type="text/css" media="screen,print" href="' + page + 'MSIE6Win.css" />');
					}
				else if (p.msie55Win || p.msie5Win)	// if browser is MSIE 5.5 or 5.0 apply corrections
					{
					document.write('<script type="text/javascript" src="CenterMSIE5Win.js"><\/script>');
					document.write('<link rel="stylesheet" type="text/css" media="screen,print" href="' + page + 'MSIE5Win.css" />');
					document.write('<link rel="stylesheet" type="text/css" media="print" href="MSIE5WinPrint.css" />');
					};
				}
			else if (p.msieMac)		// if Microsoft Macintosh browser, apply corrective directives
				{
				if (p.msie5plusMac)	// if browser is MSIE 5.2,5.1 on Mac apply corrections
					{
					document.write('<script type="text/javascript" src="CenterMSIE5plusMac.js"><\/script>');
					document.write('<link rel="stylesheet" type="text/css" media="screen,print" href="' + page + 'MSIE5plusMac.css" />');
					document.write('<link rel="stylesheet" type="text/css" media="print" href="MSIE5plusMacPrint.css" />');
					}
				else if (p.msie5Mac)		// if browser is MSIE 5.0 on Mac apply corrections
					{
					document.write('<script type="text/javascript" src="CenterMSIE5Mac.js"><\/script>');
					document.write('<link rel="stylesheet" type="text/css" media="screen,print" href="' + page + 'MSIE5Mac.css" />');
					document.write('<link rel="stylesheet" type="text/css" media="print" href="MSIE5MacPrint.css" />');
					};
				};
			}
		else if (p.ff)		// if browser is FireFox 1.0.2 apply corrections
			{
			}
		else if (p.as)		// if browser is Apple Safari 2.0 apply corrections
			{
			}
		else if (p.nn6up)	// if browser is Netscape 8.2 apply corrections
			{
			}
		else if (p.oo)		// if browser is Opera 8.5 apply corrections
			{
			}
		else if (p.kk)		// if browser is KDE Konqueror 3.4.2 apply corrections
			{
			};
		};
	};

// writeHeadingLevel1() method		
Site.prototype.writeHeadingLevel1 = function(  )  
	{
	document.write(this.HeadingLevel1);
	};

// writeOutdatedBrowserNotice() method		
Site.prototype.writeOutdatedBrowserNotice = function(  )  
	{
	if (!p.contemp)		// Notify that browser is out of date if scripting is on.
		{	
		document.write(this.OutdatedBrowserNotice);
		};
	};

// writeNavigationMenu() method		
Site.prototype.writeNavigationMenu = function(  )  
	{
	document.write(this.NavigationMenu);
	};

// writeFooter() method		
Site.prototype.writeFooter = function(  )  
	{
	document.write(this.Footer);
	};


// create browser platform object
var s = new Site( );
s.writeStyleSheets(wp.pageName);