<!--
var tvWin = null;
var popupScroll='no';
var resizable='yes';
var theWidth1;
var theHeight1;
//var detailswin;

function open_Details_Window() {
	
	var theParameters = new Array(
		'theURL',
		'popupWidth',
		'popupHeight',
		'popupScroll',
		'resizable'
		
		);
	
	for (i=0; i < (open_Details_Window.arguments.length); i++) {
		theVar = theParameters[i];
		theValue = open_Details_Window.arguments[i];
		eval(theVar + "= theValue");
	}
	
	//detailswin.close();
	
	if (isOpen(detailswin))	{
			close_Details_Window(detailswin);
	}
	
	return(opendetails(theURL,popupWidth,popupHeight,popupScroll,resizable));
}

function open_Details_Window1() {
		
	
	var theParameters = new Array(
		'theURL',
		'popupWidth',
		'popupHeight',
		'popupScroll',
		'resizable'
		
		);
	
	for (i=0; i < (open_Details_Window1.arguments.length); i++) {
		theVar = theParameters[i];
		theValue = open_Details_Window1.arguments[i];
		eval(theVar + "= theValue");
	}

	
			//detailswin.close();
	
if (isOpen(detailswin))	{
			close_Details_Window(detailswin);
	}
	
	opendetails(theURL,popupWidth,popupHeight,popupScroll,resizable);
}

function opendetails(theURL,theWidth,theHeight,theScroll,theResizable)	{
theWidth1 = theWidth;
theHeight1 = theHeight;

detailsDetails = 'scrollbars=' + theScroll + ',resizable=' + theResizable + ',width=' + theWidth + ',height=' + theHeight +  ',left=100,top=40';
detailswin=window.open(theURL,'imagedetails',detailsDetails);
		openeddetails=true;
if (window.focus) {detailswin.focus()}
return(detailswin);


}

function close_win()	{
	close_Details_Window(detailswin);
}

function close_Details_Window(theWin)	{
	if (theWin) {
		theWin.close()
		}
}

function close_Details_Window1(theWin)	{
	if (theWin) {
		theWin.close()
		}
}

function isOpen(theWindow)	{
	var isItOpen=false;
	if(theWindow)	{
		if(theWindow.closed==false)	{
			isItOpen=true;
		}
	}
	return isItOpen;
}


// ----------------------------------------------------------------------------
// Open TV Popup; takes arguments bw (bandwidth) and video filename

function openTV(videoFN) {
	
	if (tvWin != null)	{
		if (tvWin.closed == false)	{
			tvWin.close();
		}
	}

//	if(bw=='audio')	{
//		theWidth=315;
//		theHeight=100;
//	}
//	else if(bw=='low')	{
//		theWidth=430;
//		theHeight=260;
//	}
//	else	{
		theWidth=350;
		theHeight=500;
//	}
	theURL = "../media_players/tv_high.html?" + videoFN;
	
	if (tvWin) {
		if(tvWin.closed==false) {
			tvWin.focus();
		}
		else	{
			tvWin = opendetails(theURL,theWidth,theHeight,'no','no','150','1','theTV','no');
		}
	}
	else	{
		tvWin = opendetails(theURL,theWidth,theHeight,'no','no','150','1','theTV','no');
	}
}

function playVideo(baseName,caption)	{
	PBSVideoWindow_X=580;
	PBSVideoWindow_Y=360;
	var pbsArgs = "playertemplate=/pov/borders/2004/media_players/videowindow.html";
	var pbsPrefix = "/pov/borders/2004/";
	var pbsMediaString = "";
	var mediaTypesArray;
	var mediaTypes = "_hi.mov,_lo.wmv,_hi.wmv,_lo.rm,_hi.rm";
	mediaTypesArray = mediaTypes.split(",");
	for(x=0;x<mediaTypesArray.length;x++)	{
		if(x != 0)	{
			pbsMediaString = pbsMediaString + ",";
		}
		pbsMediaString = pbsMediaString + pbsPrefix + baseName + mediaTypesArray[x];
	}
	launchPBSVideoPlayer(pbsMediaString,caption,pbsArgs);
}

//-->
