/* JavaScript Library File - Worldsoft AG - (c) 2005 */

idName = "soundBox"; 		/* ID Name of HTML container */
idImage = "soundImage"; 	/* ID Name of image button */
musicStatus = 0;			/* internal value to store the status playing or not */

/* function to start playing music */
function playMusic()
{
	if (soundFile!="")
	{
		document.getElementById(idName).innerHTML
			= "<embed src='"+soundFile+"' loop='true' autostart='true' hidden='true' mastersound><\/embed>";
		musicStatus = 1;
		if ( useImage == "yes")
		{
			document.getElementById(idImage).src = imageSoundOff;
		}
	}
}

/* function to stop playing music */
function stopMusic()
{
	if (soundFile!="")
	{
		document.getElementById(idName).innerHTML
			= "<embed src='empty.mp3' loop='true' autostart='true' hidden='true' mastersound><\/embed>";
		musicStatus = 0;
		if ( useImage == "yes")
		{
			document.getElementById(idImage).src = imageSoundOn;
		}
	}
}

/* function to start playing music on loading page */
function autoStartMusic()
{
	if (autoStart == "yes")
	{
		playMusic();
	} else
	{
		stopMusic();
	}
}

/* function to start or stop playing music */
function startStopMusic()
{
	if (musicStatus == 0)
	{
		playMusic();
	} else
	{
		stopMusic();
	}
}

