<!--

/*
This JavaScript code, and all associated software and file structures, calling or called 
by this code, are copyrighted material, and may not be copied or duplicated in any manner 
whatsoever without prior written authorization.  All applicable trademarks, registrations, 
& copyrights are property of Phil Astrella, Registry Enterprises.
*/


baseNAM			= "azEcoTraveler";
baseDOM			= baseNAM.toLowerCase()+".com";
baseWWW			= "www."+baseDOM;
baseURL			= "http://"+baseWWW;

altNAM			= "azet.ioet";
altDOM			= altNAM.toLowerCase()+".org";
altWWW			= ""+altDOM;
altURL			= "http://"+altWWW;

currPAR			= ""+parent.location;
currDOC			= ""+document.location;

currFIL			= (currDOC.indexOf("?") == -1) ? currDOC
			  : currDOC.substring(0,currDOC.indexOf("?"));
currFIL			= (currFIL.lastIndexOf("/") == (currFIL.length-1)) ? "index.html"
			  : currFIL.substring(currFIL.lastIndexOf("/")+1,currFIL.length);
currPAG			= (currFIL.indexOf(".") == -1) ? currFIL
			  : currFIL.substring(0,currFIL.lastIndexOf("."));
currTYP			= (currFIL.indexOf(".") == -1) ? ""
			  : currFIL.substring(currFIL.lastIndexOf(".")+1,currFIL.length);

ownAddress		= "91 Portal Lane"
ownCityState		= "Sedona, Arizona 86336";
ownPhone		= "928.282.2720";
ownFax			= "928.282.5193";

ownEmail		= "info@"+baseDOM;
directorEmail		= "director@"+baseDOM;
webmasterEmail		= "webmaster@"+baseDOM;

dirLevel		= "";
pageNotice		= "";

screenW			= 0;
screenWdefault		= 760;
screenW			= Math.abs(screen.width);
if (screenW > 0)	{ screenW = (screenW - 40) };
if (screenW < screenWdefault) { screenW = screenWdefault };

screenH			= 0;
screenHdefault		= 480;
screenH			= Math.abs(screen.height);
if (screenH > 0)	{ screenH = (screenH - 120) };
if (screenH < screenHdefault) { screenH = screenHdefault };

window.defaultStatus	= document.title ;



// Browser Detection:

var bxua	= navigator.userAgent.toLowerCase();
var bxav	= navigator.appVersion.toLowerCase();
var bxan	= navigator.appName.toLowerCase();

var isNS	= (bxan.indexOf("netscape") >= 0)			? 1 : 0 ;

var isMinNS4	= ((isNS) && (parseFloat(bxav) >= 4))			? 1 : 0 ;

var isMinNS6	= ((isMinNS4) && (document.getElementById))		? 1 : 0 ;

var isIE	= ((document.all) || (bxua.indexOf("msie") >= 0))	? 1 : 0 ;

var isMinIE3	= ((document.all) && (parseFloat(bxav) >= 3))		? 1 : 0 ;

var isMinIE4	= ((document.all) && (parseFloat(bxav) >= 4))		? 1 : 0 ;

var isMinIE5	= ((isMinIE4 && bxav.indexOf("msie 5.") >= 0)	||
		   (isMinIE4 && bxav.indexOf("msie 6.") >= 0)	||
		   (isMinIE4 && bxav.indexOf("msie 7.") >= 0))		? 1 : 0 ;



// Directory Level Detection:

dirPath = currDOC.toLowerCase();
if (dirPath.indexOf(baseDOM) != -1)
  { dirPath = dirPath.substring(dirPath.lastIndexOf(baseDOM)+baseDOM.length,dirPath.length) } else
if (dirPath.indexOf(baseNAM) != -1)
  { dirPath = dirPath.substring(dirPath.lastIndexOf(baseNAM)+baseNAM.length,dirPath.length) } else
if (dirPath.indexOf("~") != -1)
  { dirPath = dirPath.substring(dirPath.indexOf("/",dirPath.lastIndexOf("~")),dirPath.length) } else
