<!--

//PRELOAD
var b_view_home = new Image();
var b_view_home_over = new Image();
b_view_home.src = 'images/b_view_home.gif';
b_view_home_over.src = 'images/b_view_home_over.gif';

var b_specials = new Image();
var b_specials_over = new Image();
b_specials.src = 'images/b_specials.gif';
b_specials_over.src = 'images/b_specials_over.gif';

var b_brochure = new Image();
var b_brochure_over = new Image();
b_brochure.src = 'images/b_brochure.gif';
b_brochure_over.src = 'images/b_brochure_over.gif';

//FLASH SNIFF
var useFlash = false;

if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
// Check for Flash version 5 or greater in Netscape
var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
//alert(plugin);
//alert(parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)));
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=5)
	useFlash = true;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	// Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
	useFlash = true;
}

//BROWSER SNIFF
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isDHTML = (isIE5 || isIE6 || isNS6);
var isPc = navigator.userAgent.indexOf("Windows") != -1;
var isMac = !isPc;

var obj = null;

if(!isDHTML) {
	document.location.replace('oldbrowser.htm');
}


//FUNCTIONS

function swap(name,state) {
    if(document.images) {
        document.images[name].src = eval(name + state + ".src");
    }
}


function getFlash(flash,width,height,bgcolor) {
	var html = '';
	if(useFlash) {
		html = html + '<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=' + width + ' HEIGHT=' + height + '>';
		html = html + '<PARAM NAME=movie VALUE=\"' + flash + '\"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#' + bgcolor + '>';
		html = html + '<EMBED src=\"' + flash + '\" quality=high bgcolor=#' + bgcolor + ' WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">';
		html = html + '</EMBED></OBJECT>';
	} else {
		if (flash=='intro2.swf') { //index page
			html = html + '<map name=\"header_home_noflash\"><area shape=\"RECT\" coords=\"4,58,4,58\"><area alt=\"Home\" coords=\"0,58,289,117\" href=\"index.htm\"><area alt=\"Reservations/Availability\" coords=\"507,33,760,0\" href=\"checkavail.htm\"><area alt=\"About the Inn\" coords=\"289,94,397,117\" href=\"about.htm\"><area alt=\"Rooms\" coords=\"397,94,456,117\" href=\"rooms.htm\"><area alt=\"Breakfast\" coords=\"456,94,534,117\" href=\"breakfast.htm\"><area alt=\"Activities\" coords=\"534,94,605,117\" href=\"activities.htm\"><area alt=\"Directions\" coords=\"605,94,689,117\" href=\"directions.htm\"><area alt=\"Contact\" coords=\"689,94,760,117\" href=\"contact.htm\"></map><img src=\"images/header_home_noflash.jpg\" width=\"760\" height=\"236\" border=\"0\" usemap=\"#header_home_noflash\"><br>';
		} else { //interior page
			html = html + '<map name=\"header_noflash\"><area shape=\"RECT\" coords=\"4,58,4,58\"><area alt=\"Home\" coords=\"0,58,289,117\" href=\"index.htm\"><area alt=\"Reservations/Availability\" coords=\"507,33,760,0\" href=\"checkavail.htm\"><area alt=\"About the Inn\" coords=\"289,94,397,117\" href=\"about.htm\"><area alt=\"Rooms\" coords=\"397,94,456,117\" href=\"rooms.htm\"><area alt=\"Breakfast\" coords=\"456,94,534,117\" href=\"breakfast.htm\"><area alt=\"Activities\" coords=\"534,94,605,117\" href=\"activities.htm\"><area alt=\"Directions\" coords=\"605,94,689,117\" href=\"directions.htm\"><area alt=\"Contact\" coords=\"689,94,760,117\" href=\"contact.htm\"><area alt=\"Gift Certificates\" coords=\"644,128,760,148\" href=\"javascript:giftcert();\"></map><img src=\"images/header_noflash.jpg\" alt=\"\" width=\"760\" height=\"171\" border=\"0\" usemap=\"#header_noflash\"><br>';
		}
	}
	return html;
}

