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("Spirit's Journey to the Center of Mars","Cool Movie: SDO Destroys a Sundog","3D Sun for the iPhone","Are TGFs Hazardous to Air Travelers?","Solar Dynamics Observatory: The 'Variable Sun' Mission");
var nasaScienceURL = new Array("http://science.nasa.gov/headlines/y2010/24feb_martiancore.htm","http://science.nasa.gov/headlines/y2010/18feb_coolmovie.htm","http://science.nasa.gov/headlines/y2010/17feb_3dsun.htm","http://science.nasa.gov/headlines/y2010/10feb_friendlyskies.htm","http://science.nasa.gov/headlines/y2010/05feb_sdo.htm");
var nasaScienceDates = new Array("Feb 24","Feb 18","Feb 17","Feb 10","Feb 5");
var nasaScienceIntro = new Array("NASA's venerable Mars rover Spirit is starting a second career as an explorer of the Martian core--but first it must survive the deadly Martian winter.","NASA's Solar Dynamics Observatory amazed onlookers last week when it flew past a sundog and destroyed it.  Must-see videos of the event captured shock waves from the rocket billowing through the sundog, eliciting cries of delight and amazement from the crowd below.","Imagine holding the entire sun in the palm of your hand. Now you can. A new iPhone app developed by NASA-supported programmers delivers a live global view of the sun directly to your cell phone.","Terrestrial gamma-ray flashes (TGFs) surge through thunderstorms at about the same altitude where commercial airliners fly. Do these blasts of gamma-radiation pose a hazard to air travelers?","The Solar Dynamics Observatory (SDO), slated for liftoff on Feb. 9th, will make IMAX-quality movies of solar explosions, peer beneath the stellar surface to see the sun's inner dynamo, and--researchers hope--unravel the mysteries of solar variability.");
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;
	}


