function FlashAudioPlayer(noFlash)
{
	if (noFlash) {
		this.useFlash = false;
		return;
	}
	
	this.flashMinVersion = 8;
	this.flashProxyFile = '/cache/sv/1202925915931/postcard/images/JavaScriptFlashGateway.swf';
	this.swf = '/cache/sv/1202925915931/postcard/images/fp_audio.0.1.swf';
	this.parentId = null;
	this.containerId = 'fdiv';
    this.w = 192;
    this.h = 37;
    this.bg = '#000000';
    this.ff2RedrawEnabled = true;
	
	this.APO = new Object();
	this.APOD = new Object();
	this.APO.autoplay = 0;
	this.APO.bg = '/cache/sv/1202925915931/postcard/images/fp_bg.png';
  	// play button
   	this.APO.playbtn = new Object();
   	this.APO.playbtn.url = '/cache/sv/1202925915931/postcard/images/fp_playbtn.png';
	this.APO.playbtn.x = 6;
	this.APO.playbtn.y = 5;
	// stop button
	this.APO.stopbtn = new Object();
	this.APO.stopbtn.url = '/cache/sv/1202925915931/postcard/images/fp_stopbtn.png';
	this.APO.stopbtn.x = 38;
	this.APO.stopbtn.y = 5;
	// volume control button
	this.APO.vol = new Object();
	this.APO.vol.icon = '/cache/sv/1202925915931/postcard/images/fp_vol_icon.png';
	this.APO.vol.url = '/cache/sv/1202925915931/postcard/images/fp_slidercontrol.png';
	this.APO.vol.x = 72;
	this.APO.vol.y = 19;
	this.APO.vol.length = 83;
	this.APO.vol.thick = 4;
	this.APO.vol.color = '0x000000';
	// position control button
	this.APO.pos = new Object();
	this.APO.pos.icon = '/cache/sv/1202925915931/postcard/images/fp_pos_icon.png';
	this.APO.pos.url = '/cache/sv/1202925915931/postcard/images/fp_slidercontrol.png';
	this.APO.pos.x = 72;
	this.APO.pos.y = 7;
	this.APO.pos.length = 83;
	this.APO.pos.thick = 4;
	this.APO.pos.color = '0x000000';
	this.APO.pos.color2 = '0xff9900';

	this.APOD = clone(this.APO,1);
	this.APOD.file = '';
	this.APOD.playbtn.url = '/cache/sv/1202925915931/postcard/images/fp_playbtn_disabled.png';
	this.APOD.stopbtn.url = '/cache/sv/1202925915931/postcard/images/fp_stopbtn_disabled.png';
	this.APOD.vol.icon = '/cache/sv/1202925915931/postcard/images/fp_vol_icon_disabled.png';
	//APOD.vol.url = '/cache/sv/1202925915931/postcard/images/fp_slidercontrol_disabled.png';
	this.APOD.vol.url = '';
	this.APOD.pos.icon = '/cache/sv/1202925915931/postcard/images/fp_pos_icon_disabled.png';
	//APOD.pos.url = '/cache/sv/1202925915931/postcard/images/fp_slidercontrol_disabled.png';
	this.APOD.pos.url = '';

	this.fpid = Date.parse(new Date());
	this.fproxy = new FlashProxy(this.fpid, this.flashProxyFile);
	this.flashVersion = deconcept.SWFObjectUtil.getPlayerVersion();
	this.useFlash = (this.flashVersion['major'] >= this.flashMinVersion) ? true : false
}
FlashAudioPlayer.prototype.hasFlash = function()
{
	return (this.flashVersion['major'] >= this.flashMinVersion) ? true : false;
}
FlashAudioPlayer.prototype.reload = function()
{
	if (this.APO.file && (this.APO.file.length > 0)) {
		this.fproxy.call('loadAudioPlayer',PO.toString(this.APO,'APO'));
	} else {
		this.fproxy.call('loadAudioPlayer',PO.toString(this.APOD,'APO'));
	}
	this.ff2Redraw();
}
FlashAudioPlayer.prototype.load = function(audioUrl, audioLength, autoPlay)
{
	this.APO.autoplay = autoPlay ? 1 : 0;
	if (audioUrl && (audioUrl.length > 0)) {
		var file = audioUrl.replace('&','|#38;');
		file = file.replace('=','|#61;');
	  	this.APO.file = file;
	  	if (!audioLength) {
	  		audioLength = 0;
	  	}
	  	this.APO.file_seconds = audioLength;
		this.fproxy.call('loadAudioPlayer',PO.toString(this.APO,'APO'));
	} else {
		this.APO.file = '';
		this.APO.file_seconds = 0;
		this.fproxy.call('loadAudioPlayer',PO.toString(this.APOD,'APO'));
	}
	this.ff2Redraw();
}
FlashAudioPlayer.prototype.unload = function()
{
	if (this.parentId) {
		this.reset();
		this.setup(this.parentId);
	}
}
FlashAudioPlayer.prototype.ff2Redraw = function() {
	if (this.ff2RedrawEnabled && (is_ff2 || is_ff1x)) {
		var y = window.pageYOffset;
		window.scroll(0,window.scrollMaxY);
		window.scroll(0,y);
	}
}
FlashAudioPlayer.prototype.setup = function(elId) {
	this.parentId = elId;
	$(elId).innerHTML = '<div id="' + this.containerId + '"></div>';
	
    var fobj = $(this.containerId);   
    fobj.style.width  = this.w + 'px';
    fobj.style.height = this.h + 'px';
    fobj.style.visibility = 'visible';
     
    var tag = new FlashTag(this.swf, this.w, this.h, this.bg);
    tag.setFlashvars('lcId=' + this.fpid);
    tag.addParam('wmode','transparent');
    tag.addParam('scale','noscale');
    tag.addParam('salign','lt');
    tag.write(this.containerId);
}
FlashAudioPlayer.prototype.reset = function() {
	if (this.parentId) {
		$(this.parentId).innerHTML = '<img src="/cache/sv/1202925915931/postcard/images/preview_player_loading.gif" width="192" height="37"/>';
	}
}