// <!--
// This file contains common the javascript necessary for all pages of the site.

// Begin Frame Busting
if (window != top) top.location.href = location.href;
// End Frame Busting



// Begin Style Sheet Method

  // assign variables
var bPlatform = 'false';
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var bStyleAll = 'link rel="stylesheet" href="styles.css" type="text/css"';
var bStyleNavPC = 'link rel="stylesheet" href="styles2.css" type="text/css"';

 // test for Windows Platform
if (navigator.appVersion.indexOf('Win') != -1)
  bPlatform = 'true';

if (bName == 'Netscape' && bPlatform == 'true' && bVer < 5)
  // link the netscape windows pc stylesheets
 document.write(' <' + bStyleNavPC + '> ');
else
  // for everything else...
 document.write(' <' + bStyleAll + '> ');
// End Style Sheet Method



// Preload and Rollovers for standard page buttons

buttonhomehomeOn = new Image(44,22);
buttonhomehomeOn.src = "images/button_home-home-r.jpg";
buttonhomehomeOff = new Image(44,22);
buttonhomehomeOff.src = "images/button_home-home.jpg";

buttonhomelodgeOn = new Image(59,22);
buttonhomelodgeOn.src = "images/button_home-lodge-r.jpg";
buttonhomelodgeOff = new Image(59,22);
buttonhomelodgeOff.src = "images/button_home-lodge.jpg";

buttonhometripsOn = new Image(75,22);
buttonhometripsOn.src = "images/button_home-trips-r.jpg";
buttonhometripsOff = new Image(75,22);
buttonhometripsOff.src = "images/button_home-trips.jpg";

buttonhomegalleryOn = new Image(64,22);
buttonhomegalleryOn.src = "images/button_home-gallery-r.jpg";
buttonhomegalleryOff = new Image(64,22);
buttonhomegalleryOff.src = "images/button_home-gallery.jpg";

buttonhometravelOn = new Image(68,22);
buttonhometravelOn.src = "images/button_home-travel-r.jpg";
buttonhometravelOff = new Image(68,22);
buttonhometravelOff.src = "images/button_home-travel.jpg";

buttonhomecontactOn = new Image(65,22);
buttonhomecontactOn.src = "images/button_home-contact-r.jpg";
buttonhomecontactOff = new Image(65,22);
buttonhomecontactOff.src = "images/button_home-contact.jpg";

buttonhomeguestsOn = new Image(54,22);
buttonhomeguestsOn.src = "images/button_home-guests-r.jpg";
buttonhomeguestsOff = new Image(54,22);
buttonhomeguestsOff.src = "images/button_home-guests.jpg";

buttonhomeOn = new Image(44,22);
buttonhomeOn.src = "images/button_home-r.jpg";
buttonhomeOff = new Image(44,22);
buttonhomeOff.src = "images/button_home.jpg";

buttonlodgeOn = new Image(59,22);
buttonlodgeOn.src = "images/button_lodge-r.jpg";
buttonlodgeOff = new Image(59,22);
buttonlodgeOff.src = "images/button_lodge.jpg";

buttontripsOn = new Image(75,22);
buttontripsOn.src = "images/button_trips-r.jpg";
buttontripsOff = new Image(75,22);
buttontripsOff.src = "images/button_trips.jpg";

buttongalleryOn = new Image(64,22);
buttongalleryOn.src = "images/button_gallery-r.jpg";
buttongalleryOff = new Image(64,22);
buttongalleryOff.src = "images/button_gallery.jpg";

buttontravelOn = new Image(68,22);
buttontravelOn.src = "images/button_travel-r.jpg";
buttontravelOff = new Image(68,22);
buttontravelOff.src = "images/button_travel.jpg";

buttoncontactOn = new Image(65,22);
buttoncontactOn.src = "images/button_contact-r.jpg";
buttoncontactOff = new Image(65,22);
buttoncontactOff.src = "images/button_contact.jpg";

buttonguestsOn = new Image(54,22);
buttonguestsOn.src = "images/button_guests-r.jpg";
buttonguestsOff = new Image(54,22);
buttonguestsOff.src = "images/button_guests.jpg";

backOn = new Image(24,24);
backOn.src = "images/button_back-r.gif";
backOff = new Image(24,24);
backOff.src = "images/button_back.gif";

nextOn = new Image(24,24);
nextOn.src = "images/button_forward-r.gif";
nextOff = new Image(24,24);
nextOff.src = "images/button_forward.gif";

menulodgemainlodgeOn = new Image(59,22);
menulodgemainlodgeOn.src = "images/menu_lodge-mainlodge-r.gif";
menulodgemainlodgeOff = new Image(59,22);
menulodgemainlodgeOff.src = "images/menu_lodge-mainlodge.gif";

function imageOff(imgName) {
	imgOff = eval(imgName + "Off.src");
	document[imgName].src = imgOff;
}

