<!-- Adobe GoLive and CyberStudio suckz azz.... use dreamweaver.													-->
<!-- csxxx tags have been commented out. So that document passes dtd validation.									-->


CSAg = window.navigator.userAgent;				// Browzer name
function IsIE() { return CSAg.indexOf("MSIE") > 0;}		// Browzer is IE

// more evidence GoLive is shit.... MSIE returns this string for
// CSAg: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'
// how the hell is it ever going to see a version number other than 4 with
// the function looking like this ?????
//   CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);	// Browzer version
// Microsoft sez to do it the way shown below..... damn... 
//   RTFM guys, how hard is that ?????????

CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);	//Mozilla Version.
if (IsIE()&&CSBVers==4) {
//alert('iecheck');
	CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("MSIE ")+5),10);
      	// bMSIE4 = (CSBVers.indexOf("MSIE 4.0")>=1);
      	// bMSIE5 = (CSBVers.indexOf("MSIE 5.0")>=1);
        // bMSIE55 = (CSBVers.indexOf("MSIE 5.5")>=1);
	// bMSIE6 = (CSBVers.indexOf("MSIE 6.0")>=1);
}

CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false; // Browzer is W3C Document Object Model flag

//alert('CSAg:'+CSAg);
//alert('IsIE:'+IsIE());
//alert('CSBVers:'+CSBVers);
//alert('Is W3C:'+CSIsW3CDOM);


CSInit = new Array;						// Initialization Array - contains names of buttons
																	//      and locations of their images
//
// Script Init - Do all the things in CSInit.
//
function CSScriptInit() {
	//  alert('CSScriptInit');
	if(typeof(skipPage) != "undefined") { if(skipPage) return; }
	idxArray = new Array;					// Array of indexes to CSInit elements
	for(var i=0;i<CSInit.length;i++) idxArray[i] = i;	// Preload index array with ordinals
	CSAction2(CSInit, idxArray);				// Load all the button images
}

//
// ClickReturn - If this is a gay Mac, then don't do anything if button is clicked.
//
function CSClickReturn () {
	var bAgent = window.navigator.userAgent; 
	var bAppName = window.navigator.appName;
	if ((bAppName.indexOf("Explorer") >= 0) && 
			(bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		return true;			 		// dont follow link
	else return false; 	
}
function CSButtonReturn () { return !CSClickReturn(); }

// What a fucking mess.....
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }

//
// InitImgID - Run thru the document, and initialize all images to have the
//             same ID as its Name.
//
CSIImg=false;
function CSInitImgID() {
	if (!CSIImg && document.images) {
		for (var i=0; i<document.images.length; i++) {
			if (!document.images[i].id) document.images[i].id=document.images[i].name;
		}
		CSIImg = true;
	}
}

//
// FindElement - find an element by name in the current doc and return a reference to it.
//
function CSFindElement(n,ly) { 
alert('CSFindElement');
	if (CSBVers<4) return document[n];
	if (CSIsW3CDOM) {
		CSInitImgID();
		return(document.getElementById(n));
	}
	var curDoc = ly?ly.document:document; var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem=CSFindElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

//
// GetImage - find an image by name in the current doc and return a reference to it.
//
function CSGetImage(n) {
	if(document.images) {
		return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);
	} else {
		return null;
	}
}
	
//
//
//
CSDInit=false;
function CSIDOM() {
	if (CSDInit)return;
	CSDInit=true;
	if(document.getElementsByTagName) {
		var n = document.getElementsByTagName('DIV');
		for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}
	}
}

function CSICSS2Prop(id) {
	var n = document.getElementsByTagName('STYLE');
	for (var i=0;i<n.length;i++) {
		var cn = n[i].childNodes;
		for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }
	}
}

function CSFetchStyle(sc, id) {
	var s=sc;
	while(s.indexOf("#")!=-1) {
		s=s.substring(s.indexOf("#")+1,sc.length);
		if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) {
			return(s.substring(s.indexOf("{")+1,s.indexOf("}")));
		}
	}
	return "";
}

function CSGetStyleAttrValue (si, id) {
	var s=si.toUpperCase();
	var myID=id.toUpperCase()+":";
	var id1=s.indexOf(myID);
	if (id1==-1) return "";
	s=s.substring(id1+myID.length+1,si.length);
	var id2=s.indexOf(";");
	return ((id2==-1)?s:s.substring(0,id2));
}
function CSSetCSS2Props(si, id) {
	var el=document.getElementById(id);
	if (el==null) return;
	var style=document.getElementById(id).style;
	if (style) {
		if (style.left=="") style.left=CSGetStyleAttrValue(si,"left");
		if (style.top=="") style.top=CSGetStyleAttrValue(si,"top");
		if (style.width=="") style.width=CSGetStyleAttrValue(si,"width");
		if (style.height=="") style.height=CSGetStyleAttrValue(si,"height");
		if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility");
		if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index");
	}
}