if (dirPath.indexOf(escape("~").toLowerCase()) != -1)
  { dirPath = dirPath.substring(dirPath.indexOf("/",dirPath.lastIndexOf(escape("~").toLowerCase())),
	dirPath.length) } else
  { dirPath = dirPath.substring(dirPath.lastIndexOf("/"),dirPath.length) } ;

if (dirPath.charAt(0) == "/") { dirPath = dirPath.substring(1,dirPath.length) };
dirLevel = "";
while (dirPath.indexOf("/") != -1)
  {
    dirLevel += "../";
    dirPath = dirPath.substring(dirPath.indexOf("/")+1,dirPath.length);
  }




// Page function:

var pageFunc	= ""+location.search;
pageFunc	= (pageFunc.indexOf("?pf=") == -1) ? "" 
		: pageFunc.substring(pageFunc.indexOf("?pf=")+4,pageFunc.length);
pageFunc	= (pageFunc.indexOf("&") == -1) ? ""+pageFunc 
		: pageFunc.substring(0,pageFunc.indexOf("&"));




// Get Date:

var dayList	= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") ;
var monthList	= new Array("January","February","March","April","May","June",
			"July","August","September","October","November","December") ;

function getDate(gdFormat)
  {
	var ampm	= "PM";
	var baseYear	= "2002";
	var newDate	= new Date();
	var currDay	= newDate.getDay();
	var currMonth	= newDate.getMonth();
	var currDate	= newDate.getDate();
	var currYear	= newDate.getYear();
	var currHr	= newDate.getHours();
	var currMin	= newDate.getMinutes();
	var currSec	= newDate.getSeconds();
	if (currYear < 1900)	{ currYear += 1900 };
	if (currHr < 12)	{ ampm = "AM" };
	if (currHr > 12)	{ currHr -= 12 };
	if (currHr < 10)	{ currHr = "&nbsp;" + currHr };
	if (currMin < 10)	{ currMin = "0" + currMin };
	if (currSec < 10)	{ currSec = "0" + currSec };

	var partYear = ""+currYear;
	partYear = partYear.substring(partYear.length-2,partYear.length);

	var dateFormatShort = ""+(currMonth+1)+"/"+currDate+"/"+partYear;

	var dateFormatStandard = ""+monthList[currMonth]+" "+currDate+", "+currYear;

	var dateFormatLong = ""+dayList[currDay]+", "+monthList[currMonth]
		+" "+currDate+", "+currYear+" "+currHr+":"+currMin+" "+ampm;

	if ((!gdFormat) || (gdFormat.length < 1) || (gdFormat.toLowerCase() == "all"))
	  { return "<nobr>" + dateFormatShort + " &#149; " + dateFormatLong + "</nobr>" } else
	if (gdFormat.toLowerCase() == "short")
	  { return "<nobr>" + dateFormatShort + "</nobr>" } else
	if (gdFormat.toLowerCase() == "standard")
	  { return "<nobr>" + dateFormatStandard + "</nobr>" } else
	if (gdFormat.toLowerCase() == "long")
	  { return "<nobr>" + dateFormatLong + "</nobr>" } else
	if (gdFormat.toLowerCase() == "copyright")
	  { return "<nobr>Copyright &copy; "+baseYear+"-"+currYear+"</nobr>" } else
	  { return "<nobr>" + dateFormatShort + " &#151; " + dateFormatLong + "</nobr>" } ;
  }





// nav cells, links & text

navIdNum = 0;

function showNav(snRow)
  {
    if (snRow == 1)
      {
	writeNav("EcoTravelDefined.html","ECOTRAVEL&nbsp; DEFINED",1,1);
	//writeNav("http://www.ioet.org","INSTITUTE&nbsp; OF&nbsp; ECOTOURISM",1,1);
	writeNav("Institute.html","INSTITUTE&nbsp; OF&nbsp; ECOTOURISM",1,1);
	writeNav("TravelInAz.html","TRAVEL&nbsp; IN&nbsp; ARIZONA",1,1);
	writeNav("PhotoGallery.html","PHOTO&nbsp; GALLERY",0,1);
      } else
    if (snRow == 2)
      {
	writeNav("NorthwestAz.html","NORTHWEST&nbsp; ARIZONA",1,2);
	writeNav("NortheastAz.html","NORTHEAST&nbsp; ARIZONA",1,2);
	writeNav("SoutheastAz.html","SOUTHEAST&nbsp; ARIZONA",1,2);
	writeNav("SouthwestAz.html","SOUTHWEST&nbsp; ARIZONA",0,2);
      } else
      {
	document.write("")
      } 
  }

