function FlashAudioRecorder(noFlash)
{
	this.loaded = false;
	
	if (noFlash) {
		this.useFlash = false;
		this.useRecorder = false;
		return;
	}
	
	// Major version of Flash required
	this.requiredMajorVersion = 9;
	// Minor version of Flash required
	this.requiredMinorVersion = 0;
	// Minor version of Flash required
	this.requiredRevision = 0;
	
	// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
	this.hasProductInstall = AC_DetectFlashVer(6, 0, 65);
	// Version check based upon the values defined in globals
	this.hasRequestedVersion = AC_DetectFlashVer(this.requiredMajorVersion, this.requiredMinorVersion, this.requiredRevision);
	
	// Check to see if a player with Flash Product Install is available
	//  and the version does not meet the requirements for playback
	if (!this.hasProductInstall && !this.hasRequestedVersion ) {
  		// flash is too old or we can't detect the plugin
  		this.useRecorder = false;
  		return;
	} else {
		this.useRecorder = true;
	}
	
	this.containerId = null;
	this.loadUrl = null;
	this.markup = null;
	this.swf = '/cache/sv/1202925915931/postcard/images/AudioRecorder';
	this.id = 'AudioRecorder';
	this.upgradeSwf = 'playerProductInstall';
	this.scriptAccess = 'sameDomain';
	this.width = '216';
	this.height = '140';
	this.align = 'middle';
	this.quality = 'high';
	this.bgcolor = '#869ca7';
	this.wmode = 'transparent';
	this.type = 'application/x-shockwave-flash';
	this.pluginspage = 'http://www.adobe.com/go/getflashplayer';
	this.state = null;
	this.prevState = null;
	this.reloadLimit = 3;
	this.reloadTrys = 0;
}
FlashAudioRecorder.prototype.reload = function()
{
	if (this.reloadTrys < this.reloadLimit) {
		this.reloadTrys++;
		this.loaded = false;
		$(this.containerId).innerHTML = 'reloading...';
		var url = this.loadUrl;
		this.load(url);
		//this.ff2Redraw();\
	}
}
FlashAudioRecorder.prototype.load = function(loadUrl)
{
	if (this.loaded) return;
	
	if (!this.useRecorder) return;
	
	if (loadUrl != 'undefined') {
		this.loadUrl = loadUrl;
	}
	
	if (this.loadUrl == null) return;
	
	var markup;
	// Check to see if a player with Flash Product Install is available
	//  and the version does not meet the requirements for playback
	if (this.hasRequestedVersion) {
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
		markup = AC_FL_RunContent(
			"src", this.swf,
			"width", this.width,
			"height", this.height,
			"align", this.align,
			"id", this.id,
			"quality", this.quality,
			"bgcolor", this.bgcolor,
			"name", this.id,
			"flashvars", 'data=' + this.loadUrl,
			"allowScriptAccess", this.scriptAccess,
			"wmode", this.wmode,
			"type", this.type,
			"pluginspage", this.pluginspage, "debug", 0
		);
		
		//reusable, save this for later use
		this.markup = markup;
	} else {
		// MMdoctitle is the stored document.title value used by the
		// installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still
		// utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (AC_isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
	    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
 		var MMdoctitle = document.title;
		
		markup = AC_FL_RunContent(
			"src", this.upgradeSwf,
			"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
			"width", this.width,
			"height", this.height,
			"align", this.align,
			"id", this.id,
			"quality", this.quality,
			"bgcolor", this.bgcolor,
			"name", this.id,
			"flashvars","data=" + this.loadUrl,
			"allowScriptAccess", this.scriptAccess,
			"wmode", this.wmode,
			"type", this.type,
			"pluginspage", this.pluginspage, "debug", 0
		);
	}
	
	$(this.containerId).innerHTML = markup;
	this.loaded = true;
	//this.ff2Redraw();
}
FlashAudioRecorder.prototype.unload = function() {
	this.loaded = false;
	$(this.containerId).innerHTML = 'reloading...';
}
FlashAudioRecorder.prototype.reset = function() {
	;
}
FlashAudioRecorder.prototype.ff2Redraw = function() {
	if (is_ff2 || is_ff1x) {
		var y = window.pageYOffset;
		window.scroll(0,window.scrollMaxY);
		window.scroll(0,y);
	}
}
FlashAudioRecorder.prototype.setup = function(elId) {
	this.containerId = elId;
}
FlashAudioRecorder.prototype.stateListener = function(state) {
	this.prevState = this.state;
	this.state = state;
	if (state == "connected") {
		this.reloadTrys = 0;
	}
}
FlashAudioRecorder.prototype.isRecording = function() {
	if (this.state == "recording") {
		return true;
	}
	return false;
}
FlashAudioRecorder.prototype.wasRecording = function() {
	if (this.prevState == "recording" && this.state != "recording") {
		return true;
	}
	return false;
}
FlashAudioRecorder.prototype.isRejected = function () {
	if (this.state  == "rejected") {
		return true;
	}
	return false;
}
FlashAudioRecorder.prototype.isConnecting = function () {
	if (this.state  == "connecting") {
		return true;
	}
	return false;
}