function RunFlash(path, id, width, height) {
	document.write('<object type="application/x-shockwave-flash" id="'+id+'" width="'+width+'" height="'+height+'" data="/assets/Flash/'+path+'">\n');
	document.write('<param name="movie" value="/assets/Flash/'+path+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<p>To view this image you need the flash player plugin installed. <a href="http://get.adobe.com/flashplayer/">Download flash player for free here.</a></p>\n');
	document.write('</object>\n');
}

function RunFlashBG(path, id, width, height, bg) {
	document.write('<object type="application/x-shockwave-flash" id="'+id+'" width="'+width+'" height="'+height+'" data="/assets/Flash/'+path+'">\n');
	document.write('<param name="movie" value="/assets/Flash/'+path+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	if (bg == 'transparent' || bg == '') {
		document.write('<param name="wmode" value="transparent" />\n');
	} else {
		document.write('<param name="bgcolor" value="#'+bg+'" />\n');
	}
}

function RunFlashEnd() {
	document.write('</object>\n');
}

var ProductSelection =
{
	init: function()
	{
		var Classes = Core.getElementsByClass("AddFlash");
		
		for (Class = 0; Class < Classes.length; Class++) {
			var IDInfo = Classes[Class].id;
			var IDArray = IDInfo.split("_");
			var path = IDArray[0];
			var width = IDArray[1];
			var height = IDArray[2];
			var id = IDArray[3];
			
			Classes[Class].innerHTML = '<object type="application/x-shockwave-flash" id="'+id+'" width="'+width+'" height="'+height+'" data="/assets/Flash/'+path+'.swf">\n<param name="movie" value="/assets/Flash/'+path+'.swf" />\n<param name="quality" value="high" />\n<param name="wmode" value="transparent" />\n' + Classes[Class].innerHTML + '</object>\n';
		}
	}
};

Core.start(ProductSelection);