function writeNav(wnHref,wnText,wnSep,wnRow)
  {
    if (wnHref == currFIL)	{ var wnOverColor	= "#660000"	} else
    if (wnRow == 1)		{ var wnOverColor	= "teal"	} else
    if (wnRow == 2)		{ var wnOverColor	= "dimgray"	} else
				{ var wnOverColor	= "blue"	} ;

    if (wnHref == currFIL)	{ var wnOutColor	= wnOverColor	} else
				{ var wnOutColor	= ""		} ;
    navIdNum++ ;

    var wnString = "<td id='navId"+navIdNum+"' nowrap width=190 height=35 style='";
    if (wnHref == currFIL) { wnString += "background-color:\""+wnOverColor+"\"; " };
    if (wnSep) { wnString += "border-right: 1px solid #808080; " };

    wnString += "padding:2px' ";

    if (wnHref == currFIL)
      {
	wnString += "onMouseOver=\"this.style.backgroundColor='"+wnOverColor+"'\" "
		  + "onMouseOut=\"this.style.backgroundColor='"+wnOutColor+"'\">"
		  + "<span style=\"color:'gray'\">"+wnText+"</span></td>"
      } else
      {
	wnString += "onMouseOver=\"this.style.backgroundColor='"+wnOverColor+"'; this.style.cursor='hand'; "
		    + "window.status='"+wnText+"'\" "
		  + "onMouseOut=\"this.style.backgroundColor='"+wnOutColor+"'; this.style.cursor='arrow'\" "
		  + "onClick=\"location.href='"+wnHref+"'\">"
		  + "<a href='"+wnHref+"' title='' style=\"color:'white'; font-weight:normal\" ";
	if (wnHref.indexOf("http://") == 0) { wnString += "target='_blank' " };
	wnString += "onMouseOver=\"this.style.color='gold'; this.style.fontWeight='bold'; this.style.textDecoration='none'\" "
		  + "onMouseOut=\"this.style.color='white'; this.style.fontWeight='normal'\">"
		  + wnText+"</a></td>"
      }

    document.write(wnString)
  }

 



// Site Menus:

