

/*
 * 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="opaque" 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="opaque" />';
        flashHTML += '</object>';
    }
    return flashHTML;	
}

iv_FOP.write = function(elementId) {


		if (elementId) {
		//alert(elementId);
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	
}
function flashad(url,w,h,id){
	document.write("<object id='"+id+"' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0' width='"+w+"' height='"+h+"'><param name='movie' value='"+url+"'><param name='wmode' value='opaque'><param name='allowScriptAccess' value='always'><param name='allowFullScreen' value='false' /><param name='quality' value='high'><param name='menu' value='false'><embed width='"+w+"' height='"+h+"' src='"+url+"' name='"+id+"' allowScriptAccess='always' allowFullScreen='false' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='opaque' type='application/x-shockwave-flash'></embed></object>");
}