// JavaScript Document
function FlashTag(src, width, height)
{
    this.src       = src;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.id        = null;
    this.bgcolor   = 'eeeee';//null;
    this.flashVars = null;
    this.scale = 'noscale';
    this.menu = 'false';
    //this.prmpath = null;
	
	this.transparent=true;
	this.parentNode=null; 
}

/**
 * Sets the Flash version used in the Flash tag.
 */
FlashTag.prototype.setVersion = function(v)
{
    this.version = v;
}

/**
 * Sets the ID used in the Flash tag.
 */
FlashTag.prototype.setId = function(id)
{
    this.id = id;
}

/**
 * Sets the background color used in the Flash tag.
 */
FlashTag.prototype.setBgcolor = function(bgc)
{
    this.bgcolor = bgc;
}

/**
 * Sets any variables to be passed into the Flash content. 
 */
FlashTag.prototype.setFlashvars = function(fv)
{
    this.flashVars = fv;
}


FlashTag.prototype.setParentNode= function(parentNode_Id)
{
    this.parentNode = parentNode_Id;
}
FlashTag.prototype.setTransparent= function(tf)
{
    this.transparent = tf;
}
/*FlashTag.prototype.setPath = function(p)
{
    this.prmpath = p;
}*/
/**
 * Get the Flash tag as a string. 
 */
FlashTag.prototype.toString = function()
{
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    flashTag += '<object ';
    if (ie)
    {
        flashTag += 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
    }
    else
    {
        flashTag += 'type="application/x-shockwave-flash" ';
	flashTag += 'data="'+this.src+'" ';
    }
    	if (this.id != null) flashTag += 'id="'+this.id+'" ';
    	
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" border="0">';
	flashTag += '<param value="sameDomain" name="allowScriptAccess"/>';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
        //if(this.bgcolor!=null) 
		flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
	flashTag += '<param name="scale" value="'+this.scale+'"/>';
	flashTag += '<param name="menu" value="'+this.menu+'"/>';
	//-if(this.prmpath != null) flashTag += '<param name="path" value="'+this.prmpath+'"/>';
	if(this.transparent) flashTag += '<param name="wmode" value="transparent"/>';
        //if(this.flashVars != null) flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
        flashTag += '</object>';
    return flashTag;
}

/**
 * Write the Flash tag out. Pass in a reference to the document to write to. 
 */
FlashTag.prototype.write = function()
{
	try
	{
		document.getElementById(this.parentNode).innerHTML=this.toString();
	}
	catch(e)
	{
	//	alert(e.message)
	}
}
