// ©2006 Sam Jimenez
// ActiveX Fix Ver. 1.0
function doFdFlash () {
var tagOutput = grabArguments(arguments);
buildTags(tagOutput.objectParts, tagOutput.parameters, tagOutput.embedParts);
}
function grabArguments(arguments){
var tagOutput = new Object();
tagOutput.embedParts = new Object();
tagOutput.parameters = new Object();
tagOutput.objectParts = new Object();
for (var x = 0; x < arguments.length; x = x + 2) {
var thisArgument = arguments[x].toLowerCase();    
if (thisArgument == "classid") {
x = x;
} else if (thisArgument == "pluginspage" || thisArgument == "swLiveConnect") {
tagOutput.embedParts[arguments[x]] = arguments[x+1];
} else if (thisArgument == "src") {
tagOutput.embedParts["src"] = arguments[x+1];
} else if (thisArgument == "movie") {
tagOutput.parameters["movie"] = arguments[x+1];
} else if (thisArgument == "type" || thisArgument == "codebase") {
tagOutput.objectParts[arguments[x]] = arguments[x+1];
} else if (thisArgument == "width" || thisArgument == "height" || thisArgument == "name" || thisArgument == "id") {
tagOutput.embedParts[arguments[x]] = tagOutput.objectParts[arguments[x]] = arguments[x+1];
} else {
tagOutput.embedParts[arguments[x]] = tagOutput.parameters[arguments[x]] = arguments[x+1];
}
}
tagOutput.objectParts["classid"] = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
tagOutput.embedParts["type"] = "application/x-shockwave-flash";
return tagOutput;
}
function buildTags (objectParts, parameters, embedParts) { 
var output = '<object ';
for (var x in objectParts) {
output += x + '="' + objectParts[x] + '" ';
}
output += '>';
for (var x in parameters) {
output += '<param name="' + x + '" value="' + parameters[x] + '" /> ';
}
output += '<embed ';
for (var x in embedParts) {
output += x + '="' + embedParts[x] + '" ';
}
output += ' ></embed></object>';
document.write(output);
}
