// JavaScript Document


//DISPLAY RANDOM TEXT
function displayRandomText() {			

var currentIndex = 0;
var randomText = new Array();
							
	randomText[0] = "In 2007, one-quarter of major roadways in the nation’s major metropolitan areas – Interstates, freeways and other principal arterial routes – had pavements that were rated in poor condition and provided an unacceptably rough ride to motorists.  ";
	randomText[1] = "12 percent of America’s major roadways are in poor condition. ";
	randomText[2] = "One in four of the nation’s bridges are either in need of significant repair or are too narrow to handle today’s traffic.  ";
	randomText[3] = "In 2008, 12 percent of the nation’s bridges in had significant deterioration of their deck, supports or other major components.  ";
	randomText[4] = "Thirteen percent of the nation’s bridges no longer meet current highway standards, often because of narrow lanes, inadequate clearances or poor alignment with the approaching roadway.";
	randomText[5] = "The average age of the nation’s bridges is 43 years.  Most bridges need significant repairs by the time they reach 50 years of age.";
	randomText[6] = "Fifty-nine percent of the nation’s transit buses (40-feet or longer) have either exceeded their service life or will do so within the next six years.";
	randomText[7] = "Half of all of the nation’s transit rail cars have either exceeded their service life or will do so within the next six years.";
	randomText[8] = "The average rush hour commuter spends an additional 38 hours annually – an average work week - stuck in traffic. This figure is up from 14 hours in 1982.";
	randomText[9] = "The length of “rush hour” doubled in the nation’s urban areas from three hours in 1982 to six hours in 2005. ";
	randomText[10] = "Twenty-eight urban areas experience 40 or more hours of delay as a result of traffic congestion.";
	randomText[11] = "Almost one half of the nation’s urban Interstates, highways or freeways are considered congested.";
	randomText[12] = "Nearly 80 percent of the nation’s freight moves by trucks on the roads.";
	randomText[13] = "Freight highway bottlenecks are causing hundreds of millions of hours in delays annually, costing almost $8 billion a year.";	
							
	document.write(randomText[Math.floor(Math.random()*(randomText.length))]);
}

//DISPLAY RANDOM IMAGE
function initArray() {
	this.length = initArray.arguments.length;
	
	for (var i=0; i<this.length; i++) {
		this[i] = initArray.arguments[i];
	}
}


// Photograph image source
arrImage = new initArray(
"images/banner1.jpg",
"images/banner2.jpg",
"images/banner3.jpg",
"images/banner4.jpg",
"images/banner5.jpg",
"images/banner6.jpg",
"images/banner7.jpg",
"images/banner8.jpg",
"images/banner9.jpg",
"images/banner10.jpg",
"images/banner11.jpg",
"images/banner12.jpg",
"images/banner13.jpg",
"images/banner14.jpg"
);

var iRandomIndex =  Math.round(Math.random() * (arrImage.length - 1));
var strImage = arrImage[iRandomIndex];

function displayFormAndRandomBackground() {
	document.write("<div style=\"background-image:url(" + strImage + "); height:300px;\">\n");
	createform();
	document.write("</div>");
}

//DROP DOWN FORM
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function createform(){
	//display drop down list on top of rotating graphic.
	document.write("<div id='rotating_graphic'>\n");
	document.write("<form action='' method='post' target='_parent'>\n");
	document.write("<div id='dropdownlist'>\n");
	document.write("<select name='Key_Issues_Select' onchange=MM_jumpMenu('parent',this,0)>");
	document.write("<option value='#' selected='selected'>-- Select a Topic --</option>");
	document.write("<option value='Congestion.html'>Congestion</option>");
	document.write("<option value='HighwaysAndBridges.html'>Highways and Bridges</option>");
	document.write("<option value='Safety.html'>Safety</option>')");
	document.write("<option value='MassTransit.html'>Mass Transit</option>");
	document.write("<option value='Freight.html'>Freight</option>");
	document.write("<option value='Reform.html'>Reform</option>");
	document.write("<option value='TheInterstateHighwaySystem.html'>The Interstate System</option>");
	document.write("<option value='Environment.html'>Environment</option>");
	document.write("<option value='http://www.transportation.org/?siteid=99'>Economic Recovery</option>");
	document.write("<option value='FinancingSystem.html'>Financing the System</option>");
	document.write("<option value='http://transportationtv.org/'>Transportation TV</option>");
	document.write("</select>\n");
	document.write(" </div>\n");
	document.write("</form>\n");
	document.write(" </div>\n");
	
}