function closeWindow(s) {
	opener.location=s;
	self.close();
	return false;
}

/*
**@param
**address1 : link to a divx movie (null if no divx)
**address2 : link to a mpeg-1 movie (null if no mpeg-1)
**address3 : link to a Quicktime movie (null if no Quicktime)
**address4 : link to a Avi movie (null if no Avi)
**address5 : link to a Mpeg-1 movie (null if no Mpeg-4)
**size1 : size of the divx file (null if no divx)
**size2 : size of the mpeg-1 file (null if no mpeg-1)
**size3 : size of the quicktime file (null if no quicktime)
**size4 : size of the avi file (null if no avi)
**size5 : size of the mpeg-4 file (null if no mpeg-4)
*/


function choixFormat(address1,address2, address3, address4, address5, size1, size2, size3, size4, size5){
var h = 150; // hauteur de la popup
var l = 250; // largeur de la popup
var PosX = (screen.availWidth - l) / 2; 
var PosY = (screen.availHeight - h) / 2; //to put the popup in the middle of the screen
var option = "resizable=no,top="+PosY+",left="+PosX+",width="+l+",height="+h+",scrollbars=no"; 
form=window.open("about:blank","Format",option);
form.document.writeln("<HTML><HEAD><lxink rel=\"stylesheet\" href=\"http://birg.epfl.ch/jsp/jahia/templates/birg/epfltemplates/css/boxes.css\"><lsink rel=\"stylesheet\" href=\"http://birg.epfl.ch/jsp/jahia/templates/birg/epfltemplates/css/screen_pc-mac_table.css\"><script LANGUAGE=\"JavaScript\" SRC=\"http://birg2.epfl.ch/js/videoformat.js\"></SCRIPT>");
form.document.writeln("<STYLE TYPE=\"text/css\">");
form.document.writeln("<!--");
form.document.writeln("p, table {font-family: Verdana, Arial, Helvetica; font-size: 8pt }");
form.document.writeln("a:active, a:link 	{ color: #003366; font-weight: bold; text-decoration: none }");
form.document.writeln("a:visited, a:hover { color: #336699; font-weight: bold; text-decoration: none }");
form.document.writeln("li { margin-left: -15px;  }");
form.document.writeln(".plusgrand { font-size: 140%; margin-bottom: -12px  }");
form.document.writeln("-->");
form.document.writeln("</STYLE>");
form.document.writeln("</HEAD><BODY>");

form.document.writeln("<TABLE WIDTH=100% HEIGHT=90% ALIGN=TOP BORDER=0><TR><TD VALIGN=TOP><P CLASS=\"plusgrand\"><B>Available formats:</B></P><BR><UL>");
if (address1!=null) form.document.writeln('<LI><A HREF="javascript:closeWindow(\''+address1+'\')">DivX ('+size1+')</A><BR>');
if (address2!=null) form.document.writeln('<LI><A HREF="javascript:closeWindow(\''+address2+'\')">Mpeg-1 ('+size2+')</A><BR>');
if (address3!=null) form.document.writeln('<LI><A HREF="javascript:closeWindow(\''+address3+'\')">Quicktime ('+size3+')</A><BR>');
if (address4!=null) form.document.writeln('<LI><A HREF="javascript:closeWindow(\''+address4+'\')">Avi ('+size4+')</A><BR>');
if (address5!=null) form.document.writeln('<LI><A HREF="javascript:closeWindow(\''+address5+'\')">Mpeg-4 ('+size5+')</A><BR>');
form.document.writeln("</UL></TD></TR></TABLE></BODY></HTML>");
form.document.close();
}