// **************
// script used to display navigation links & other pre-defined functions
// Written by: Conrad Matiuk, CUAHSI - November 08, 2005
// **************


// Root level navigation function
function sidenav_root() {
document.write(
'<a href="hmf-team.html">HMF Team</a>'
+'<a href="geo-index.html">Geophysics</a>'
+'<a href="#" onclick="menu_alert(\'Biogeochemistry\')">Biogeochemistry</a>'
+'<a href="#" onclick="menu_alert(\'Water Cycle\')">Water Cycle</a>'
+'<a href="handbook.html">Hydrologic Methods Handbook</a>'
+'<a href="whitepapers.html">White Papers</a>'
/*
+'<a href="bgc-index.html">Biogeochemistry</a>'
+'<a href="wc-index.html">Water Cycle</a>'
+'<a href="hmh-index.html">Hydrologic Methods Handbook</a>'
+'<a href="../docs/hmf-brief-200605.pdf" target="_blank">HMF News Brief</a>'
+'<a href="http://www.hydrologicscience.org/index.html">Hydro-Bay Marketplace</a>'
*/
+'<a href="#" style="background: #FFF8DC;">&nbsp;</a>'
+'<a href="../hmf.html">CUAHSI HMF</a>'
+'<a href="../index.html">CUAHSI Home</a>'
);
} // end function

// Geophysics level navigation function
function sidenav_geo() {
document.write(
'<a href="geo-index.html">Home</a>'
+'<a href="geo-partnerships.html">Forming Partnerships</a>'
//+'<a href="geo-activities.html">Geophysical Activities</a>'
+'<a href="geo-trips.html" class="sm-text">Proof of Concept Geophysics Support</a>'
//+'<a href="geo-activities-other.html">Other Activities</a>'
+'<a href="geo-committee.html">Advisory Group</a>'
+'<a href="#" style="background: #FFF8DC;">&nbsp;</a>'
//+'<a href="../docs/hmf-brief-200605.pdf" target="_blank">HMF News Brief</a>'
+'<a href="handbook.html">Hydrologic Methods Handbook</a>'
+'<a href="whitepapers.html">White Papers</a>'
+'<a href="hmf-team.html">HMF Team</a>'
+'<a href="#" style="background: #FFF8DC;">&nbsp;</a>'
+'<a href="../hmf.html">CUAHSI HMF</a>'
+'<a href="../index.html">CUAHSI Home</a>'
);
} // end function

// Sensor meeting sidenav function
function sidenav_science() {
document.write(
'<a href="index.html" style="text-align: center;" title="go to Science Meeting home page">Meeting Home</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="program.html" title="Program">Program (draft)</a>'
+'<a href="registration.html" title="Registration">Registration</a>'
+'<a href="opps.html" title="Participant Opportunities">Participant Opportunities</a>'
+'<a href="contacts.html" title="Contacts">Contacts</a>'
+'<a href="hotel.html" title="Hotel Information">Hotel Information</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="#" style="background: #369; color: #fff; text-align: center;">Related Sites</a>'
+'<a href="http://www.cuahsi.org/hmf/lake/index.html" title="go to HMF Lake Lacawac Workshop in Lake Lacawac, PA June 23-27">HMF Lake Lacawac Workshop<br>June 23-27, 2008</a>'
+'<a href="http://www.cuahsi.org/biennial/index.html" title="go to CUAHSI Biennial Science Meeting in Boulder July 16-18">CUAHSI Biennial Science Meeting<br>July 14-16, 2008</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org" title="go to CUAHSI home page">CUAHSI Home</a>'
);
} // end function

// Lake Workshop sidenav function
function sidenav_lake() {
document.write(
'<a href="index.html" style="text-align: center;" title="go to Lake Lacawac home page">Workshop Home</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="schedule.html" title="Schedule">Schedule</a>'
+'<a href="hotel.html" title="Fees & Accommodations">Fees & Accommodations</a>'
+'<a href="registration.html" title="Registration">Registration (<span style="color: red;">open</span>)</a>'
+'<a href="contacts.html" title="Contacts">Contacts</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="#" style="background: #369; color: #fff; text-align: center;">Related Sites</a>'
+'<a href="../../biennial/index.html" title="go to CUAHSI Biennial Science Meeting in Boulder July 14-16">CUAHSI Biennial Science Meeting<br>July 14-16, 2008</a>'
+'<a href="../dsw/index.html" title="go to HMF Distributed Sensor Workshop in Boulder July 16-18">HMF Sensor Workshop<br>July 16-18, 2008</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org" title="go to CUAHSI home page">CUAHSI Home</a>'
);
} // end function

