function array_search(needle, haystack) {
    for(var index in haystack) if(haystack[index] == needle) return index;
    return false;
}

function showflash(base, path, width, height, argnames, args) {
	var index;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
	document.write(' width="' + width + '" height="' + height + '" align="middle">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param  name="movie" value="' + path + '" />\n');
	document.write('<param name="base" value="' + base + '" />\n');

	if((index = array_search('bgcolor', argnames)) !== false) {
		document.write('<param name="bgcolor" value="' + args[index] + '" />\n');
	}
	if((index = array_search('salign', argnames)) !== false) {
		document.write('<param name="salign" value="' + args[index] + '" />\n');
	}
	if((index = array_search('wmode', argnames)) !== false) {
		document.write('<param name="wmode" value="' + args[index] + '" />\n');
	}
	document.write('<embed src="' + path + '" quality="high"');
	document.write(' base="' + base + '" width="' + width + '" height="' + height + '"');

	if((index = array_search('bgcolor', argnames)) !== false) {
		document.write(' bgcolor="' + args[index] + '"');
	}
	if((index = array_search('wmode', argnames)) !== false) {
		document.write(' wmode="' + args[index] + '"');
	}

	document.write(' align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}