// JavaScript Document
var jsReady = false;
var swfReady = false;

function isReady() {
	return jsReady;
}
function setSWFIsReady() {
	swfReady = true;		
	updateStatus();
}
function pageInit() {
	jsReady = true;
}
function updateStatus() {
	if (swfReady) {
		isPlaying();
	}
}

function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
			return document.getElementById(movieName);
		} else {
			return document[movieName];
		}
}
function thatMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window.parent.frames['topFrame'].window[movieName];
}
else {
return window.parent.document.getElementById("topFrame").contentWindow.document[movieName];
}
}


function isPlaying(){
	var obj = thatMovie("snd");
	var obj1 = thisMovie("headerflash");
	if(obj1!=null&&obj!=null){
		var status = obj.getMusicStatus();
		switch (status) {
			case 0:
				obj1.showStatus(false,false,true);
				break;
			case 1:
				obj1.showStatus(false,false,true);
				break;
			case 2:
				obj1.showStatus(true,false,false);
				break;
			case 3:
				obj1.showStatus(false,true,false);
				break;
		}
		}
}

function callShowStatus(showLoading,showPlay,showStop){
	var obj1 = thisMovie("headerflash");
	if(obj1!=null)
		obj1.showStatus(showLoading,showPlay,showStop);
}
function stopMusic(){
	var obj = thatMovie("snd");
	if(obj!=null)
		obj.stopMusic();
}
function playMusic(){
	var obj = thatMovie("snd");
	if(obj!=null)
		obj.playMusic();
}