// 2009 Sensor Workshop sidenav function
function sidenav_sensor() {
document.write(
'<a href="index.html" style="text-align: center;" title="go to Sensor Workshop home page">Workshop Home</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="program.html" title="Program:">Program</a>'
+'<a href="logistics.html" title="Fees & Logistics">Fees & Logistics</a>'
+'<a href="map.html" title="Interactive map">Interactive Map</a>'
+'<a href="field.html" title="Field Deployments">Field Deployments</a>'
+'<a href="instruments.html" title="Instrument information">Instrument Info</a>'
+'<a href="instructors.html" title="Contacts">Instructors</a>'
+'<a href="sensor-attendees.pdf" title="List of Attendees" target="_blank">Attendees (PDF)</a>'
+'<a href="join_sensors_list.html" title="Join the sensors listserv">Join the Listserv</a>'
//+'<a href="#" title="Registration">Registration (<span style="color: red;">closed</span>)</a>'
//+'<a href="http://guest.cvent.com/i.aspx?4W,M3,7c34d501-88b5-45d9-8375-98d947ba1194" title="Registration" target="_blank">Registration (<span style="color: red;">open</span>)</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="#" style="background: #369; color: #fff; text-align: center;">Related Sites</a>'
+'<a href="http://www.cuahsi.org/hmf.html" title="go to HMF Home page">HMF Home</a>'
+'<a href="#" style="background: beige; color: navy;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org" title="go to CUAHSI home page">CUAHSI Home</a>'
);
} // end function

// Sensor meeting level header function
function header_science()
{
document.write('<h3>HMF Hands-on Workshop | July 16-18, 2008 | Boulder, Colorado</h3><p><a href="index.html">Home</a> | <a href="program.html" title="Program">Program</a> | <a href="opps.html">Participant Opportunities</a> | <a href="contacts.html">Contacts</a> | <a href="registration.html">Registration</a></p>');
}

// Lake Workshop header function
function header_lake()
{
document.write('<h3>Groundwater/Surface Water Interaction Workshop <br> June 23-27, 2008 | Lake Lacawac, Pennsylvania</h3><p><a href="index.html">Workshop Home</a> | <a href="schedule.html" title="Schedule">Schedule</a> | <a href="hotel.html" title="Fees & Accommodations">Fees & Accommodations</a> | <a href="contacts.html">Contacts</a> | <a href="registration.html">Registration</a></p>');
}

// 2009 Sensor Workshop header function
function header_sensor()
{
document.write('<h3>CUAHSI/USGS/UVM Sensor Workshop: In situ Optical Sensors for Water Quality</h3><p><a href="index.html">Workshop Home</a> | <a href="program.html" title="Program">Program</a> | <a href="logistics.html" title="Fees & Logistics">Fees & Logistics</a> | <a href="instructors.html">Instructors</a> <!-- | <a href="http://guest.cvent.com/i.aspx?4W,M3,7c34d501-88b5-45d9-8375-98d947ba1194" target="_blank">Registration</a> --></p>');
}

// Sensor meeting level footer function
function footer_science()
{
document.write('<hr><a href="index.html">Meeting Home</a> | <a href="program.html" title="Program">Program</a> | <a href="opps.html">Participant Opportunities</a> | <a href="contacts.html">Contacts</a> | <a href="registration.html">Registration</a> | <a href="http://www.cuahsi.org">CUAHSI Home</a>');
}

// Lake Workshop footer function
function footer_lake()
{
document.write('<hr><a href="index.html">Workshop Home</a> | <a href="schedule.html" title="Schedule">Schedule</a> | <a href="hotel.html" title="Fees & Accommodations">Fees & Accommodations</a> | <a href="contacts.html">Contacts</a> | <a href="registration.html">Registration</a> | <a href="http://www.cuahsi.org">CUAHSI Home</a>');
}

// 2009 Sensor Workshop footer function
function footer_sensor()
{
document.write('<hr><a href="index.html">Workshop Home</a> | <a href="program.html" title="Program">Program</a> | <a href="logistics.html" title="Fees & Logistics">Fees & Logistics</a> | <a href="instructors.html">Instructors</a> <!-- | <a href="http://guest.cvent.com/i.aspx?4W,M3,7c34d501-88b5-45d9-8375-98d947ba1194" target="_blank">Registration</a> --> | <a href="http://www.cuahsi.org">CUAHSI Home</a>');
}

// Geophysics level footer function
function footer_geo() {
document.write('<div align="center"><a href="geo-index.html">Home</a> | <a href="geo-partnerships.html">Forming Partnerships</a> | <a href="geo-committee.html">Geophysics Committee</a></div>');
}
// end function

function footer_geo_20070703() {
document.write('<div align="center"><a href="geo-index.html">Home</a> | <a href="geo-partnerships.html">Forming Partnerships</a> | <a href="geo-activities.html">Geophysical Activities</a> | <a href="geo-activities-other.html">Other Activities</a> | <a href="geo-committee.html">Geophysics Committee</a></div>');
}
// end function

