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("What's Wrong with the Sun?","A Telescope Made of Moondust","New Discoveries at Mercury","Planets Align for the 4th of July","The Tunguska Impact--100 Years Later");
var nasaScienceURL = new Array("http://science.nasa.gov/headlines/y2008/11jul_solarcycleupdate.htm","http://science.nasa.gov/headlines/y2008/09jul_moonscope.htm","http://science.nasa.gov/headlines/y2008/03jul_mercuryupdate.htm","http://science.nasa.gov/headlines/y2008/01jul_4thofjuly.htm","http://science.nasa.gov/headlines/y2008/30jun_tunguska.htm");
var nasaScienceDates = new Array("Jul 11","Jul 9","Jul 3","Jul 1","Jun 30");
var nasaScienceIntro = new Array("The sun is entering its 3rd year of eerie calm.  Sunspots are rare and solar flares simply aren't happening.  Is this \"solar minimum\" lasting longer than it should? A NASA scientist has examined centuries of sunspot data to find the answer.","Mix moondust with epoxy, add a dash of carbon nanotubes, and spin. The result? A parabolic mirror perfectly suited for a lunar observatory.  A NASA scientist has discovered this new recipe for making telescopes out of moondust, and to prove it works he has spun a \"moondust mirror\" here on Earth.","Mercury's magnetic field is \"alive.\" Volcanic vents ring the planet's giant Caloris basin while the planet itself is surrounded by a plasma nebula of unexpected complexity.","Look beyond the fireworks on 4th of July weekend.  A trio of worlds is converging for a pretty sunset sky show. ","One hundred years after the Tunguska event in Siberia, scientists review what they've learned about the mysterious blast from the heavens. ");
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;
	}