CSIm=new Object();					//CSIm - Images Cache
var fishstate=0;					//wigglefish state
var fishstatemax=2;					//wigglefish max state
var fishname='wigglefish';				//wigglefish name

//Show button (n)'s image for state (i)
//
function CSIShow(n,i) {
	var retval=false;
	if (document.images) {
		if (CSIm[n]) {
			var img=CSGetImage(n);
			if (img&&typeof(CSIm[n][i].src)!="undefined") {
				img.src=CSIm[n][i].src;
			}
			if(i!=0) self.status=CSIm[n][3]; else self.status=" ";
			retval=true;
		}
	}
//	//wigglefish mod
//	if (document.images) {
//	    if (!(n==fishname)) {
//		if (CSIm[fishname]) {
//			var img2=CSGetImage(fishname);
//			fishstate = eval(fishstate)+1
//			if (fishstate>fishstatemax) fishstate=0;
//			if (img2&&typeof(CSIm[fishname][fishstate].src)!="undefined") {
//				img2.src=CSIm[fishname][fishstate].src;
//			}
//		}
//	    }
//	}
	return retval;
}

//Load images for a button into the image cache.  Action is an array passed
//from CSInit list that has info about the button being managed.
//CSInit elements:
//  [0] function: CSILoad (me)
//  [1] Button Name
//  [2] Off Image
//  [3] On Image
//  [4] unknown URL -- Active Image, perhaps?
//  [5] unknown value
function CSILoad(action) {
	im=action[1];					//get button name
	if (document.images) {
		CSIm[im]=new Object();			//Create a cache entry
		for (var i=2;i<5;i++) {			//Load Off Image, On Image, and ??Active?? Image
			if (action[i]!='') {CSIm[im][i-2]=new Image(); CSIm[im][i-2].src=action[i];}
			else CSIm[im][i-2]=0;
		}
		CSIm[im][3] = action[5];		//Save ?status?
	}
}
CSStopExecution=false;

//
// Action - Perform one or more actions from the action array.  Param 'array' is an array
//          with a list of indexes into CSAct to be performed.
//
function CSAction(array) {return CSAction2(CSAct, array);}

//
// Action2 - Perform a list of actions
//
function CSAction2(fct, array) { 
	var result;
	for (var i=0;i<array.length;i++) {
		if(CSStopExecution) return false; 
		var aa = fct[array[i]];				// Get the action array.
		if (aa == null) return false;			// If slot is empty, skip.
		var ta = new Array;				// temporary action params array.
		for(var j=1;j<aa.length;j++) {			// Copy action params to temp array....
								// ??unclear when params would be an object????
			if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){
				if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
				else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
				else ta[j]=aa[j];}
			} else ta[j]=aa[j];
		}			
		result=aa[0](ta);				//perform function
	}
	return result;
}

//Actions List
CSAct = new Object;

//
//
//
function CSGotoLink(action) {
//	alert("at CSGotoLink "+action[1]);
	if (action[2].length) {
		var hasFrame=false;
		for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
		if (hasFrame==true)
			parent.frames[action[2]].location = action[1];
		else
			window.open (action[1],action[2],"");
	}
	else location = action[1];
}

//
//
//
function CSOpenWindow(action) {
	var wf = "";	
	wf = wf + "width=" + action[3];
	wf = wf + ",height=" + action[4];
	wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
	wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
	wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
	wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
	wf = wf + ",directories=" + (action[9] ? "yes" : "no");
	wf = wf + ",location=" + (action[10] ? "yes" : "no");
	wf = wf + ",status=" + (action[11] ? "yes" : "no");		
	window.open(action[1],action[2],wf);
}


// Load the initialization array with button names and locations of images for their states.
//
CSInit[CSInit.length] = new Array(CSILoad,'mnrregs','images/head_02.gif','images/head_02b.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button','images/tool_03.gif','images/tool2_03.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button2','images/tool_05.gif','images/tool2_05.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button3','images/tool_06.gif','images/tool2_06.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button4','images/tool_07.gif','images/tool2_07.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button5','images/tool_08.gif','images/tool2_08.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button6','images/tool_09.gif','images/tool2_09.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button7','images/tool_10.gif','images/tool2_10.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button8','images/tool_11.gif','images/tool2_11.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button9','images/tool_12.gif','images/tool2_12.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button10','images/tool_13.gif','images/tool2_13.gif','','');
CSInit[CSInit.length] = new Array(CSILoad,'button11','images/tool_15.gif','images/tool2_15.gif','','');
//CSInit[CSInit.length] = new Array(CSILoad,'wigglefish','images/tool_14.gif','images/tool2_14b.gif','images/tool2_14c.gif','');
//alert("Loading CSAct...");
CSAct['B964339A0'] = new Array(CSGotoLink,'mailto:expeditionsnorth@comcast.net','');
CSAct['BA271ED30'] = new Array(CSOpenWindow,'lakemap.pdf','',0,0,true,true,true,true,true,true,true);