function showMenu(sm)
  {
    var smSep1		= " || ";
    var smSep2		= " &nbsp;&#149;&nbsp; ";
    var smArrowL	= "<img src='images/Home/arrowLeft_18x12.gif' alt='' border=0 width=18 height=12 align=absmiddle "
			+ "style='filter:alpha(style=0,opacity=50)'>";
    var smArrowR	= "<img src='images/Home/arrowRight_18x12.gif' alt='' border=0 width=18 height=12 align=absmiddle "
			+ "style='filter:alpha(style=0,opacity=50)'>";
    var smText1	= "<nobr>"
	+ "<a href='javascript:history.back()'	title='PREVIOUS page'		style='color:deepskyblue' "
	  + "onMouseOver='window.status=\"Go BACK to previous page\"; return true'>"+smArrowL+" &nbsp;Back</a>"				+smSep1
	+ "<a href='index.html'			title='Arizona EcoTraveler HOME page' style='color:deepskyblue'>Home</a>"		+smSep1
	+ "<a href='EcoTravelDefined.html'	title='EcoTravel Defined'	style='color:deepskyblue'>ET Defined</a>"		+smSep1
	+ "<a href='Institute.html'		title='Institute of EcoTourism'	style='color:deepskyblue'>IET</a>"			+smSep1
	+ "<a href='TravelInAz.html'		title='Travel in Arizona'	style='color:deepskyblue'>AZ Travel</a>"		+smSep1
	+ "<a href='PhotoGallery.html'		title='Photo Gallery'		style='color:deepskyblue'>Photos</a>"			+smSep1
	+ "<a href='http://www.azot.com'	title='Arizona Office of Tourism' style='color:deepskyblue' target='_blank'>AOT</a>"	+smSep1
	+ "<a href='http://www.nau.edu/hrm'	title='Northern Arizona University' style='color:deepskyblue' target='_blank'>NAU</a>"	+smSep1
	+ "<a href='Biographies.html'		title='Researcher Biographies' 	style='color:deepskyblue'>Bios</a>"			+smSep1
	+ "<a href='GuideBook.html'		title='Complete Guide Book' 	style='color:deepskyblue'>Guide</a>"			+smSep1
	+ "<a href='NorthwestAz.html'		title='Northwest Arizona' 	style='color:deepskyblue'>NW AZ</a>"			+smSep1
	+ "<a href='NortheastAz.html'		title='Northeast Arizona' 	style='color:deepskyblue'>NE AZ</a>"			+smSep1
	+ "<a href='SouthwestAz.html'		title='Southwest Arizona' 	style='color:deepskyblue'>SW AZ</a>"			+smSep1
	+ "<a href='SoutheastAz.html'		title='Southeast Arizona' 	style='color:deepskyblue'>SE AZ</a>"			+smSep1
	+ "<a href='javascript:history.forward()' title='NEXT page'		style='color:deepskyblue' "
	  + "onMouseOver='window.status=\"Go FORWARD to next page\"; return true'>Fwd&nbsp; "+smArrowR+"</a>"
	+ "</nobr>";

    if ((!sm) || (isNaN(sm)) || (Math.abs(sm) < 1))
      { var smString = "Invalid identifier: "+sm } else
    if (sm == 1)
      {
	var smString	= "<div style='margin-top:4px; margin-bottom:2px; font-family:tahoma,arial,arial narrow; "
			+ "font-size:8pt; font-weight:normal; color:silver; background-color:#333333'><nobr>"
			+ smText1+"</nobr></div>";
      } else
      { var smString = "Undefined identifier: "+sm };
    document.write(smString)
  }



function runChildMenu(cmNum)
  {
    if ((!cmNum) || (isNaN(cmNum)) || (cmNum < 1))
      { var cmString = "undefined identifier" } else
    if (cmNum == 1)
      {
	var cmString = "<div align=center style='margin-top:30px; margin-bottom:10px'>"
	  + "<table border=0 width=100% cellspacing=0 cellpadding=2 style='font-family:Comic Sans MS,arial,tahoma; "
	  + "font-size:8pt; font-weight:bold; color:lightcyan; letter-spacing:0.25em; word-spacing:0.25em'>"
	    + "<tr align=center valign=middle>"
	      + "<td nowrap width=24% bgColor='#009999' title='click to view researcher biographies' "
		+ "style='cursor:hand; border: 1px solid blue' "
		+ "onMouseOver=\"this.style.backgroundColor='maroon'\" onMouseOut=\"this.style.backgroundColor='#009999'\" "
		+ "onClick=\"parent.location.href='Biographies.html'\">RESEARCHER<br>BIOGRAPHIES</td>"
	      + "<td nowrap width=14%>&nbsp;</td>"
	      + "<td nowrap width=24% bgColor='#009999' title='click to go to the EcoTraveler HOME page' "
		+ "style='cursor:hand; border: 1px solid blue' "
		+ "onMouseOver=\"this.style.backgroundColor='maroon'\" onMouseOut=\"this.style.backgroundColor='#009999'\" "
		+ "onClick=\"parent.location.href='index.html'\">AZECOTRAVELER<br>HOME PAGE</td>"
	      + "<td nowrap width=14%>&nbsp;</td>"
	      + "<td nowrap width=24% bgColor='#009999' title='click to view complete Guide Book' "
		+ "style='cursor:hand; border: 1px solid blue' "
		+ "onMouseOver=\"this.style.backgroundColor='maroon'\" onMouseOut=\"this.style.backgroundColor='#009999'\" "
		+ "onClick=\"parent.location.href='GuideBook.html'\">COMPLETE<br>GUIDE BOOK</td>"
	    + "</tr>"
	  + "</table></div>"
      } else
      { var cmString = "invalid identifier: "+cmNum }
    document.write(cmString)
  }





