var curSound="";

function makeSound(name,src) {

	t ='&nbsp;'
	t+='<object id="SOUND_'+name+'" width="1" height="1">';
	t+='	<param name="fileName" value="'+src+'">';
	t+='	<param name="animationatStart" value="true" />';
	t+='	<param name="transparentatStart" value="true" />';
	t+='	<param name="autoStart" value="false" />';
	t+='	<param name="autoPlay" value="false" />';
	t+='	<param name="showControls" value="false" />';
	t+='	<embed src="'+src+'" id="SOUND_'+name+'embed" name="mediaEMB" width="1" height="1" autostart="false" autoplay="false" loop="false" showcontrols="false"></embed>';
	t+='</object>';
	document.write(t);

}

function playSound(name) {

	if (curSound!="") stopSound(curSound);

	alt=0;
	p=document.getElementById("SOUND_"+name+"embed");
	if (p) {
		try { p.play(); }
		catch (e) {
			try { p.Play(); }
			catch (e2) { alt=1; }
		}
	}
	else alt=1;

	if (alt==1) {
		p=document.getElementById("SOUND_"+name);
		if (p) {
			try { p.play(); }
			catch (e) {
				try { p.Play(); }
				catch (e2) { alt=2; }
			}
		}
	}

	curSound=name;
}

function stopSound(name) {

	alt=0;
	p=document.getElementById("SOUND_"+name+"embed");
	if (p) {
		try { p.stop(); }
		catch (e) {
			try { p.Stop(); }
			catch (e2) { alt=1; }
		}
		try { p.rewind(); }
		catch (e) {
			try { p.Rewind(); }
			catch (e2) { }
		}
	}
	else alt=1;

	if (alt==1) {
		p=document.getElementById("SOUND_"+name);
		if (p) {
			try { p.stop(); }
			catch (e) {
				try { p.Stop(); }
				catch (e2) { alt=2; }
			}
			try { p.rewind(); }
			catch (e) {
				try { p.Rewind(); }
				catch (e2) { }
			}
		}
	}

	curSound="";
}

