// Script used to write news items into home page depending on a date check against the current date
//

var now 	= new Date();
var monthnumber = now.getMonth();
var thismonth	= monthnumber + 1;
  if (thismonth < 10) { thismonth = '0' + thismonth };
var monthday    = now.getDate();
  if (monthday < 10) { monthday = '0' + monthday };
var year        = now.getFullYear();
var today       = year+''+thismonth+''+monthday;

// Writes out date relevant content into the Meetings box on the home page
// and depending on passed parameter ('top1' or 'TBD') writes to both Watersnet home and TBD home pages
function newsItem(pg)
{
newsItem = new Array()

if (null==newsItem) newsItem = new Array();
var post=0;
newsItem[newsItem.length] = "20071031|top1|<dt style='margin-bottom: 0px; padding-bottom: 4px;'><strong><a href='http://www.cuahsi.org/meetings/index.html' class='info2' target='_blank'>CUAHSI Fall 2007 Regional Meetings</a></strong></dt>";
newsItem[newsItem.length] = "20071031|top1|<dt style='margin-bottom: 0px; margin-left: 6px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.cuahsi.org/meetings/rm-austin-20071005.html' class='info2' target='_blank'>Austin - Oct 05</a></dt>";
newsItem[newsItem.length] = "20071031|top1|<dt style='margin-bottom: 0px; margin-left: 6px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.cuahsi.org/meetings/rm-chicago-20071012.html' class='info2' target='_blank'>Chicago - Oct 12</a></dt>";
newsItem[newsItem.length] = "20071031|top1|<dt style='margin-bottom: 0px; margin-left: 6px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.cuahsi.org/meetings/rm-boise-20071026.html' class='info2' target='_blank'>Boise - Oct 26</a><hr></dt>";
newsItem[newsItem.length] = "20071023|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>October 22-23, 2007</strong><br>WATERS Test Bed Planning Meeting - Baltimore. MD<br><a href='http://www.cuahsi.org/meetings/waters-tb-20071022.html' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";

newsItem[newsItem.length] = "20070418|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>April 15-18, 2007</strong><br>Engineering Sustainability 2007<br>Pittsburgh, PA<br><a href='http://www.engr.pitt.edu/msi/2007conference/confmain.htm' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";
newsItem[newsItem.length] = "20070420|top1|<dt style='margin-bottom: 0px; padding-bottom: 0px;'><strong>April 15-20, 2007</strong><br>EGU General Assembly 2007<br>Vienna, Austria<br><a href='http://meetings.copernicus.org/egu2007/' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";
newsItem[newsItem.length] = "20070416|top1|<dt style='margin-bottom: 4px; margin-left: 8px; padding-bottom: 0px;'><strong>&#8226;&nbsp;April 16, 2007</strong><br><a href='http://www.cosis.net/members/meetings/sessions/oral_programme.php?p_id=245&s_id=4425' class='info2' target='_blank'>WATERS Network: An Environmental Observatory Initiative</a><br>Presentation Time: 1:45pm<br><a href='http://meetings.copernicus.org/egu2007/' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";

newsItem[newsItem.length] = "20070519|top1|<dt style='margin-bottom: 0px; padding-bottom: 0px;'><strong>May 15-19th, 2007</strong><br><a hre='http://content.asce.org/conferences/ewri2007/index.html' taget='_blank'>2007 World Environmental & Water Resources Conf.</a><br>Tampa, FL</dt>";
newsItem[newsItem.length] = "20070518|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>Sessions:</strong><br><a href='http://www.asce.org/conferences/tp/ewri2007.cfm?data=track&trackid=212' target='_blank'>NSF Environmental Observatories - Testbeds for Environmental Observatories I & II</a><br>May 17, 3:30-5:00pm &<br>May 18, 9:00-10:30am</dt>";

newsItem[newsItem.length] = "20070627|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>June 24-27, 2007</strong><br>ASEE Annual Conference & Exposition<br>Honolulu, HI<br><a href='http://www.asee.org/conferences/annual/2007/index.cfm' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";
newsItem[newsItem.length] = "20070801|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>July 28 - August 1, 2007</strong><br>2007 AEESP Conference<br>Blacksburg, VA<br><a href='http://www.cpe.vt.edu/aeesp/specialsession02.html' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";

newsItem[newsItem.length] = "20071214|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>December 10-14, 2007</strong><br>AGU Fall Meeting<br>San Francisco, CA<br><a href='http://www.agu.org/meetings/fm07/' class='info2' target='_blank'>&#8226;&nbsp;more information</a></dt>";
newsItem[newsItem.length] = "20071214|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><a href='http://www.agu.org/meetings/fm07/?content=search&show=detail&sessid=451' class='info2' target='_blank'><strong>Session H16:</strong> Recent Innovations in Environmental Sensing, Cyberinfrastructure and Observatories</a></dt>";
newsItem[newsItem.length] = "20080325|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>March 24-25, 2008</strong><br>Community Workshop<br><a href='workshop-20080324.html' class='info2'>&#8226;&nbsp;more information</a></dt>";
newsItem[newsItem.length] = "20080614|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>June 10-14, 2008</strong><br><a href='docs/ISSRM-session20080610.pdf' class='info2' target='_blank'><strong>Engaging Social Scientists in the WATERS Initiative</strong></a>: Special Sessions at the 2008 International Symposium on Society and Resource Management</dt>";
newsItem[newsItem.length] = "20080716|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>July 14-16, 2008</strong><br><a href='http://www.cuahsi.org/biennial/' class='info2' target='_blank'><strong>CUAHSI Biennial Colloquium on Hydrologic Science and Engineering</strong></a>: Resilience & Vulnerability of Natural and Managed Hydrologic Systems</dt>";
newsItem[newsItem.length] = "20080912|top1|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>September 9-12, 2008</strong><br><a href='http://www.iwa2008vienna.org/i8/' class='info2' target='_blank'><strong>International Water Association World Water Congress and Exhibition</strong></a>&#151;Vienna, Austria<br>Poster Presentation: Monitoring and modelling initiative to transform United States water resource management</dt>";

var page=pg
switch(page){
case 1:  //display for cuahsi home page - main and hmf listings
for(var i=0; i<newsItem.length; i++) {
    var parmlist = String(newsItem[i]).split("|");
//    var post=0;
    if (Number(parmlist[0]) >= today && (parmlist[1] == "top1" || parmlist[1] == "hmf")) {
		document.write( parmlist[2] );
		post++;
	}
}
    if (post==0) { document.write('<dt class="home">No current Meetings announcements.</dt>'); }
break
case 2:  //display for hmf home page - only hmf listings
for(var i=0; i<newsItem.length; i++) {
    var parmlist = String(newsItem[i]).split("|");
//    var post=0;
    if (Number(parmlist[0]) >= today && parmlist[1] == "hmf") {
		document.write( parmlist[2] );
		post++;
	}
}
    if (post==0) { document.write('<dt class="home">No current Meetings announcements.</dt>'); }
break
}  //end switch statement
}  //End newsItem function

