// **************
// script used to display navigation links & other pre-defined functions
// Written by: Conrad Matiuk, CUAHSI - November 08, 2005
// **************

// ** Domain redirect statements - top level & site specific
if (document.location=="http://www.hydrologicscience.org/wtbs/index.html") {window.location="http://www.watersnet.org/wtbs/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs01/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs01/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs02/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs02/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs03/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs03/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs04/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs04/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs05/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs05/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs06/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs06/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs07/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs07/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs08/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs08/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs09/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs09/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs10/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs10/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs11/index.html") {window.location="http://www.watersnet.org/wtbs/wtbs11/index.html"}
if (document.location=="http://www.hydrologicscience.org/wtbs/") {window.location="http://www.watersnet.org/wtbs/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs01/") {window.location="http://www.watersnet.org/wtbs/wtbs01/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs02/") {window.location="http://www.watersnet.org/wtbs/wtbs02/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs03/") {window.location="http://www.watersnet.org/wtbs/wtbs03/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs04/") {window.location="http://www.watersnet.org/wtbs/wtbs04/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs05/") {window.location="http://www.watersnet.org/wtbs/wtbs05/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs06/") {window.location="http://www.watersnet.org/wtbs/wtbs06/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs07/") {window.location="http://www.watersnet.org/wtbs/wtbs07/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs08/") {window.location="http://www.watersnet.org/wtbs/wtbs08/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs09/") {window.location="http://www.watersnet.org/wtbs/wtbs09/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs10/") {window.location="http://www.watersnet.org/wtbs/wtbs10/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs11/") {window.location="http://www.watersnet.org/wtbs/wtbs11/"}
if (document.location=="http://www.hydrologicscience.org/wtbs/wtbs11/ferrymon-abstract.pdf") {window.location="http://www.watersnet.org/wtbs/wtbs11/ferrymon-abstract.pdf"}
// ** Main navigation schema
function sidenav() {
document.write(
'<a href="index.html">WTBS Home</a>'
//+'<a href="about.html">about</a>'
//+'<a href="#">stuff</a>'
//+'<a href="#">more stuff</a>'
//+'<a href="#">still more stuff</a>'
//+'<a href="#">the most stuff</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org//his.html">CUAHSI HIS</a>'
+'<a href="http://www.cuahsi.org/index.html">CUAHSI Home</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
//+'<a href="http://geo.sdsc.edu/cuahsi/Forum/tabid/82/Default.aspx" target="_blank" class="devforum">developer\'s forum</a>'
);
} // end function

// ** "Test Bed Site" sub-set navigation schema
function wtbs_sidenav() {
document.write(
'<a href="../index.html">WTBS Home</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org//his.html">CUAHSI HIS</a>'
+'<a href="http://www.cuahsi.org/index.html">CUAHSI Home</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
);
} // end function

function wtbs_sidenav_20070227() {
document.write(
'<a href="../index.html">WTB Home</a>'
+'<a href="index.html">Site Home</a>'
+'<a href="#">Data</a>'
+'<a href="#">Bibliography</a>'
+'<a href="#">Personnel</a>'
+'<a href="#">Education</a>'
+'<a href="#">Information</a>'
+'<a href="#">Management</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
+'<a href="http://www.cuahsi.org/index.html">CUAHSI Home</a>'
+'<a href="#" style="background: beige;">&nbsp;</a>'
);
} // end function

// ** "sites" sub-set navigation schema
function sidenav_sites() {
document.write(
'<div id="pageNav"><div id="sectionLinks" class="hotbsites">Test Bed Sites</div></div>'
+'<form action="" method="post" name="hotbsites" id="hotbsites">'
+'<select name="select" onChange="MM_jumpMenu(\'parent\',this,1)" class="hotbsites" size="13">'
//+'<option value="#">* * * * * * * * * * * * * * *</option>'
+'<option value="../index.html">Test Bed Home</option>'
+'<option value="#">---------------------------</option>'
+'<option value="../wtbs01/index.html">San Joaquin River, CA</option>'
+'<option value="../wtbs02/index.html">Flathead River, MT</option>'
+'<option value="../wtbs03/index.html">Little Bear River, UT</option>'
+'<option value="../wtbs04/index.html">Clear Creek, IA</option>'
+'<option value="../wtbs05/index.html">Corpus Christi Bay, TX</option>'
+'<option value="../wtbs06/index.html">Minnehaha Creek, MN</option>'
+'<option value="../wtbs07/index.html">Santa Fe River, FL</option>'
+'<option value="../wtbs08/index.html">Susquehanna River, PA</option>'
//+'<option value="../wtbs09/index.html">Chesapeake Bay, PA</option>'
+'<option value="../wtbs10/index.html">Baltimore, MD</option>'
+'<option value="../wtbs11/index.html">Pamlico Sound, NC</option>'
+'</select>'
+'</form>'
);
} // end function

function disclaimer()
{
document.write('<p class="sm-text" style="margin-top: 0px;">This material is based upon work supported by the <strong>National Science Foundation</strong> (<a href="http://www.nsf.gov" target="_blanl">NSF</a>) under Grant Nos. 03-26064, 04-12975, and 04-47287.<br><br>Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the NSF.');
} // end function

function botnav() {
document.write(
'<div align="center">| <a href="http://www.cuahsi.org/index.html" title="link to home page">CUAHSI Home</a> | | <a href="http://www.hydrologicscience.org/his/feedback-form.cfm" title="link to feedback page">Feedback</a> |</dt>'
);
} // end function

function botnav_20070220() {
document.write(
'<div align="center"><a href="http://www.cuahsi.org/index.html" title="link to home page">CUAHSI Home</a> | <a href="about.html" title="link to about page">About</a> | <a href="#" title="link to stuff">Stuff</a> | <a href="#" title="link to more stuff">More Stuff</a> | <a href="#" title="link to a lot of stuff">A lot of stuff</a> | <a href="#" title="link to downloads page">Downloads</a> | <a href="http://www.hydrologicscience.org/his/feedback-form.cfm" title="link to feedback page">Feedback</a></dt>'
);
} // 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()) + "</dt>");
document.write("<div class='links'>URL: " + document.location.href + "</dt>"); 
}

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></dt>');
}

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>');
}

function menu_alert(thispage){
	alert(dayoftheweek() + "\n\n_________________ CUAHSI HIS _________________\n\nOur " + thispage + " page is currently under development.\n\n Thanks for your patience.\n\n_________________ CUAHSI HIS _________________");
} // end function
