
function audio() {
}

audio.prototype.imgPlayerLayout = function(img,mp3) {
	var ot = '';
	ot += '<div><img id="audioPlayerImg" src="'+img+'" border="1" style="border-color:white" width="300" height="300"/></div>';
	ot += '<div style="border:1px solid white;background-color:#555555"><embed src="'+mp3+'" autostart="true" width="300" height="42" bgcolor="#555555" style="background-color:#555555" ></embed></div>';
	return ot;
}

audio.prototype.imgPlayer = function(img,mp3) {
	var bx = myBox.popBox(this.imgPlayerLayout(img,mp3),50,50);
	bx.afterHide = function() {this.innerLayout.innerHTML = ''};
}

audio.prototype.button = function(path)
{
	if(this.isFlashInstalled())
	{
		document.write('\
		<div class="audio_link">\
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0" width="20" height="20" id="wimpy_button_72297" name="wimpy_button_72297" >\
		<param name="movie" value="/swf/wimpy_button.swf?theFile='+path+'&autoplay=no" />\
		<param name="quality" value="high" />\
		<param name="bgcolor" value="940000" />\
		<param name="wmode" value="transparent" />\
		<embed src="http://www.spanishdict.com/swf/wimpy_button.swf?theFile='+path+'&autoplay=no" width="20" height="20" quality="high" bgcolor="940000" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"  name="wimpy_button_72297" />\
		</object>\
		</div>');
	}
	else
	{
		document.write(' (<a href="'+path+'">audio</a>)');
	}
}

audio.prototype.isFlashInstalled = function()
{
	if(navigator.plugins && navigator.mimeTypes.length){
		var x=navigator.plugins["Shockwave Flash"];
		if(x) return true;
	}else{
		try{
		var x=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
		if(x) return true;
		}catch(e){}
	}
	return false;
}

if (window.myAll) {
	window.myAudio = new audio();
	if (window.dbg) dbg.trace("sucessfully loaded lib.audio.js");
}