// Writes out date relevant content into the Items of Interest box on the home page
function announceItem()
{
announceItem = new Array();

if (null==announceItem) announceItem = new Array();
announceItem[announceItem.length] = "20101231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/WATERS-SBE-Workshop-Report-Final-20091123.pdf' class='moreinfo' target='_blank'><strong>WATERS Network Social/Behavioral/Economic Science Agenda Workshop - Final Report</strong></a> (PDF; 42 pages, 1MB)<br><span style='font-size: 9px; color: red;'>Posted - 12/7/09</span><hr></dt>";
announceItem[announceItem.length] = "20091231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/WATERS_Network_SciencePlan_2009May15.pdf' class='moreinfo' target='_blank'><strong>Living in the Water Environment: the WATERS Network Science Plan</strong></a> (PDF; 85 pages, 6MB)<br><span style='font-size: 9px; color: red;'>Posted - 7/30/09</span><hr></dt>";
announceItem[announceItem.length] = "20091231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/WATERS Letter Report_FINAL.pdf' class='moreinfo' target='_blank'><strong>Letter Report Assessing the WATERS Network Science Plan</strong></a> (PDF; 11 pages, 198KB)<br><span style='font-size: 9px; color: red;'>Posted - 7/30/09</span><hr></dt>";
announceItem[announceItem.length] = "20091231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.watersnet.org/WNNApril2009.html' class='moreinfo' target='_blank'><strong>The WATERS Network April 2009 Newsletter</strong></a><hr></dt>";

/*
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/WatersNetwork-20080628.pdf' class='moreinfo' target='_blank'><strong>The WATERS Network: Transforming our Understanding of the Nation's Waters</strong></a> (PDF; 4 pages, 515KB)<br><span style='font-size: 9px; color: red;'>New - 6/30/08</span><hr></dt>";
announceItem[announceItem.length] = "20071215|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.kiiitv.com/news/8858912.html' class='moreinfo' target='_blank'>Dead Zone in Corpus Christi Bay</a> - Video news cast regarding <strong>Dr. Paul Montagna</strong> leading a team of researchers at the Harte Institute who are focusing in on a virtual dead zone in Corpus Christi bay.<br>&#8226;&nbsp;<a href='http://www.kiiitv.com/news/8858912.html' target='_blank' class='moreinfo'>more information</a></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<strong>Science, Education, and Design Strategy for the WATer and Environmental Research Systems Network (SEDS) - February 27, 2008<br>&#8226;&nbsp;<a href='http://www.watersnet.org/docs/SEDS-20080227-draft.pdf' target='_blank' class='moreinfo'>Main document (draft)</a><br>&#8226;&nbsp;<a href='http://www.watersnet.org/docs/SEDS-20080227-appendices.pdf' target='_blank' class='moreinfo'>Appendices (All)</a><br>&#8226;&nbsp;<a href='http://www.watersnet.org/docs/SEDS-20080227-Appendix-A.pdf' target='_blank' class='moreinfo'>Appendix A</a><br>&#8226;&nbsp;<a href='http://www.watersnet.org/docs/SEDS-20080227-Appendix-B.pdf' target='_blank' class='moreinfo'>Appendix B</a><br>&#8226;&nbsp;<a href='http://www.watersnet.org/docs/SEDS-20080227-Appendix-C.pdf' target='_blank' class='moreinfo'>Appendix C</a><br>&#8226;&nbsp;<strong><a href='http://blog.watersnet.org/' target='_blank' class='moreinfo'>Comment Blog</a><hr></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<strong><a href='http://blog.watersnet.org/' target='_blank' class='moreinfo'>Comment Blog</a></strong></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'><strong>March 24-25, 2008</strong><br>Community Workshop<br><a href='workshop-20080324.html' class='info2'>&#8226;&nbsp;more information</a></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.tvworldwide.com/events/waters_network/080324/' target='_blank' class='moreinfo'>Community workshop presentations archive</a><hr></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/NoO-Chf-Sci.pdf' class='moreinfo' target='_blank'>Notice of Opportunity: WNPO Chief Scientist/ Engineer</a> - <strong><span style='font-size: 9px;'>Due Feb 17, 2008</span></strong></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/RFI-Fnl.pdf' class='moreinfo' target='_blank'>WATERS Network Request for Information</a> - <strong><span style='font-size: 9px;'>Due April 7, 2008</span></strong></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='docs/WATERS-Bckgrd.pdf' class='moreinfo' target='_blank'>WATERS Network Background and Next Steps</a><hr></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<strong>Environmental Observatory Operations Baltimore  Meeting</strong><br><a href='http://www.cuahsi.org/meetings/wtb-presentations.html' class='moreinfo' target='_blank'>10/22-23/07 Materials</a><hr></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<strong>Environmental Science & Technology</strong> October 1 edition article - <a href='http://pubs.acs.org/subscribe/journals/esthag/41/i19/pdf/100107feature_waters.pdf' class='moreinfo' target='_blank'>The WATERS Network: An Integrated Environmental Observatory Network for Water Research</a> (PDF; 6 pages, 710KB)<br><span style='font-size: 9px;'>Copyright © 2007 American Chemical Society</span></dt>";
announceItem[announceItem.length] = "20081231|<dt style='margin-bottom: 4px; padding-bottom: 0px;'>&#8226;&nbsp;<a href='http://www.unc.edu/ims/paerllab/research/ferrymon/news.htm' class='moreinfo' target='_blank'><strong>FerryMon News Video</strong></a></dt>";
*/

for(var x=0; x<announceItem.length; x++) {
    var parmlist = String(announceItem[x]).split("|");
    var post=0;
    if (Number(parmlist[0]) >= today) {
	document.write( parmlist[1] );
	post++;
	}
}
    if (post==0) { document.write('<dt class="home">No current News announcements.</dt>'); }
}  //End announceItem function

