var a = unescape(location.search);
if(a) {
	var b = a.split('?')[1];
	var c = b.split('&')[0];
	var p = c.split('=')[1];
} else {
	var b = "null";
	var c = "null";
	var p = "null";
}
var URLtoOpen = "null";
var windowName = "null";
var windowFeatures = "null";


//Get page name and send it to Flash
function doPassVar() {
	window.document.myFlash.SetVariable("p", p);
	window.document.myFlash.Play();
}
function showpage() {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=612 HEIGHT=400 name="myFlash" id="myFlash">');
	document.write('<PARAM NAME=movie VALUE="bg.swf');
	if(p != "null") {
		document.write('?p=');
		document.write(p);
	}
	document.write('">');
	document.write('<PARAM NAME=loop VALUE=false>');
	document.write('<PARAM NAME=menu VALUE=false>');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=bgcolor VALUE=#000000>');
	document.write('<param name="swliveconnect" value="true">');
	document.write('<EMBED src="bg.swf');
	if(p != "null") {
		document.write('?p=');
		document.write(p);
	}
	document.write('" loop=false menu=false quality=high bgcolor=#000000 WIDTH=612 HEIGHT=400 name="myFlash" swliveconnect="true" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.write('</OBJECT>');
}

//Open a new browser window
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
	if(URLtoOpen == 0 || URLtoOpen == "null" || URLtoOpen == "") {
		URLtoOpen = 'http://scifiles.larc.nasa.gov/';
	}
	if(windowName == 0 || windowName == "null" || windowName == "") {
		windowName = 'scifiles';
	}
	if(windowFeatures == 0 || windowFeatures == "null" || windowFeatures == "") {
		windowFeatures = 'screenX=0,screenY=0,height=400,width=630,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes';
	}
	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
	if (newWindow.opener == null) newWindow.opener = self;
	newWindow.focus();
}


//Load page into parent/opener window (used for site map)
function load(file,target) {
    if (target != '') {
        target.window.location.href = file;
    } else {
        window.location.href = file;
	}
}
