	browser = navigator.appName;
	ie = "Microsoft Internet Explorer";
	netscape = "Netscape";
	os = navigator.platform;
	var version = parseInt(navigator.appVersion);

	var rootDir="dosbirds"
	if(browser==netscape) popup_fontsize=11
	else popup_fontsize=9
	popup_ht = 13
	popup_wd = 135

function rndImg(dir) {
	if(!dir) dir="."
	i=dir.indexOf("@",0)
	if(dir==""){ dir+="images/rnd/";idir=dir+"images"}
	else if(i>=0){
		dir=dir.slice(0,i)
		idir=dir+"images"
		dir+="images/rnd/"
	}
	num_pix=13
	imgs=new Array()
	for(i=1;i<=num_pix;i++){
		imgs.push("p"+i+".jpg")
	}
	    var dt = new Date();var sec = dt.getSeconds();sw=(sec%imgs.length)
    	document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' align='right'>")
        //document.write("<tr><td rowspan='2'><img src='"+idir + "/cor2.gif' height=62></td>")
        document.write("<tr>")
		document.write("<td><img src='"+idir+"/spacer_gray.gif' width='2' height='63'></td>")
		document.write("<td><img src='" + dir + imgs[sw] + "' width=150 height=63 border=0 bordercolor=\"#005599\"></td>")
        document.write("<td><img src='"+idir+"/spacer_gray.gif' width='2' height='63'></td>")
		document.write("</tr>")
        document.write("<tr><td colspan='3' align='right' height='1'>")
        document.write("<img src='"+idir+"/spacer_gray.gif' width='154' height='2'>")
        document.write("</td></tr></table>")
}

//Return the path to the root directory, so menus work...
function parseDir(s){
	var root_path=0
	var folderArray= new Array()
	var bi=-1
	folderArray=s.split("/")
	for(i=0;i<folderArray.length;i++){
			if(folderArray[i]==rootDir) bi=i
	}
	if(bi==-1)	return("./")
	di=--i-bi
	var i_path=""
	for(i=1;i<di;i++){
		root_path="../"
	}
	if(root_path==0) return("./")
	return(root_path)
}


function write_feat_table(){
	num_pix=4;tot_pix=15;
	featAuthors = new Array("Larry Graff","Bob Rufe","Jeff Gordon",
					"Larry Graff", "Frank Rohrbacher", "Derek Stoner",
					"Larry Graff", "Bill Schreitz", "Adam Dudley", "Braun/Gonzon",
					"Bob Rufe","Anthony Gonzon","Anthony Gonzon","Bill Schreitz","Anthony Gonzon");
	i1r=i2r=i3r=i4r=-1
	i1r=Math.round(Math.random()*(tot_pix-1))
	i2r=Math.round(Math.random()*(tot_pix-1))
	i3r=Math.round(Math.random()*(tot_pix-1))
	i4r=Math.round(Math.random()*(tot_pix-1))
	while (i2r==i1r){
		i2r=Math.round(Math.random()*(tot_pix-1))
	}
	while (i3r==i1r || i3r==i2r){
		i3r=Math.round(Math.random()*(tot_pix-1))
	}
	while (i4r==i1r || i4r==i2r || i4r==i3r){
		i4r=Math.round(Math.random()*(tot_pix-1))
	}
	the_nums = new Array(i1r,i2r,i3r,i4r)
	document.write("<table width='90%' border='0' cellspacing='0' cellpadding='0' align='center'>")
    document.write("<tr valign='bottom'>")
	for(i=0;i<num_pix;i++){
		nm=the_nums[i]
		document.write("<td align='center' height='89'><a href='photogallery/main.htm' target='_blank'>")
    	document.write("<img src='photogallery/birdpix/tn_feat"+(nm+1)+".jpg' border=2 height=70></a></td>")
    	//document.write("<td align='center' height='89'><a href='photogallery/main.htm' target='_blank'>")
    	//document.write("<img src='photogallery/birdpix/tn_feat"+(i2+1)+".jpg' border=2 height=70></a></td>")
    	//document.write("<td align='center' height='89'><a href='photogallery/main.htm' target='_blank'>")
    	//document.write("<img src='photogallery/birdpix/tn_feat"+(i3+1)+".jpg' border=2 height=70></a></td>")
		}
	document.write("</tr>")
    document.write("<tr align='center'>")
	for(i=0;i<num_pix;i++){
		nm=the_nums[i]
		document.write("<td class='doslink2'>("+featAuthors[nm]+")</td>")
    	//document.write("<td class='doslink2'>("+featAuthors[i2]+")</td>")
    //	document.write("<td class='doslink2'>("+featAuthors[i3]+")</td>")
		}
	document.write("</tr></table>")
}

function customLoadFxn() {
//Do Nothing function, to be overridden in template-derived pages, if needed.
}

function BrowserOK() {
	if(browser==netscape && version<=4) return false;
	return true;
}

