//// array-based popup library
//// includes explicit function
//// WIMartin 001220
 
 /// 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 ///////////////////

 /// Virtual Space Tour
// URL['virtualtour'] = 'http://www.space.com/php/popup/virtualspacetour/noad_frameset.php';
URL['virtualtour'] = 'http://www.space.com/php/popup/virtualspacetour/noad_astropedia.php';
PopupName['virtualtour'] = 'virtualtour';
Width['virtualtour'] = 780; 
Height['virtualtour'] = 582;

 /// 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;

 /// Alien vs. Predator Trivia
URL['avp'] = 'http://www.space.com/php/trivia/avp/index.php';
PopupName['avp'] = 'avp';
Width['avp'] = 644; 
Height['avp'] = 490;

 /// Starry Night 
URL['sn'] = 'http://www.starrynight.com/promo/shipping.html';
PopupName['sn'] = 'sn';
Width['sn'] = 400;
Height['sn'] = 400;


 /// 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;

 /// multimedia player w/ skin
URL['skin_mmplayer']='http://www.space.com/php/popup/mediaplayer/noad_skinframeset.php';
PopupName['skin_mmplayer'] = 'SkinMultimediaPlayer';
Width['skin_mmplayer'] = 737;  
Height['skin_mmplayer'] = 528;


 /// image gallery viewer
URL['imagegallery']='http://www.space.com/php/multimedia/imagegallery/igviewer.php';
PopupName['imagegallery'] = 'Media';
PopupType['imagegallery'] = 'fullscreen';

 /// imagepump viewer a.k.a Universal Viewer
URL['imagepump'] = 'http://www.space.com/php/popup/imagepump/noad_frameset.php';
PopupName['imagepump'] = 'UniversalViewer';
Width['imagepump'] = 600;
Height['imagepump'] = 440;


 /// Universal Sky Tour movie player
URL['ust'] = 'http://www.space.com/php/multimedia/ustplayer/noad_ustplayer.php';
PopupName['ust'] = 'UniversalViewer';
Width['ust'] = 636;
Height['ust'] = 1050;
Xtra_features['ust'] = 'scrollbars';
PopupType['ust'] = 'default';

 /// Universal Sky Tour movie player
URL['ustc'] = 'http://www.space.com/php/multimedia/ustplayer/noad_ustcplayer.php';
PopupName['ustc'] = 'UniversalViewer';
Width['ustc'] = 636;
Height['ustc'] = 1050;
Xtra_features['ustc'] = 'scrollbars';
PopupType['ustc'] = 'default';


 /// Acura Treasure Hunt
URL['acth'] = 'http://www.space.com/php/multimedia/treasurehunt/';
PopupName['acth'] = 'TreasureHunt';
Width['acth'] = 1024;
Height['acth'] = 768;
PopupType['acth'] = 'default';


////////////////////////////////////////////////




 /// 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=852,height=618,screenX=130,left=130,screenY=50,top=50,resizable=no,scrollbars=no';
function flashvideo_launch(url) {
	window.open(url,'vidplayer', vidprops);
}