// page footers:

function showFooter(sf)
  {
    if ((!sf) || (isNaN(sf)) || (Math.abs(sf) < 1))
      { var sfString = "Invalid identifier: "+sf } else
    if (sf == 1)
      {
	var sfString = "<div align=center style='padding:2px; background-color:#333333'>"
	  + "<table border=0 cellspacing=0 cellpadding=0 width=100% "
	    + "style='font-family:verdana,arial; font-size:7pt; font-weight:normal; font-style:normal; color:gray'>"
	      + "<tr align=center valign=middle style='padding: 2px 6px 2px 6px'>"
		+ "<td nowrap align=left>"+ownAddress+"<br>"+ownCityState+"</td>"
		+ "<td nowrap title='"+document.location+"'>"+getDate("copyright")+"<br><a href='mailto:"+ownEmail
		  +"?subject=AZ EcoTraveler Inquiry (page ID: "+currFIL+")' title='Send email to the Arizona EcoTraveler' "
		  + "style='color:gray; font-weight:normal'>The Institute of EcoTourism</a></td>"
		+ "<td nowrap>"
		  + "<a href='mailto:"+directorEmail+"?subject=AZ EcoTraveler Inquiry (page ID: "+currFIL+")' title='Send email to the Director' "
		    + "style='color:gray; font-weight:normal'>"+baseWWW+"</a><br>"
		  + "<a href='mailto:"+webmasterEmail+"?subject=AZ EcoTraveler Inquiry (page ID: "+currFIL+")' title='Send email to the Webmaster' "
		    + "style='color:gray; font-weight:normal'>"+altWWW+"</a></td>"
		+ "<td nowrap align=right>Phone: "+ownPhone+"<br>Fax: "+ownFax+"</td>"
	      + "</tr>"
	  + "</table></div>"
      } else
      { sfString = "Undefined identifier: "+sf };
    document.write(sfString)
  }





// Favorites Setup

var faviconPath = baseURL + "/favicon.ico" ;

favicon		= new Image() ;
favicon.src	= faviconPath ;

if (parseInt(navigator.appVersion,10) > 3)
  { document.write("<LINK REL='SHORTCUT ICON' HREF='" + faviconPath + "'>") } ;

function addFavBookmark()
  {
    if (isIE)
      {
	document.write("<a "
	+ "href='javascript:window.external.AddFavorite(location.href,document.title)' "
	+ "onMouseOver=\"window.status='Add &quot;" + document.title 
	+ "&quot; to your favorites'; return true\" title='click here to add \""
	+ document.title +"\" to your favorites'>"
	+ "<font size=1 color=dimgray face='arial,tahoma,verdana'><nobr>"
	+ "<u>Add</u> this page to your favorites</nobr></font></a><br>")
      }	else
      {
	document.write("<font size=1 color=deepskyblue face='verdana,tahoma,arial'>"
	+ "<nobr>Hit <font color=gold>&quot;Ctrl-D&quot;</font> to "
	+ "<font color=red>Bookmark</font> this page<i>!</i></nobr></font><br>")
      }
  }




// Set Homepage:

function makeHome(mhVisible)
  {
    if (isMinIE5)
      {
	var homeDoc = ""+document.location;
	document.write("<a href='"+homeDoc+"' "
		+ "title='Click here to make &quot;"+document.title+"&quot; your Home Page' "
		+ "onMouseOver='window.status=\"Click to change your Home Page to: "+homeDoc
		+ "\"; return true'; onClick='this.style.behavior=\"url(#default#homepage)\"; "
		+ "this.setHomePage(\""+homeDoc+"\")'>"+mhVisible+"</a><br>")
      } else
      { document.write("") };
  }



// Image Blending:

function runBlendTrans(rbtIdent,rbtSrc)
  {
    if (isIE)
      {
	rbtIdent.filters.blendTrans.stop();
	rbtIdent.filters.blendTrans.duration=0.33;
	rbtIdent.filters.blendTrans.apply()
      }
    rbtIdent.src=rbtSrc;
    if (isIE) { rbtIdent.filters.blendTrans.play() };
  }




