//-->
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400,left = 110,top = 100');");
}
// End -->

toggleSoundFlag = "stop";

function toggleSound(soundName) {
	//alert ("OLD VALUE = " + toggleSoundFlag);

	//alert ("toggleSoundFlag = " + toggleSoundFlag);
	if (toggleSoundFlag == "stop") {
		toggleSoundFlag = "play";
		playSound(soundName);
		}
	else {
		toggleSoundFlag = "stop";
		stopSound(soundName);
		}
		//alert ("NEW VALUE = " + toggleSoundFlag);

}
function playSound(soundName) {
	//alert ("PLAYSOUND");
	//Play function used with gratitude from boutell.com
	var sound = eval("document." + soundName);
	
	// make an effort to stop and rewind any playback
	// already in progress so that the sound starts over.
	// Otherwise this call has no effect when the sound
	// is already in progress. You can remove these lines
	// if you don't like this behavior.
	try {
		sound.Stop();
		sound.Rewind();
		} catch (e) {
		// A player that doesn't support
		// Stop and Rewind
	}
	
	try {
		// For RealPlayer-enabled browsers.
		// Some versions of RealPlayer do not
		// offer a Play() function and will
		// fail to play sound if we try to
		// call Play(). 
		sound.DoPlay();
		} catch (e) {
		// If DoPlay doesn't work, call Play.
		// This works for all other audio 
		// plug-ins.
		sound.Play();
	}
}
function stopSound(soundName) {
	//alert ("STOPSOUND");
	var sound = eval("document." + soundName);
	sound.Stop();
}

