// JavaScript Document

function getSpaceHistory() {
var datenow=new Date();
var intmonth = datenow.getMonth();
var intday = datenow.getDate();
var strmonth = '';

switch (intmonth)
{
case 0: strmonth = 'janary'; break;
case 1: strmonth = 'febary'; break;
case 2: strmonth = 'march'; break;
case 3: strmonth = 'april'; break;
case 4: strmonth = 'may'; break;
case 5: strmonth = 'june'; break;
case 6: strmonth = 'july'; break;
case 7: strmonth = 'august'; break;
case 8: strmonth = 'sepber'; break;
case 9: strmonth = 'octber'; break;
case 10: strmonth = 'novber'; break;
case 11: strmonth = 'decber'; break;
}	
if (intday < 10)
	intday='0'+intday;
var getsh="http://www.astronautix.com/thisday/"+strmonth+intday+".htm";
window.location.href=getsh;
}
function BasicSearch(retval) {
var vtext = ' ';
var ps1 = [{'caption': 'Search','url': 'http://ameslib.arc.nasa.gov'}];
var ss = ' ';
var ps = ' ';


switch (retval) {
	case 'home': {
		retval = GetRadioButton();
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'google': {
		vtext = document.google.searchtext1.value;
		break;
	}
	case 'sdaily': {
		vtext = document.sdaily.searchtext1.value;
		break;
	}
	case 'catalog': {
		vtext = document.catalog.searchtext1.value;
		break;
	}
	case 'worldcat': {
		vtext = document.worldcat.searchtext1.value;
		break;
	}
	break;
}

switch (retval) {
case 'catalog': {
	ss = 'http://nasagalaxie.larc.nasa.gov/uhtbin/cgisirsi/X/X/X/57/5/?user_id=AMES&searchdata1=' + vtext + '{GENERAL}';
	ps = 'Searching Library Catalog for `' + vtext + '`';
	var ga = ps + ","+ ss;
	ps1.push(ga);
	break;
}
case 'journals': {
    ss ='http://wv8eg8tg5v.search.serialssolutions.com/?V=1.0&N=100&L=WV8EG8TG5V&S=T_W_A&C=' + vtext;
	ps = 'Searching Journals for `' + vtext + '`';
	var jo = {'caption': ps, 'url': ss};
	ps1.push(jo);
	break;
}
case 'ntrs': {
    ss = 'http://ntrs.nasa.gov/search.jsp?N=0&Ntk=all&Ntx=mode%20matchall&Ntt=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
	var nt = {'caption': ps, 'url': ss};
	ps1.push(nt);
	break;
}
case 'google': {
    ss = 'http://scholar.google.com/scholar?q=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
	var nt = {'caption': ps, 'url': ss};
	ps1.push(nt);
	break;
}
case 'ieee': {
    ss = 'http://ieeexplore.ieee.org/search/searchresult.jsp?history=yes&queryText=%28%28' + vtext + '%29%3Cin%3Emetadata%29';
	ps = 'Searching IEEE Xplore for `' + vtext + '`';
	var ie = {'caption': ps, 'url': ss};
	ps1.push(ie);
	break;
}
case 'lanl': {
    ss = 'http://lanl.arxiv.org/find/all/1/ti:+' + vtext + '/0/1/0/all/0/1';
	ps = 'Searching LANL for `' + vtext + '`';
	var la = {'caption': ps, 'url': ss};
	ps1.push(la);
	break;
}
case 'nasd': {
    ss = 'http://adsabs.harvard.edu/cgi-bin/nph-basic_connect?qsearch=' + vtext + '&version=1';
	ps = 'Searching NASD for `' + vtext + '`';
	var na = {'caption': ps, 'url': ss};
	ps1.push(na);
	break;
}
case 'pubmed': {
    ss='http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=Search&db=PubMed&term='+vtext;
 //   ss = 'http://vsearch.nlm.nih.gov/vivisimo/cgi-bin/query-meta?v:project=nlm-main-website&query=' + vtext;
	ps = 'Searching PubMed for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'sdaily': {
    ss = 'http://www.sciencedaily.com/search/?keyword=' + vtext;
	ps = 'Searching Science Daily for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcat': {
    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}

default: {
	alert('hit default');
	break;
}
}
ps1.shift();
top.document.title = 'NASA Ames Library - Search - Search for :: ' + vtext ;
retval='';
//window.open(ss,"_blank");
return ss;
}


function BasicSearchpopup(retval) {
var vtext = ' ';
var ps1 = [{'caption': 'Search','url': 'http://ameslib.arc.nasa.gov'}];
var ss = ' ';
var ps = ' ';


switch (retval) {
	case 'home': {
		retval = GetRadioButton();
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'google': {
		vtext = document.google.searchtext1.value;
		break;
	}
	case 'sdaily': {
		vtext = document.sdaily.searchtext1.value;
		break;
	}
	case 'catalog': {
		vtext = document.catalog.searchtext1.value;
		break;
	}
	case 'worldcatall': {
		retval = GetRadioButton();
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'worldcatbks': {
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'worldcatdvr': {
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'worldcatcda': {
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'worldcatart': {
		vtext = document.homeform.searchtext1.value;
		break;
	}
	case 'scitopia': {
		vtext = document.homeform.searchtext1.value;
		break;
	}
	break;
}
switch (retval) {
case 'scitopia': {
	ss = 'http://www.scitopia.org/scitopia/resultList/fullRecord:' + vtext + '/';
	ps = 'Searching Scitopia for `' + vtext + '`';
	var ga = ps + ","+ ss;
	ps1.push(ga);
	break;
}
case 'catalog': {
	ss = 'http://nasagalaxie.larc.nasa.gov/uhtbin/cgisirsi/X/X/X/57/5/?user_id=AMES&library=AMES-E&searchdata1=' + vtext + '{GENERAL}';
	ps = 'Searching Library Catalog for `' + vtext + '`';
	var ga = ps + ","+ ss;
	ps1.push(ga);
	break;
}
case 'journals': {
    //ss ='http://wv8eg8tg5v.search.serialssolutions.com/?V=1.0&N=100&L=WV8EG8TG5V&S=T_W_A&C=' + vtext;
    ss ='journalsearch.php?V=1.0&N=100&L=WV8EG8TG5V&S=T_W_A&C=' + vtext;
	ps = 'Searching Journals for `' + vtext + '`';
	var jo = {'caption': ps, 'url': ss};
	ps1.push(jo);
	break;
}
case 'ntrs': {
    ss = 'http://ntrs.nasa.gov/search.jsp?N=0&Ntk=all&Ntx=mode%20matchall&Ntt=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
	var nt = {'caption': ps, 'url': ss};
	ps1.push(nt);
	break;
}
case 'google': {
    ss = 'http://scholar.google.com/scholar?q=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
	var nt = {'caption': ps, 'url': ss};
	ps1.push(nt);
	break;
}
case 'ieee': {
    ss = 'http://ieeexplore.ieee.org/search/searchresult.jsp?history=yes&queryText=%28%28' + vtext + '%29%3Cin%3Emetadata%29';
	ps = 'Searching IEEE Xplore for `' + vtext + '`';
	var ie = {'caption': ps, 'url': ss};
	ps1.push(ie);
	break;
}
case 'lanl': {
    ss = 'http://lanl.arxiv.org/find/all/1/ti:+' + vtext + '/0/1/0/all/0/1';
	ps = 'Searching LANL for `' + vtext + '`';
	var la = {'caption': ps, 'url': ss};
	ps1.push(la);
	break;
}
case 'nasd': {
    ss = 'http://adsabs.harvard.edu/cgi-bin/nph-basic_connect?qsearch=' + vtext + '&version=1';
	ps = 'Searching NASD for `' + vtext + '`';
	var na = {'caption': ps, 'url': ss};
	ps1.push(na);
	break;
}
case 'pubmed': {
    ss='http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=Search&db=PubMed&term='+vtext;
 //   ss = 'http://vsearch.nlm.nih.gov/vivisimo/cgi-bin/query-meta?v:project=nlm-main-website&query=' + vtext;
	ps = 'Searching PubMed for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'sdaily': {
    ss = 'http://www.sciencedaily.com/search/?keyword=' + vtext;
	ps = 'Searching Science Daily for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcatall': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcatbks': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
   ss = 'http://www.worldcat.org/search?qt=worldcat_org_bks&q=' + vtext + '&fq=dt%3Abks';
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcatdvr': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
   ss = 'http://www.worldcat.org/search?qt=worldcat_org_dvr&q=' + vtext + '&fq=dt%3Advr';
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcatcda': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;'&fq=fm%3Acda'
   ss = 'http://www.worldcat.org/search?qt=worldcat_org_cda&q=' + vtext +  '&fq=fm%3Acda';
	
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'worldcatart': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
    ss = 'http://www.worldcat.org/search?qt=worldcat_org_art&q=' + vtext + '&fq=dt%3Aart';
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
case 'me': {
//    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
    ss = 'http://search.arc.nasa.gov/search/?query=site:ameslib.arc.nasa.gov +' + vtext + '&hitsPerSite=0';
	ps = 'Searching WorldCat for `' + vtext + '`';
	var pm = {'caption': ps, 'url': ss};
	ps1.push(pm);
	break;
}
default: {
	alert('hit default');
	break;
}
}
ps1.shift();
top.document.title = 'NASA Ames Library - Search - Search for :: ' + vtext ;
//alert(ss);
//alert(retval);
if (retval=='journals')
	window.open(ss,"_self");
else
	window.open(ss,"_blank");
retval='';

//document.location.href=ss;
//return ss;
}
function cBack(req) {
	   var result = req.xhRequest.responseText;
		if (result)
			document.getElementById('ACcatalog').innerHTML=result;
}
function AdvancedSearch(retval) {
var vtext = ' ';
var ps1 = [{'caption': 'Search','url': 'http://ameslib.arc.nasa.gov'}];
var ss = ' ';
var ps = ' ';
var ch = '';

vtext = document.advform.searchtext1.value;

if  (document.advform.catalog.checked)
 {
	ss = 'http://nasagalaxie.larc.nasa.gov/uhtbin/cgisirsi/X/X/X/57/5/?user_id=AMES&searchdata1=' + vtext + '{GENERAL}';
	ps = 'Searching Library Catalog for `' + vtext + '`';
	alert(ss);
	Spry.Utils.updateContent('ACcatalog',ss);
//	var req = Spry.Utils.loadURL ("GET", ss, true, cBack('ACcatalog'));
}
if  (document.advform.journals.checked)
 {
    ss ='http://wv8eg8tg5v.search.serialssolutions.com/?V=1.0&N=100&L=WV8EG8TG5V&S=T_W_A&C=' + vtext;
	ps = 'Searching Journals for `' + vtext + '`';
}
if  (document.advform.ntrs.checked)
{
    ss = 'http://ntrs.nasa.gov/search.jsp?N=0&Ntk=all&Ntx=mode%20matchall&Ntt=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
}
if  (document.advform.google.checked)
{
    ss = 'http://scholar.google.com/scholar?q=' + vtext;
	ps = 'Searching NTRS for `' + vtext + '`';
}
if  (document.advform.ieee.checked)
{
	ss = 'http://ieeexplore.ieee.org/search/searchresult.jsp?history=yes&queryText=%28%28' + vtext + '%29%3Cin%3Emetadata%29';
	ps = 'Searching IEEE Xplore for `' + vtext + '`';
}
if  (document.advform.ieee.checked)
{
    ss = 'http://lanl.arxiv.org/find/all/1/ti:+' + vtext + '/0/1/0/all/0/1';
	ps = 'Searching LANL for `' + vtext + '`';
}
if  (document.advform.nasd.checked)
{
    ss = 'http://adsabs.harvard.edu/cgi-bin/nph-basic_connect?qsearch=' + vtext + '&version=1';
	ps = 'Searching NASD for `' + vtext + '`';
}
if  (document.advform.pubmed.checked)
{
    ss='http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=Search&db=PubMed&term='+vtext;
 //   ss = 'http://vsearch.nlm.nih.gov/vivisimo/cgi-bin/query-meta?v:project=nlm-main-website&query=' + vtext;
	ps = 'Searching PubMed for `' + vtext + '`';
}
if  (document.advform.ieee.checked)
{
    ss = 'http://www.sciencedaily.com/search/?keyword=' + vtext;
	ps = 'Searching Science Daily for `' + vtext + '`';
}
if  (document.advform.ieee.checked)
{
    ss = 'http://www.worldcat.org/search?qt=worldcat_org_all&q=' + vtext;
	ps = 'Searching WorldCat for `' + vtext + '`';
}
ps1.shift();
top.document.title = 'NASA Ames Library - Search - Search for :: ' + vtext ;
retval='';
//window.open(ss,"_blank");
return ss;
}
function doNASASearch() {
	vtext = document.search.NASASearchfield.value;
	window.open("http://search.nasa.gov/search/search.jsp?nasaInclude="+vtext);
}


