- if (this.settings.button_placeholder_id !== "") {
- this.replaceWithFlash();
- } else {
- this.appendFlash();
- }
-};
-
-// Private: appendFlash gets the HTML tag for the Flash
-// It then appends the flash to the body
-SWFUpload.prototype.appendFlash = function () {
- var targetElement, container;
-
- // Make sure an element with the ID we are going to use doesn't already exist
- if (document.getElementById(this.movieName) !== null) {
- throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
- }
-
- // Get the body tag where we will be adding the flash movie
- targetElement = document.getElementsByTagName("body")[0];
-
- if (targetElement == undefined) {
- throw "Could not find the 'body' element.";
- }
-
- // Append the container and load the flash
- container = document.createElement("div");
- container.style.width = "1px";
- container.style.height = "1px";
- container.style.overflow = "hidden";
-
- targetElement.appendChild(container);
- container.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
-};
-
-// Private: replaceWithFlash replaces the button_placeholder element with the flash movie.
-SWFUpload.prototype.replaceWithFlash = function () {