// JavaScript Document

function runCommonRoutines() {
	
	musicPlayerWinIsOpen = false;
	setTimeout("checkMusicPlayerProxy()",1000);
	checkMusicProxyCalled = true;
	
}

function checkMusicPlayerProxy() {
	
	if (checkMusicPlayerProxy != true) {
	
		AjaxUpdater.Update("GET", "getBeginPlay.php", checkMusicPlayer);
		
	}
	
}

function checkMusicPlayer() {
	
	if (Ajax.request.readyState == 4) {

		var response = Ajax.request.responseText;

		// Begin play is set to true
		if (response == 1) {
	
			// Check to see if the window is closed (it's supposed to be open)
			if (musicPlayerWinIsOpen == false) {
	
				// Open the music player
				openMusicPlayer(true);
				
			}

		}
		
	}	
	
}