function imageOn(imgName) {
	imgOn = eval(imgName + "On.src");
	document[imgName].src = imgOn;
}

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="lodge_mainlodge.html"><IMG SRC="images/menu_lodge-mainlodge.gif" NAME="menulodgemainlodge" WIDTH="59" HEIGHT="24" BORDER="0" ALT="main lodge" /></a>'
menu1[1]='<a href="lodge_cabins.html"><IMG SRC="images/menu_lodge-cabins.gif" NAME="menulodgecabins" WIDTH="59" HEIGHT="24" BORDER="0" ALT="cabins" /></a>'
menu1[2]='<a href="lodge_amenities.html#gym"><IMG SRC="images/menu_lodge-gym.gif" NAME="menulodgegym" WIDTH="59" HEIGHT="24" BORDER="0" ALT="gym" /></a>'
menu1[3]='<a href="lodge_amenities.html#castingpond"><IMG SRC="images/menu_lodge-castingpond.gif" NAME="menulodgecastingpond" WIDTH="59" HEIGHT="38" BORDER="0" ALT="fly casting pond" /></a>'
menu1[4]='<a href="lodge_amenities.html#tackroom"><IMG SRC="images/menu_lodge-tackroom.gif" NAME="menulodgetackroom" WIDTH="59" HEIGHT="24" BORDER="0" ALT="tack room" /></a>'
menu1[5]='<a href="lodge_amenities.html#spa"><IMG SRC="images/menu_lodge-spaservices.gif" NAME="menulodgespaservices" WIDTH="59" HEIGHT="38" BORDER="0" ALT="spa services" /></a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="trips_winter.html"><IMG SRC="images/menu_trips-winter.gif" NAME="menutripswinter" WIDTH="75" HEIGHT="24" BORDER="0" ALT="winter pkgs" /></a>'
menu2[1]='<a href="trips_summer.html"><IMG SRC="images/menu_trips-summer.gif" NAME="menutripssummer" WIDTH="75" HEIGHT="24" BORDER="0" ALT="summer pkgs" /></a>'
menu2[2]='<a href="trips_salmon.html"><IMG SRC="images/menu_trips-salmon.gif" NAME="menutripssalmon" WIDTH="75" HEIGHT="24" BORDER="0" ALT="salmon fishing" /></a>'
menu2[3]='<a href="trips_steelhead.html"><IMG SRC="images/menu_trips-steelhead.gif" NAME="menutripssteelhead" WIDTH="75" HEIGHT="38" BORDER="0" ALT="steelhead fishing" /></a>'
menu2[4]='<a href="trips_buteinlet.html"><IMG SRC="images/menu_trips-buteinlet.gif" NAME="menutripsbuteinlet" WIDTH="75" HEIGHT="24" BORDER="0" ALT="bute inlet" /></a>'
menu2[5]='<a href="trips_nonfishing.html"><IMG SRC="images/menu_trips-nonfishing.gif" NAME="menutripsnonfishing" WIDTH="75" HEIGHT="38" BORDER="0" ALT="non-fishing packages" /></a>'
menu2[6]='<a href="trips_nonfishing.html"><IMG SRC="images/menu_trips-wingshoot.gif" NAME="menutripswingshoot" WIDTH="75" HEIGHT="24" BORDER="0" ALT="wing shooting" /></a>'
menu2[7]='<a href="trips_nonfishing.html"><IMG SRC="images/menu_trips-golf.gif" NAME="menutripsgolf" WIDTH="75" HEIGHT="24" BORDER="0" ALT="golf" /></a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="gallery_virtualtours.html"><IMG SRC="images/menu_gallery-virtualtours.gif" NAME="menugalleryvirtualtours" WIDTH="64" HEIGHT="24" BORDER="0" ALT="virtual tours" /></a>'
menu3[1]='<a href="gallery_lodge.html"><IMG SRC="images/menu_gallery-lodge.gif" NAME="menugallerylodge" WIDTH="64" HEIGHT="24" BORDER="0" ALT="lodge" /></a>'
menu3[2]='<a href="gallery_rooms.html"><IMG SRC="images/menu_gallery-rooms.gif" NAME="menugalleryrooms" WIDTH="64" HEIGHT="24" BORDER="0" ALT="rooms" /></a>'
menu3[3]='<a href="gallery_helifishing.html"><IMG SRC="images/menu_gallery-helifishing.gif" NAME="menugalleryhelifishing" WIDTH="64" HEIGHT="24" BORDER="0" ALT="heli-fishing" /></a>'
menu3[4]='<a href="gallery_oceanfishing.html"><IMG SRC="images/menu_gallery-oceanfishing.gif" NAME="menugalleryoceanfishing" WIDTH="64" HEIGHT="38" BORDER="0" ALT="ocean fishing" /></a>'

//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="travel_gettingthere.html"><IMG SRC="images/menu_travel-gettingthere.gif" NAME="menutravel" WIDTH="68" HEIGHT="24" BORDER="0" ALT="getting there" /></a>'
menu4[1]='<a href="travel_whattobring.html"><IMG SRC="images/menu_travel-whattobring.gif" NAME="menutravel" WIDTH="68" HEIGHT="24" BORDER="0" ALT="what to bring" /></a>'
menu4[2]='<a href="travel_weather.html"><IMG SRC="images/menu_travel-weather.gif" NAME="menutravel" WIDTH="68" HEIGHT="24" BORDER="0" ALT="weather" /></a>'
menu4[3]='<a href="travel_airline.html"><IMG SRC="images/menu_travel-airline.gif" NAME="menutravel" WIDTH="68" HEIGHT="24" BORDER="0" ALT="airline links" /></a>'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="contact_contactus.html"><IMG SRC="images/menu_contact-contactus.gif" NAME="menucontactcontactus" WIDTH="65" HEIGHT="24" BORDER="0" ALT="contact us" /></a>'
menu5[1]='<a href="contact_reservations.html"><IMG SRC="images/menu_contact-reservations.gif" NAME="menucontactreservations" WIDTH="65" HEIGHT="24" BORDER="0" ALT="reservations" /></a>'

var menuwidth='59px' //default menu width
var menubgcolor='#ffffff'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop - 0;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

//-->

