//***********************************************************//
// Media Window Launcher version 1.1	                     //
// Ben Willard, Lawrence University                          //
// 10 March 2008                                             //
//                                                           //
// Modified 30 April 2008                                    //
// -made things more generic so that it makes sense to       //
//  use this for things other than the embedded mp3 player.  //
//                                                           //
//                                                           //
//***********************************************************//

var media_window = "";
function launch_media_window(path,width,height)
{
	// default params
	if (width==null) { width = 500; }
	if (height==null) { height = 175; }
	
	// if the window already exists, make sure that we're using the new dimensions:
	// (just close the window and let it reopen.. that way we don't have to deal with resizing issues)
	if (media_window != "")
	{
		media_window.close();
	}
	
	// pop open the window
	media_window = window.open(path, "media", 'location=no,width='+width+',height='+height+',toolbar=no,directories=no,resizable=no,status=no,menubar=no,scrollbars=no');
   
   // give the windows focus if it doesn't have it already
   if (window.focus) {media_window.focus()}
   
   // return false so that the link is not followed
   return false;
} 
