/*
 * Version: $Revision: 1.3 $
 * Author: BeSite <info@besite.nl>
 * Copyright 2007-2008 BeSite
 */

var musicWin;

function MusicPopupOpen()
{
	// Create an object for a WINDOW popup
	musicWin = new PopupWindow(); 
	// Set the size of the popup window (only applies to WINDOW popups
	musicWin.setSize( 250, 95 );
	// Show the window relative to the anchor name passed in
	musicWin.showPopup("Main");
	// set the URL of the window, rather than populating its contents
	// manually
	musicWin.setUrl("/music.html" );
	//calendarWin.blur();
	musicWin.refresh();
	if ( document.getElementById( "MusicControlOn" ) )
	{
		document.getElementById( "MusicControlOn" ).className = "Bold";
	}
	if ( document.getElementById( "MusicControlOff" ) )
	{
		document.getElementById( "MusicControlOff" ).className = "";
	}
}

function MusicPopupClose( bFromPopup )
{
	if ( !bFromPopup )
	{
		// Create an object for a WINDOW popup
		if ( !musicWin )
		{
			musicWin = new PopupWindow(); 
			musicWin.setSize( 1, 1 );
		}
		musicWin.showPopup("Main");
		musicWin.setUrl("/music/close.html" );
		musicWin.refresh();
	}
	if ( document.getElementById( "MusicControlOn" ) )
	{
		document.getElementById( "MusicControlOn" ).className = "";
	}
	if ( document.getElementById( "MusicControlOff" ) )
	{
		document.getElementById( "MusicControlOff" ).className = "Bold";
	}
}

function onUnload()
{
	$.get('/', 
	  {
		call: 'MusicPlayerClosed',
		ajax: 'on'
	  },
	  function(data) {} );
}

