function insertFlash(path, name, id, width, height, flashvars) {
	document.write('<object class="mp3Player" width="' + width + '" height="' + height + '" id="' + id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">\n');
	document.write('<param name="allowScriptAccess" value="always" />\n');
	document.write('<param name="movie" value="' + path + name + '.swf" />\n');
	document.write('<param name="menu" value="false" />\n');
	document.write('<param name="flashvars" value="' + flashvars + '">\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="scale" value="noscale" />\n');
	document.write('<param name="bgcolor" value="#FFFFFF" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<embed width="' + width + '" height="' + height + '" name="' + id + '" src="' + path + name + '.swf" flashvars="' + flashvars + '" wmode="transparent" menu="false" quality="high" scale="noscale" bgcolor="#FFFFFF" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>\n');
}

function stopAll(id) {
	setActiveTo(mp3Players,id);
}

function setActiveTo(array, el) {
	var el = $(el);
	var groupId = array;
	for (var i=0; i < groupId.length; i++) {
		if (groupId[i] == el) { 
			//flash starts itself so nothing to do here
		}
		else { 
			//stop all movies
			eval('document.' + groupId[i].id + '.stopMe();')
		}
	}
}