// Writes out date relevant content into the main content area of the home page - NOT USED ON WATERSNET, yet
function mainItem()
{
mainItem = new Array()

if (null==mainItem) mainItem = new Array();
mainItem[mainItem.length] = "20070321|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#8226;&nbsp;<strong>ESA Webcast Offers Q&A on the Educational and Scientific Uses of NEON</strong> - March 21, 2007<br>&#151;&nbsp;<a href='esa.html' class='moreinfo'>more information</a>";
mainItem[mainItem.length] = "20070401|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#8226;&nbsp;<strong>Call for Abstracts for 234th National ACS August 19-23, 2007 meeting - </strong>Due April 01, 2007<br>&#151;&nbsp;<a href='docs/acs-call-200708.pdf' class='moreinfo' target='_blank'>more information</a>";
mainItem[mainItem.length] = "20070331|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#149;&nbsp;<a href='docs/nsf_adgeosearch_070112.pdf' class='moreinfo' target='_blank'>Nomination of Candidates for Associate Director, Geosciences, NSF</a> <strong><br>&#151; Nominations deadline: March 31, 2007.</strong><br>";

mainItem[mainItem.length] = "20070515|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#8226;&nbsp;CUAHSI announces the release of the CUAHSI Science Plan, <strong><em>Hydrology of a Dynamic Earth: A Decadal Research Plan for Hydrologic Science</em></strong>, for your review and comment.<br>&#151;&nbsp;<a href='SciPlan-20070402.html' class='moreinfo'>download science plan</a>";
mainItem[mainItem.length] = "20071231|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#8226;&nbsp;<a href='http://www.hydrologicscience.org/wtbs/index.html' class='moreinfo' target='_blank'>WATERS Test Bed Sites</a> - These two-year projects will be developing technologies ranging from collection of data from floating sensors to determining optimal placement of real-time nitrate sensors.<br>&#151;&nbsp;<a href='http://www.hydrologicscience.org/wtbs/index.html' target='_blank' class='moreinfo'>more information</a>";

mainItem[mainItem.length] = "20070430|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#149;&nbsp;<a href='http://www.santacruzsentinel.com/archive/2007/April/01/local/stories/03local.htm' class='moreinfo' target='_blank'>Global warming could be economic boon for some</a> <strong><br>&#151; from the Santa Cruz Sentinel.com</strong>";
mainItem[mainItem.length] = "20071231|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#149;&nbsp;<a href='wmp-videos.html' class='moreinfo'>Three Short Videos About Water</a> <strong><br>&#151; Available to view or download.</strong>";
mainItem[mainItem.length] = "20071231|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#149;&nbsp;<a href='his/austin-agenda.html' class='moreinfo'>Austin Workshop PowerPoint Presentations & Videos</a> <strong><br>&#151; Available on-line.</strong>";
mainItem[mainItem.length] = "20071231|<p class='mainI' style='margin: 0px; padding-bottom: 6px;'>&#149;&nbsp;<a href='http://www.hydrologicscience.org/pub/talks.html' class='moreinfo' target='_blank'>PUB Workshop Speakers\' Presentations</a><br>&#151; <strong>Available on-line.</strong></p>";

mainItem[mainItem.length] = "20071201|<hr><h5>Upcoming Cyberseminars</h5><dl style='margin-bottom: 0;'>";
mainItem[mainItem.length] = "20070209|<dt class='mainI'><strong><a href='sem-current.html#0209'>February 9, 2007</a></strong>; 3:00pm ET<ul style='margin-bottom: 0px;'><li><strong>Andrew Binley</strong>, Department of Environmental Science, Lancaster University, U.K. Center</li></ul></dt>";
//mainItem[mainItem.length] = "20070413|<dt class='mainI'><strong><a href='sem-current.html#0413'>April 13, 2007</a></strong>; 3:00pm ET<ul><li><strong>David Goodrich</strong>, USDA-ARS Southwest Watershed Research Center, Tucson, AZ</li></ul></dt>";
mainItem[mainItem.length] = "20070507|<dt class='mainI'><strong><a href='sem-current.html#0504'>May 4, 2007</a></strong>; 3:00pm ET<ul><li><strong>John Selker</strong>, Professor - Department of Biological & Ecological Engineering - Oregon State University</li></ul></dt>";

mainItem[mainItem.length] = "20070913|<hr><h5>NSF program solicitation(s):</h5>";
mainItem[mainItem.length] = "20070202|<p class='mainI' style='margin-bottom: 0px;'><a href='http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=500044&org=NSF&from=fund' target='_blank' class='moreinfo'>Critical Zone Observatories (CZO)</a><br>Letter of Intent Deadline Date:  <strong>October 2, 2006</strong>.<br>Full Proposal Deadline Date:  <strong>February 2, 2007</strong>.<p style='text-indent: 2.0em; margin-top: 0;' class='mainI'><a href='http://www.nsf.gov/publications/pub_summ.jsp?ods_key=nsf06588' target='_blank' class='moreinfo'>More NSF information</a>&nbsp;&#124;&nbsp;<a href='docs/CZO-20060728.pdf' target='_blank' class='moreinfo'>Letter from CUAHSI Executive Director</a>.";
mainItem[mainItem.length] = "20070125|<p class='mainI' style='margin-bottom: 0px;'><a href='http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=5260' target='_blank' class='moreinfo'>Major Research Instrumentation Program (MRI)</a><br>Full Proposal Deadline Date:  <strong>January 25, 2007</strong>.<p style='text-indent: 2.0em; margin-top: 0;' class='mainI'><a href='http://www.nsf.gov/publications/pub_summ.jsp?ods_key=nsf07510' target='_blank' class='moreinfo'>More NSF information</a>.";
mainItem[mainItem.length] = "20080213|<p class='mainI' style='margin-bottom: 0px;'><a href='http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=6186' target='_blank' class='moreinfo'>Earth Sciences: Instrumentation and Facilities (EAR/IF)</a><br>Full Proposal Deadline Date: <strong>July 11, 2007</strong><br><p style='text-indent: 2.0em; margin-top: 0;' class='mainI'>Geoinformatics Proposals will only be accepted at the July Target Date in odd years</span><br>Full Proposal Deadline Date: <strong>February 13, 2008</strong><p style='text-indent: 2.0em; margin-top: 0;' class='mainI'><a href='http://www.nsf.gov/publications/pub_summ.jsp?ods_key=nsf06576' target='_blank' class='moreinfo'>More NSF information</a>.";

for(var i=0; i<mainItem.length; i++) {
    var parmlist = String(mainItem[i]).split("|");
    var post=0;
    if (Number(parmlist[0]) >= today) {
	document.write( parmlist[1] );
	post++;
	}
}
//    if (post==0) { document.write('<dt class="home">No current Cyberseminars are scheduled. Please check back.</dt>'); }
}  //End mainItem function
