function Exception(name, message)
{
    if (name)
        this.name = name;
    if (message)
        this.message = message;
}

Exception.prototype.setName = function(name)
{
    this.name = name;
}

Exception.prototype.getName = function()
{
    return this.name;
}

Exception.prototype.setMessage = function(msg)
{
    this.message = msg;
}

Exception.prototype.getMessage = function()
{
    return this.message;
}

function FlashTag(src, width, height)
{
    this.src       = src;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.flashVars = null;
	 this.menu				='false';
    //this.id        = null;
    this.bgcolor   = '';
    this.id        = "f_" + ((new Date()).getTime()).toString();//modify by kindy lin at 060523
    this.salign = null;//modify by kindy lin at 060523
    this.scale = '';//modify by kindy lin at 060523
    this.wmode = 'transparent';//modify by kindy lin at 060523
    this.wmodeFF = null;//(FF=firefox)modify by kindy lin at 060523
}
//modify by kindy lin at 060523
FlashTag.prototype.setSalign = function(sa)
{
    this.salign = sa;
}

FlashTag.prototype.setMenu = function(menuShow)
{
    this.menu = menuShow;
}
/**
 * Sets the scale parameter used in the Flash tag.
 */
FlashTag.prototype.setScale = function(scl)
{
    this.scale = scl;
}
/**
 * Sets the wmode parameter used in the Flash tag for IE.
 */
FlashTag.prototype.setWmode = function(wm)
{
    this.wmode = wm;
}

/**
 * Sets the wmode parameter used in the Flash tag for FF.
 */
FlashTag.prototype.setWmodeFF = function(wmff)
{
    this.wmodeFF = wmff
}
//end... modify by kindy lin at 060523
/**
 * 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;
}
//add by kindy lin at 060523
FlashTag.prototype.setSrc = function(src)
{
    this.src       = src;
}
FlashTag.prototype.setNew = function(src, width, height)
{
    this.src       = src;
    this.id        = "f_" + ((new Date()).getTime()).toString();
    this.width     = width;
    this.height    = height;
    this.flashVars = null;
    this.bgcolor   = '';
    this.salign = null;//modify by kindy lin at 060523
    this.scale = '';//modify by kindy lin at 060523
    this.wmode = 'transparent';//modify by kindy lin at 060523
    this.wmodeFF = null;//(FF=firefox)modify by kindy lin at 060523
}
//end...add by kindy lin at 060523
/*** Get the Flash tag as a string. 
 */
FlashTag.prototype.toString = function()
{
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    if (ie)
    {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
        flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
		flashTag += '<param name="menu" value="'+this.menu+'"/>';
        if (this.wmode != null)
        {
            flashTag += '<param name="wmode" value="'+this.wmode+'"/>';
        }
        if (this.salign != null)
        {
            flashTag += '<param name="salign" value="'+this.salign+'"/>';
        }
        if (this.scale != null)
        {
            flashTag += '<param name="scale" value="'+this.scale+'"/>';
        }
        if (this.flashVars != null)
        {
            flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
        }
        flashTag += '</object>';
    }
    else
    {
        flashTag += '<embed src="'+this.src+'" ';
        flashTag += 'quality="high" '; 
        flashTag += 'bgcolor="#'+this.bgcolor+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" ';
        flashTag += 'type="application/x-shockwave-flash" ';
		  flashTag += 'menu="'+this.menu+'" ';
        if (this.flashVars != null)
        {
            flashTag += 'flashvars="'+this.flashVars+'" ';
        }
        if (this.id != null)
        {
            flashTag += 'name="'+this.id+'" ';
        }
				if ((this.wmode!=null)&&(this.wmode == "transparent")) {this.wmodeFF = "transparent"; }
        if (this.wmodeFF != null)
        {
            flashTag += 'wmode="'+this.wmodeFF+'" ';
        }
        if (this.scale != null)
        {
            flashTag += 'scale="'+this.scale+'" ';
        }
        if (this.salign != null)
        {
            flashTag += 'salign="'+this.salign+'" ';
        }        flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;
}

/**
 * Write the Flash tag out. Pass in a reference to the document to write to. 
 */
FlashTag.prototype.write = function(doc)
{
    doc.write(this.toString());
}


var flashTagIns = new FlashTag("", 100, 10);//add by kindy lin at 060523

