var nasaLOTitles = new Array("The Human Advantage","Rex Walheim--Space Station Construction Worker","Spending The Summer In Space","Leland Melvin--Playing For NASA's Team","Inspiring The Next Generation...");
var nasaLOURL = new Array("http://liftoff.msfc.nasa.gov/news/2003/news-human.asp","http://liftoff.msfc.nasa.gov/news/2003/news-Walheim.asp","http://liftoff.msfc.nasa.gov/news/2003/news-summer.asp","http://liftoff.msfc.nasa.gov/news/2003/news-Melvin.asp","http://liftoff.msfc.nasa.gov/news/2003/news-edspace.asp");
var nasaLODates = new Array("Sep 23","Sep 16","Sep 9","Sep 2","Aug 26");
var nasaLOIntro = new Array("Robots and computers play an important part in today's space program, but there are some things they just can't do.  Learn more about the benefits of having human hands and minds involved","On his first spaceflight, Rex Walheim participated in the construction of the International Space Station during two space walks.  Learn more about his exciting experience","While most people were catching rays and playing baseball all summer, an astronaut and a cosmonaut were having a very different summer.  The Expedition 7 Crew spent their summer in space","Leland Melvin, a former pro football player, is now a member of a very different team","Among NASA's next class of astronauts will be a special group of educator astronauts.  These former teachers will have the job of inspiring today's youth");
var nasaScienceTitles = new Array("SOFIA Seeks Secrets of Planetary Birth","LCROSS Finds Water on the Moon","Can Spirit be Freed?","The 2009 Leonid Meteor Shower","A Tale of Planetary Woe");
var nasaScienceURL = new Array("http://science.nasa.gov/headlines/y2009/19nov_sofia.htm","http://science.nasa.gov/headlines/y2009/13nov_lcrossresults.htm","http://science.nasa.gov/headlines/y2009/12nov_freespirit.htm","http://science.nasa.gov/headlines/y2009/10nov_leonids2009.htm","http://science.nasa.gov/headlines/y2009/06nov_maven.htm");
var nasaScienceDates = new Array("Nov 19","Nov 13","Nov 12","Nov 10","Nov 6");
var nasaScienceIntro = new Array("Imagine cutting retractable doors in the side of a 747 airliner, installing a 17-ton telescope, and flying to the stratosphere to solve one of astronomy's greatest puzzles. That's what NASA and the German Aerospace Center plan to do with a cutting-edge airborne observatory named SOFIA.","The argument that the Moon is a dry, desolate place no longer holds water. At a press conference today, researchers revealed  data from NASA's LCROSS mission indicating that water exists in a permanently shadowed lunar crater.","On Monday, NASA will begin transmitting commands to its Mars exploration rover Spirit as part of an escape plan to free the venerable robot from its Martian sand trap.","The 2009 Leonid meteor shower peaks on Nov. 17th with a sprinkling of meteors over North America and a possible outburst over Asia.","Long ago, something calamitous happened to Mars, transforming a hospitable world into the apparently lifeless desert we see today.  Many scientists believe the Red Planet lost most of its atmosphere, but how?  A new NASA mission named MAVEN is specifically designed to answer that question. ");
var nasaCalTitles = new Array("16th ESA Symposium on European Rocket and Balloon Programmes and Related Research, St. Gallen, Switzerland.","RHESSI Workshop: Distribution Functions of Energetic Flare Particles, Glasgow, Scotland","The Lowell Star Party, Flagstaff, Arizona");
var nasaCalURL = new Array("http://www.spaceflight.esa.int/users/file.cfm?filename=coord-symp-pac","http://www.astro.gla.ac.uk/users/eduard/rhessi/workshop/","http://www.lowell.edu/Public/lsp/");
var nasaCalDate ="Jun 5";
function nasaShowHeadline(site, start, count) {
	var titles = null;
	var dates = null;
	var urls = null;

	if (site == "Science") {
		titles = nasaScienceTitles;
		urls = nasaScienceURL;
		intros = nasaScienceIntro;
		dates = nasaScienceDates;
		document.writeln("<b><a href=\"http://science.nasa.gov/\">Science @ NASA</a></b><br>");
	} else if (site == "Liftoff") {
		titles = nasaLOTitles;
		urls = nasaLOURL;
		intros = nasaLOIntro;
		dates = nasaLODates;
		document.writeln("<b><a href=\"http://liftoff.msfc.nasa.gov/\">LIFTOFF News</a></b><br>");
	}

	for (i = start-1; i < count && i <  titles.length; i++) {
            document.writeln(dates[i] + ": " + "<a href=\"" + urls[i] + "\">" + titles[i] + "</A><br>");
	}
}

function nasaShowLeadIn(site, start, count) {
	var titles = null;
	var dates = null;
	var urls = null;
	var intros = null;

	if (site == "Science") {
		titles = nasaScienceTitles;
		urls = nasaScienceURL;
		intros = nasaScienceIntro;
		dates = nasaScienceDates;
		document.writeln("<b><a href=\"http://science.nasa.gov/\">Science @ NASA</a></b><br>");
	} else if (site == "Liftoff") {
		titles = nasaLOTitles;
		urls = nasaLOURL;
		intros = nasaLOIntro;
		dates = nasaLODates;
		document.writeln("<b><a href=\"http://liftoff.msfc.nasa.gov/\">LIFTOFF News</a></b><br>");
	}

	for (i = start-1; i < count && i <  titles.length; i++) {
		document.writeln(dates[i] + ": <A HREF=\"" + urls[i] + "\"><b>" + titles[i] + "</b></A><BR>" + intros[i] + "<P>");
	}
}

function nasaShowCal() {
	document.writeln("<a href=\"http://liftoff.msfc.nasa.gov/\"><b>Space Calendar - " + nasaCalDate + "</b></a><br>");
	for (i = 0; i < nasaCalTitles.length; i++) {
		document.writeln("* <A HREF=\"" + nasaCalURL[i] + "\">" + nasaCalTitles[i] + "</A><BR>");
	}
}

	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function Spanish_Link_fix() { //v3.0

		document.getElementById('espanol').href="http://Ciencia.nasa.gov" + location.pathname + location.search;
	}


