//This script will select 3 random text links and descriptions based on the "What's New" content 
//for the current month. Each selection consists of a title, description and URL and will 
//be displayed in the What's New section of the NRCCWDT home page.

//To update the What's New section, simply replace the descriptions[x], urls[x], and titles[x]
//arrays with the relevant content.
//08/20/04

//specify total # of links
var totallinks=4

//urls[x] contains the link to anchor on the whatsnew.html page
var urls=new Array(totallinks)
//descriptions[x] contains the description of the link
var descriptions=new Array(totallinks)
//titles[x] contains the name of the section from the What's New page (i.e. Conferences, Additional Reports, etc.)
var titles=new Array(totallinks)

//random number generator to be used as and index to the arrays
var RandomLink=Math.floor(Math.random()*totallinks)
var RandomLink1, RandomLink2=0

urls[0]="resources/nytd/nytd.html"
descriptions[0]="New! NYTD Webinar Materials..."
titles[0]="NYTD"

urls[1]="resources/afcars/afcars.html"
descriptions[1]="AFCARS NPRM Briefing from the Children's Bureau..."
titles[1]="AFCARS"

urls[2]="resources/cfsr/cfsr.html"
descriptions[2]="Updated CFSR Composites Syntax, Data Indicators and Composite..."
titles[2]="CFSR"

urls[3]="resources/toolkits.html"
descriptions[3]="The NRC-CWDT offers the following toolkits, which contain..."
titles[3]="Toolkits"


if (RandomLink+1 > totallinks-1)
	{
		RandomLink1=RandomLink-1;
	}
else
	{
		RandomLink1=RandomLink+1;
	}

if (RandomLink+2 > totallinks-1)
	{
		RandomLink2=RandomLink-2;
	}
else
	{
		RandomLink2=RandomLink+2;
	}

var cont="<span class='smLink'>"+titles[RandomLink]+"</span>"+" <a href='"+urls[RandomLink]+"'>"+descriptions[RandomLink]+"</a><br>"
cont+="<span class='smLink'>"+titles[RandomLink1]+"</span>"+" <a href='"+urls[RandomLink1]+"'>"+descriptions[RandomLink1]+"</a><br>"
cont+="<span class='smLink'>"+titles[RandomLink2]+"</span>"+" <a href='"+urls[RandomLink2]+"'>"+descriptions[RandomLink2]+"</a>"