function todaysDate(os) {
        var theDate = new Date()

        if(!os.indexOf("Sun") || !os.indexOf("Aix") || browser==netscape) {theYear=theDate.getYear()+1900;}
        else{theYear=theDate.getYear();}

        var mos = new Array("January", "February", "March", "April", "May", "June", "July", "August",
                        "September", "October", "November", "December")
        return(mos[theDate.getMonth()] + "&nbsp;" + theDate.getDate() + ",&nbsp;" + theYear)
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//Netscape only fix
		function resizeFix() {
			if (document.layers) {
				if(BrowserOK()){return false;}
				if (window.innerWidth != origWidth || window.innerHeight != origHeight) {
					window.location.reload()
				}
			}
		}
		//End Netscape only fix

	    //Functions to handle hidden tables
/*** OLD DROPDOWN METHOD
	    function show(tab) {
	            if (browser == ie) {document.all[tab].style.visibility = 'visible';}
	            else if (document.getElementById) {document.getElementById(tab).style.visibility = 'visible';}
	            else if (browser == netscape) {document.layers[tab].visibility = 'visible'; }
	            }
	    function hide(tab) {
	            if (browser == ie) {document.all[tab].style.visibility = 'hidden';}
	            else if (document.getElementById) {document.getElementById(tab).style.visibility = 'hidden';}
	            else if (browser == netscape) {document.layers[tab].visibility = 'hidden'; }
	            }


	    function display(tab,y) {
			alert(y)
	            for (var i = 0; i < tabs.length; i++) {
	                    if (tabs[i] == tab) {show(tabs[i]);}
	                    else {hide(tabs[i]);}
	            }
	     }

	    function nodisplay(tab) {
	                    for (var i = 0; i < tabs.length; i++) {
	                    if (tabs[i] == tab) {hide(tabs[i]);}
	                    else {show(tabs[i]);}
	            }
	    }
	    function hideall() {
	            for (var i = 0; i < tabs.length; i++) {
	                    hide(tabs[i]);
	            }
	    }
	    function startTiming(tb) {
			for (var i = 0; i < tabs.length; i++) {
	             if (tabs[i] == tb) {theTimer=setTimeout("hide('"+tabs[i]+"')",2000);}
	        }
	    }
*******/
//
function openHomeWin() {
	if(opener.closed) {
		if( window.DOSHome==null) {
        		DOSHome=window.open("http://www.DOSbirds.org");
		}
		else {
			if(window.DOSHome.closed)
        			DOSHome=window.open("http://www.DOSbirds.org");
			else
        			window.DOSHome.focus();
		}
	}
        else if( opener.name=="DOSHome" ) {
        	window.opener.focus();
	}
	else {
        	DOSHome=window.open("http://www.DOSbirds.org");
        }
}

function mail2DOS( nm_str,add_str,subj_str ){
	var add_list=add_str.split(",")
	var theAdd=nm_str + "@"
	for( a in add_list){
		theAdd += add_list[a] + "."
	}
	theAdd = theAdd.substr(0,theAdd.length-1)
	if( subj_str != null ){
		theAdd += "?subject=" + subj_str
	}
	window.open("mailto:" + theAdd)
}

//Menu Control
function fwLoadMenus(loc) {
	var r_path
	r_path=parseDir(loc)

  if (window.fw_menu_0) return;
  window.fw_menu_0 = new Menu("root",popup_wd*.8,popup_ht,"Verdana, Arial, Helvetica, sans-serif",popup_fontsize,"#222222","#aa2222","#EEEEEE","#bbbbdd");
  fw_menu_0.addMenuItem("Conservation","window.open('"+r_path+"committees/conservation.htm', '_self');");
  fw_menu_0.addMenuItem("Records","window.open('"+r_path+"committees/records.htm', '_self');");
  fw_menu_0.addMenuItem("Research","window.open('"+r_path+"committees/research.htm', '_self');");
  fw_menu_0.addMenuItem("Youth Birding","window.open('"+r_path+"field_trips/youth_birding.htm', '_self');");
  fw_menu_0.addMenuItem("Contact Us!","mail2DOS('"+r_path+"webmaster','dosbirds,org');");
  fw_menu_0.hideOnMouseOut=true;

   if (window.fw_menu_1) return;
  window.fw_menu_1 = new Menu("root",popup_wd*0.8,popup_ht,"Verdana, Arial, Helvetica, sans-serif",popup_fontsize,"#222222","#aa2222","#EEEEEE","#bbbbdd");
  fw_menu_1.addMenuItem("Why Join DOS?","window.open('"+r_path+"member_benefits.htm', '_self');");
  fw_menu_1.addMenuItem("Membership&nbsp;Form","window.open('"+r_path+"membership/dos_form.pdf', '_blank');");
  fw_menu_1.addMenuItem("Photogallery","window.open('"+r_path+"photogallery/main.htm', '_self');");
   fw_menu_1.hideOnMouseOut=true;

   if (window.fw_menu_2) return;
  window.fw_menu_2 = new Menu("root",popup_wd*0.8,popup_ht,"Verdana, Arial, Helvetica, sans-serif",popup_fontsize,"#222222","#aa2222","#EEEEEE","#bbbbdd");
  fw_menu_2.addMenuItem("Home","window.open('"+r_path+"main.html', '_self');");
  fw_menu_2.addMenuItem("DOS Profile","window.open('"+r_path+"aboutDOS.htm', '_self');");
  fw_menu_2.addMenuItem("Mission","window.open('"+r_path+"membership/mission.htm', '_self');");
  fw_menu_2.addMenuItem("Officers","window.open('"+r_path+"officers.htm', '_self');");
   fw_menu_2.hideOnMouseOut=true;

  fw_menu_0.writeMenus();
} // fwLoadMenus()


offsetWidth=125
offsetHeight=65+2+20
topnav_height=18
function getXPos(e){
	if(document.layers){
		istr="i"+e.charAt(1)
		return document.images[istr].x;
	}
	else{
		return document.all["t0"].offsetLeft+document.all[e].offsetLeft+offsetWidth
	}
}
function getYPos(){
	if(document.layers){
		return document.images["i1"].y+topnav_height
	}
	else return document.all["t0"].offsetTop+offsetHeight
}