// Geophysics level footer function
function footer_root() {
document.write(
'<a href="hmf-team.html">Team</a> | '
+'<a href="geo-index.html">Geophysics</a> | '
+'<a href="#" onclick="menu_alert(\'Biogeochemistry\')">Biogeochemistry</a> | '
+'<a href="#" onclick="menu_alert(\'Water Cycle\')">Water Cycle</a> | '
+'<a href="handbook.html">Hydrologic Methods Handbook</a>'
//+'<a href="http://www.hydrologicscience.org/index.html">Hydro-Bay</a>'
);
} // end function

// end function

// General Date function variables

var today_date= new Date()
var day=today_date.getDay()
var month=today_date.getMonth()
var today=today_date.getDate()
//var year=today_date.getYear()
var year=today_date.getFullYear()
var days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var alert_date = 'days[day]+", "+months[month]+" "+today+", "+year'

// Functions to display date modified and URL
function makeArray0() 
{
	for (i = 0; i<makeArray0.arguments.length; i++)
	this[i] = makeArray0.arguments[i]; 
}

var days = new makeArray0("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new makeArray0('January','February','March','April','May','June','July','August','September','October','November','December');
				
function nths(day) 
{
	if (day == 1 || day == 21 || day == 31) return 'st';
	if (day == 2 || day == 22) return 'nd';
	if (day == 3 || day == 23) return 'rd';
	return 'th'; 
}
				
function getCorrectedYear(year) 
{
	year = year - 0;
	if (year < 70) return (2000 + year);
	if (year < 1900) return (1900 + year);
	return year;
}
				
function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function page_upd()
{				
var dateError = new Date(document.lastModified);
var date = new Date(getCorrectedYear(dateError.getYear()),dateError.getMonth(),dateError.getDate());
				
document.write("<div class='links'>Last updated on " + days[date.getDay()] + ", " + months[date.getMonth()] + " " + date.getDate() + nths(date.getDate()) + ", " + y2k(date.getYear()) + "</div>");
document.write("<div class='links'>URL: " + document.location.href + "</div>"); 
}

function last_upd()
{
document.write('<div align="center" style="margin: 0px; padding: 0px;" class="links"><script language="JavaScript">document.write("This page last updated: " + Date(document.lastModified))</script></div>');
}

function dayoftheweek()
{
//------------------------------------------------------+
// Purpose: display day of the week and date.           | 
//------------------------------------------------------+
//    Date    By  Description
// ----------	--- ------------------------------------+
// 09/11/1999 cm  Initial revision.                     |
//------------------------------------------------------+
  var date = new Date();
  var dow  = date.getDay();
  var mon  = date.getMonth() + 1;
  var day  = date.getDate();
  var year = date.getYear();
  switch(dow){
  case 0:
	dow = "Sunday";
	break;
  case 1:
	dow = "Monday";
	break;
  case 2:
	dow = "Tuesday";
	break;
  case 3:
	dow = "Wednesday";
	break;
  case 4:
	dow = "Thursday";
	break;
  case 5:
	dow = "Friday";
	break;
  case 6:
	dow = "Saturday";
	break;
	}
  var todayDate = dow + ', ' + mon + '/' + day + '/' + year;
//  document.write( todayDate );
return todayDate;
}

function reader()
{
document.write('<table width="95%"><tr bgcolor="#fff5ee"><td class="reader" style="border: thin solid #000066; padding: 10px;">You will need Adobe Acrobat Reader, available as a free download, to view some of the files on this Web site. Visit <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">Adobe\'s PDF Reader page</a> to learn more about PDF and to download the free Acrobat Reader.</td></tr></table>');
}

//------------------------------------------------
// Purpose: display and hide Executive minutes.
// -----------------------------------------------
//    Date    By  Description
// ----------	--- ------------------------------
// 11/09/2005 cm  Initial revision.
//------------------------------------------------
function blocking(nr)
{
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
	}
}

function hideall()
{
	if (document.layers)
	{
		document.layers['yr2006'].display = 'none';
		document.layers['yr2005'].display = 'none';
		document.layers['yr2004'].display = 'none';
		document.layers['yr2003'].display = 'none';
		document.layers['yr2002'].display = 'none';
		document.layers['yr2001'].display = 'none';
	}
	else if (document.all)
	{
		document.all['yr2006'].style.display = 'none';
		document.all['yr2005'].style.display = 'none';
		document.all['yr2004'].style.display = 'none';
		document.all['yr2003'].style.display = 'none';
		document.all['yr2002'].style.display = 'none';
		document.all['yr2001'].style.display = 'none';
	}
	else if (document.getElementById)
	{
		document.getElementById('yr2006').style.display = 'none';
		document.getElementById('yr2005').style.display = 'none';
		document.getElementById('yr2004').style.display = 'none';
		document.getElementById('yr2003').style.display = 'none';
		document.getElementById('yr2002').style.display = 'none';
		document.getElementById('yr2001').style.display = 'none';
	}
}

function menu_alert(thispage){
	alert(dayoftheweek() + "\n\n_________________ CUAHSI _________________\n\nOur " + thispage + " page is currently under development.\n\n Thanks for your patience.\n\n_________________ CUAHSI _________________");
} // end function