// Misc functions:


function setOpacity(objectID,opacity)
  {
    if (isIE) { objectID.filters.alpha.opacity=opacity };
    if (isNS) { objectID.style.MozOpacity=(opacity/100) };
  }


function runBgSound()
  {
    var bgMax	= 7;
    var bgNum	= (Math.round(Math.random()*(bgMax-1))+1);
    var bgSrc	= "media/intro"+bgNum+".mid";
    if (navigator.appName == "Microsoft Internet Explorer") 
      { document.write('<bgsound src="'+bgSrc+'" LOOP="false">') } else 
      {
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" '
	  + 'Name="MediaPlayer" src="'+bgSrc+'" AutoStart="true" ShowStatusBar="0" ShowControls="0" ShowDisplay="0" '
	  + 'volume="-1"     ="1" WIDTH="1" loop="false"><br>')
      }
  }


function getPageName()
  {
    var pageName = ""+document.location;
    pageName	= (pageName.indexOf("?") == -1) ? ""+pageName
		: pageName.substring(0,pageName.indexOf("?"));
    pageName	= (pageName.indexOf(".html") == -1) ? ""+pageName
		: pageName.substring(0,pageName.indexOf(".html"));
    pageName	= (pageName.indexOf("/") == -1) ? ""+pageName
		: pageName.substring(pageName.lastIndexOf("/")+1,pageName.length);
    pageName	= (pageName.length > 0) ? ""+pageName : "index" ;
    return pageName
  }


function collapseString(StringIn)
  {
	var StringOut = ""+StringIn ;
	while (StringOut.indexOf(" ") != -1)
	  {
	    StringOut	= StringOut.substring(0,StringOut.indexOf(" "))
			+ StringOut.substring(StringOut.indexOf(" ")+1,StringOut.length)
	  }
	return StringOut
  }

function compressString(StringIn)
  {
	var StringOut = trimString(""+StringIn) ;
	while (StringOut.indexOf("  ") != -1)
	  {
	    StringOut	= StringOut.substring(0,StringOut.indexOf("  ")+1) 
			+ StringOut.substring(StringOut.indexOf("  ")+2,StringOut.length)
	  }
	return StringOut
  }

function trimString(StringIn)
  {
	var StringOut = ""+StringIn ;
	while (StringOut.charAt(0) == " ")
	  { StringOut = StringOut.substring(1,StringOut.length) };
	while (StringOut.charAt(StringOut.length-1) == " ")
	  { StringOut = StringOut.substring(0,StringOut.length-1) };
	return StringOut
  }


function validAccessCode()
  {
    var acDate	= new Date();
    var acYY	= acDate.getYear();
	acYY	= (acYY < 1900) ? ""+(acYY+1900) : ""+acYY ;
	acYY	= acYY.substring(2,4);
    var acMM	= acDate.getMonth();
	acMM	= (acMM < 9) ? "0"+(acMM+1) : ""+(acMM+1) ;
    var acDD	= acDate.getDate();
	acDD	= (acDD < 10) ? "0"+acDD : ""+acDD ;
    var acHH	= acDate.getHours();
	acHH	= (acHH < 10) ? "0"+acHH : ""+acHH ;
    var acValid	= acYY+acMM+acDD+acHH;
    var acInput	= prompt("Enter Access Code: ","");
    if (acInput == acValid) { return 1 } else { return 0 } ;
  }




// Styles:

document.write("<style type='text/css'>"
    + "body { "
	+ "scrollbar-track-color:	#333333; "
	+ "scrollbar-arrow-color:	#0099cc; "
	+ "scrollbar-face-color:	#333333; "
	+ "scrollbar-3dlight-color:	#666666; "
	+ "scrollbar-highlight-color:	#999999; "
	+ "scrollbar-shadow-color:	#808080; "
	+ "scrollbar-darkshadow-color:	#484848; };"
    + "</style>");




// Imports:

var thisPageName	= getPageName();

if (thisPageName.length > 0)
  { document.write("<script language='JavaScript' src='script/messages.js'></script>") };



//-->

