function PlayerEmbedObject(){
    this._type = null;
    this._width = null;
    this._height = null;
    this._content = null;
    this._preview = null;
    this._bgcolor = "f5f5f5";
    this.audio = function(){ return this.get_type() == "MP3";};
    this._def_flv_width = 550;
    this._def_flv_height = 450;
    this._def_audio_width = 399;
    this._def_audio_height = 62;
    this.name = "flvplayer"+Math.round(Math.random()*1000);
    this.movie = "/DesktopModules/UltraVideoGallery/UltraVideoGallery2";
    //this.movie = "/DesktopModules/UltraVideoGallery/flvplayersimple";
    this._autoPlay = false;
}

PlayerEmbedObject.prototype.write = function(){
    var flashVars = 'streamName='+this.get_content()+"&autoPlay="+(this.get_autoPlay() ? "true" : "false")+
        "&bgcolor="+this.get_bgcolor()+"&isAudio="+(this.audio()? "true":"false");
	if(this.get_preview() != null ){
		flashVars += "&preview="+this.get_preview();
	}
       //alert(flashVars);
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
		'width', this.get_width(),
		'height', this.get_height(),
		'src', this.movie,
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'noscale',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'flvplayer',
		'bgcolor', '#'+this.get_bgcolor(),
		'name', this.name,
		'menu', 'false',
		'allowFullScreen', 'true',
		'allowScriptAccess','sameDomain',
		'movie', this.movie,
		'salign', 'lt',
		'flashvars', flashVars
	); //end AC code

}
PlayerEmbedObject.prototype.get_content = function(){
    return this._content;
}
PlayerEmbedObject.prototype.set_content = function(value){
    this._content = value;
    if(this._type == null){
        if(this._content.lastIndexOf (".mp3") == this._content.length - 4){
            this._type = "MP3";
        } else {
            this._type = "FLV";
        }
    }
}
PlayerEmbedObject.prototype.get_type = function(){
    return this._type;
}
PlayerEmbedObject.prototype.set_type = function(value){
    value = ("" + value).toUpperCase(); 
    switch(value){
        case "MP3": case "FLV": this._type = value; break;
    }
}
PlayerEmbedObject.prototype.get_width = function(){
    return this._width != null ? this._width : (this.audio()?this._def_audio_width:this._def_flv_width);
}
PlayerEmbedObject.prototype.set_width = function(value){
    this._width = value;
}
PlayerEmbedObject.prototype.get_height = function(){
    return this._height != null ? this._height : (this.audio()?this._def_audio_height:this._def_flv_height);
}
PlayerEmbedObject.prototype.set_height = function(value){
    this._height = value;
}
PlayerEmbedObject.prototype.get_bgcolor = function(){
    return this._bgcolor;
}
PlayerEmbedObject.prototype.set_bgcolor = function(value){
    this._bgcolor = value;
}
PlayerEmbedObject.prototype.get_autoPlay = function(){
    return this._autoPlay;
}
PlayerEmbedObject.prototype.set_autoPlay = function(value){
    this._autoPlay = value;
}
PlayerEmbedObject.prototype.get_preview = function(){
    return this._preview;
}
PlayerEmbedObject.prototype.set_preview = function(value){
    this._preview = value;
}
