

/*
 * FlashObject embed
 * by Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)
 *
 * v1.1.0 - 03-31-2005
 *
 * writes the embed code for a flash movie, includes plugin detection
 *
 * Usage:
 *
 *	myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");
 *	myFlash.write("objId");
 *
 * for best practices, see:
 *  http://blog.deconcept.com/2005/03/31/proper-flash-embedding-flashobject-best-practices/
 *  
 *  May 5th 2005 - Dennis Pierce
 *  Renamed variables to be iVillage compliant.
 */

var iv_FlashObject = function(swf, w, h) {
	this.swf = swf;
	this.width = w;
	this.height = h;

}
var iv_FOP = iv_FlashObject.prototype;

iv_FOP.getHTML = function() {
    var flashHTML = "";
    if (navigator.plugins && navigator.mimeTypes.length) { // netscape plugin architecture
        flashHTML += '<embed type="application/x-shockwave-flash" wmode="transparent" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '"';
        flashHTML += '></embed>';

    } else { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height +  '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        flashHTML += '<param name="wmode" value="transparent" />';
        flashHTML += '</object>';
    }
    return flashHTML;	
}

iv_FOP.write = function(elementId) {


		if (elementId) {
		//alert(elementId);
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	
}
