﻿function mpWindow (xmlFile, mp_width, mp_height)
{
	var x = 0, y = 0; // default values

	if (document.all) {
  		x = window.screenTop;
  		y = window.screenLeft;
	}
	else if (document.layers) {
  		x = window.screenX;
  		y = window.screenY;
	}
	
	var winProperties = "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width= " + (parseInt(mp_width)) + ", height=" + (parseInt(mp_height));
	
	var myWin;
	
	if (myWin)
	{   if(!myWin.closed) {myWin.focus();}
	}
	else {	myWin = window.open('http://www.davidwall.ca/player.php?xmlFile=' + xmlFile,'myWin',winProperties);
	}
	myWin.document.clear();
	myWin.window.resizeTo(parseInt(mp_width),parseInt(mp_height));
	
	myWin.window.focus();

	myWin.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">');
	myWin.document.writeln('<head>');
	myWin.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />');
	myWin.document.writeln('<title>davidwall.ca</title>');
	myWin.document.writeln('</head>');
	myWin.document.writeln('<body bgcolor="#000000">');
	myWin.document.writeln('<object type="application/x-shockwave-flash" data="http://www.davidwall.ca/c.swf?path=http://www.davidwall.ca/mp3Player.swf&xmlFile=' + xmlFile +'" width="100%" height="100%">');
	myWin.document.writeln('<param name="movie" value="http://www.davidwall.ca/c.swf?path=http://www.davidwall.ca/mp3Player.swf&xmlFile='+xmlFile+'" />');
	myWin.document.writeln('<param name="FlashVars" value="xmlFile='+xmlFile+'" />');
	myWin.document.writeln('<param name="FlashVars" value="path=http://www.davidwall.ca/mp3Player.swf" />');
	myWin.document.writeln('</object>');
	myWin.document.writeln('</body>');
	myWin.document.writeln('</html>');

}