var newWindow;   

function showMovie(file) {
	if (!newWindow || newWindow.closed) {
		newWindow = window.open('', 'name', 'width=340, height=276');
		if (!newWindow.opener) {newWindow.opener = window;}
		/*setTimeout("writeToWindow('" + file + "')", 500);*/	
	} else 	{
		if (newWindow.focus) newWindow.focus();
	}
	setTimeout("writeToWindow('" + file + "')", 500);
}        
function writeToWindow(file) {
	var newContent = '\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';
	newContent += '<html xmlns="http://www.w3.org/1999/xhtml">\n';
	newContent += '<head>\n';
	newContent += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n';
	newContent += '<title>GCTV Video on Demand</title>\n';  
	newContent += '<style type="text/css" >\n* {margin: 0px;}\nbody {text-align:center;}\n#container {padding:10px;}\n</style>'	
	newContent += '</head>\n';
	newContent += '<body>\n';	
	newContent += '<div id="container">\n';
	newContent += QT_GenerateOBJECTText_XHTML("http://dl.streaming-graftontv.org/"+file,"320", "256" , "", "SCALE", "Aspect");
	newContent += '\n</div>\n';
	newContent += '</body>\n';
	newContent += '</html>\n';
	newWindow.document.write(newContent);
	newWindow.document.close();                
}


function streamMovie(file) {
	if (!newWindow || newWindow.closed) {
		newWindow = window.open('', 'name', 'width=340, height=276');
		if (!newWindow.opener) {newWindow.opener = window;}
		/*setTimeout("streamwriteToWindow('" + file + "')", 500);*/	
	} else 	{
		if (newWindow.focus) newWindow.focus();
	}
	setTimeout("streamwriteToWindow('" + file + "')", 500);
}        
function streamwriteToWindow(file) {
	var newContent = '\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';
	newContent += '<html xmlns="http://www.w3.org/1999/xhtml">\n';
	newContent += '<head>\n';
	newContent += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n';
	newContent += '<title>GCTV Video on Demand</title>\n';  
	newContent += '<style type="text/css" >\n* {margin: 0px;}\nbody {text-align:center;}\n#container {padding:10px;}\n</style>'	
	newContent += '</head>\n';
	newContent += '<body>\n';	
	newContent += '<div id="container">\n';
	newContent += QT_GenerateOBJECTText_XHTML("images/postermovie.mov","320", "256" , "", "SCALE", "Aspect", "qtsrc", "rtsp://streaming.streaming-graftontv.org:554/streaming.streaming-graftontv.org/"+file);
	newContent += '\n</div>\n';
	newContent += '</body>\n';
	newContent += '</html>\n';
	newWindow.document.write(newContent);
	newWindow.document.close();                
}
