
 /// generic window closer
function CloseWindow()
	{
	self.close();
	}
 
 /// explicit, standalone popup function
function PopupDisplayExp(url,window_name,width,height,xtra_features,xtra_parameter)
        {
        if (xtra_features != null)
                xtra_features = ","+xtra_features;
	if (xtra_parameter != null)
                url = url+"?"+xtra_parameter;
        var popup = window.open(url,window_name,"width="+width+",height="+height+xtra_features);
        popup.focus();
        }
         

///// set library arrays /////
var URL = new Array();
var PopupName = new Array();
var PopupType = new Array();
var Width = new Array(); 
var Height = new Array();
var Xtra_features = new Array();
/////////////////////////////



////////////// popup library ///////////////////

 /// SPACE Trivia
URL['trivia'] = 'http://www.space.com/php/trivia/index.php';
PopupName['trivia'] = 'trivia';
Width['trivia'] = 644; 
Height['trivia'] = 490;


 /// Earth Facts
URL['earthfacts'] = 'http://www.livescience.com/php/trivia/earthfacts/index.php';
PopupName['earthfacts'] = 'earthfacts';
Width['earthfacts'] = 644; 
Height['earthfacts'] = 490;

 /// multimedia player
URL['mmplayer']='http://www.space.com/php/popup/mediaplayer/noad_frameset.php';
PopupName['mmplayer'] = 'MultimediaPlayer';
Width['mmplayer'] = 737;
Height['mmplayer'] = 520;
// 020605
//Width['mmplayer'] = 595;
//Height['mmplayer'] = 447;
// 040918
//Width['mmplayer'] = 612;
//Height['mmplayer'] = 500;


 /// image gallery viewer
URL['imagegallery']='http://www.livescience.com/php/multimedia/imagegallery/igviewer.php';
PopupName['imagegallery'] = 'Media';
Width['imagegallery'] = 630;
Height['imagegallery'] = 573;
PopupType['imagegallery'] = 'fullscreen';



/// Healthination PopUp
URL['healthination'] = 'http://www.livescience.com/health/healthination/healthiplayer.php';
PopupName['healthination'] = 'healthination';
Width['healthination'] = 814; 
Height['healthination'] = 665;


////////////////////////////////////////////////




 /// popup function, driven by library array indexes
function PopupDisplay(name,query_str) {
	self.name='mainspace'; 	/// WIM 040918
        if (URL[name] == null)
                return;
        var url = URL[name];
        if (query_str !=  null)
                url = url+'?'+query_str;
        var features = "width="+Width[name]+",height="+Height[name];
        if (Xtra_features[name] != null)
                features = features+','+Xtra_features[name];
	if(PopupType[name] == 'fullscreen') {
		window.location=url;
	} else {
		var popup=window.open(url,PopupName[name],features);
	        popup.focus();
	}
        }

//*** video launcher props ***/
var vidprops ='width=814,height=665,screenX=130,left=130,screenY=50,top=50,resizable=no,scrollbars=no';
function flashvideo_launch(url,popup) {
	// removing popups 04/20/07 JLB
	// make popups toggleable for healthinaion 10/07/08 JLB
	if(popup) {
		window.open(url,'vidplayer', vidprops);
	}else {
		location.href=url;
	}
}