function getStyles() {
    if (isPc) {
    	return "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">";
    } else {
    	return "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles_mac.css\">";
    }
}

function popup(location) {
	var dx=500;
	var dy=480;

	var w = window.open(location, 'popup', 'width=' + dx + ',height=' + dy + ',status=no,resizable=no,menubar=yes,location=no,scrollbars=no,toolbar=no');
	w.focus();
}

function popVirt() {
	var dx=570;
	var dy=500;

	var w = window.open('http://www.VisualTour.com/showvt.asp?t=271191', 'popVirt', 'width=' + dx + ',height=' + dy + ',status=no,resizable=no,menubar=yes,location=no,scrollbars=no,toolbar=no');
	w.focus();
}

function policies() {
	var dx=540;
	var dy=460;

	var w = window.open('policies.htm', 'policies', 'width=' + dx + ',height=' + dy + ',status=no,resizable=no,menubar=yes,location=no,scrollbars=yes,toolbar=yes');
	w.focus();
}

function giftcert() {
	var dx=540;
	var dy=300;

	var w = window.open('giftcert.htm', 'giftcert', 'width=' + dx + ',height=' + dy + ',status=no,resizable=no,menubar=yes,location=no,scrollbars=yes,toolbar=yes');
	w.focus();
}

function checkAvail() {
	opener.location = 'checkavail.htm';
	opener.focus();
}

function slideShow(numPics,thisPic,room) {
	while (thisPic <= 0) { thisPic = thisPic + numPics; }
	while (thisPic > numPics) { thisPic = thisPic - numPics; }

	var newVis;
	var obj = null;

    if (isNS6 || isIE4 || isIE5){
        var hidden = 'hidden';
        var visible = 'visible';
    } else if (document.layers){
        var hidden = 'hide';
        var visible = 'show';
    }

    newVis = visible;
	if (isIE4){
		obj = eval('document.all.pic' + thisPic + '.style');
        obj.visibility = newVis;
	} else if (isIE5){
        obj = eval('document.all.pic' + thisPic);
		obj.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=1)";
		obj.filters[0].Apply();
        obj.style.visibility = newVis;
		obj.filters[0].Play();
    } else if (isNS6){
        obj = document.getElementById('pic' + thisPic);
        obj.style.visibility = newVis;
    }

    newVis = hidden;
	for (i = 1; i <= numPics; i++) {
		if (i != thisPic) {
			var obj = null;
			if (isIE4){
				obj = eval('document.all.pic' + i + '.style');
				obj.visibility = newVis;
			} else if (isIE5){
				obj = eval('document.all.pic' + i);
				obj.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=1)";
				obj.filters[0].Apply();
        		obj.style.visibility = newVis;
				obj.filters[0].Play();
			} else if (isNS6){
				obj = document.getElementById('pic' + i);
				obj.style.visibility = newVis;
			}
		}
	}
	
	document['pic'+thisPic+'img'].src = 'images/pop/pic_pop_'+room+thisPic+'.jpg';
}

function popOffsite(location) {
	var x=10;
	var y=10;
	var dx=650;
	var dy=450;

	if (isIE4) {
	    var w = window.open(location, '_blank');
	    return;
	}
	var w = window.open();
	w.document.writeln("<html><head></head>");
	w.document.writeln("<frameset border=0 rows=50,* frameborder=no framespacing=0>");
	w.document.writeln("<frame frameborder=no framespacing=0 marginheight=0 marginwidth=0 name=nav noresize scrolling=no src=\"popOffsiteNav.htm\">");
	w.document.writeln("<frame frameborder=no framespacing=0 name=body noresize src=\"" + location + "\">");
	w.document.writeln("</frameset>");
	w.document.writeln("</html>");

	w.focus();
}

//-->
