var objPlayer;

if(!window.SWFObject){
	document.write('<scri'+'pt type="text/javascript" src="javascript/swfobject.js"></sc'+'ript>');
}

function sendEvent(typ,prm) { 
	alert('here goes... '+typ);
  thisMovie("mpl").sendEvent(typ,prm); 
};

function getUpdate(typ,pr1,pr2,swf) {};

function thisMovie(swf) {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    return window[swf];
  } else {
    return document[swf];
  }
};

function mp3play(filename){
	$('mplayer').style.visibility='visible';
  objPlayer.sendEvent("stop");
	objPlayer.loadFile({file:filename})
  objPlayer.sendEvent("playpause");
}

function loadFile(obj) { 
  objPlayer.loadFile(obj);
};

function player_init(){
	var pdiv=document.createElement("DIV");
	pdiv.id="mplayer";

	//pdiv.style.margin='10px 0 0 4px';
	pdiv.style.position='fixed';
	pdiv.style.bottom='10px';
	pdiv.style.left='4px';
	pdiv.style.visibility='hidden';

	//mnudiv=$('menu');
	//mnudiv.appendChild(pdiv);
	document.body.appendChild(pdiv);
	var s1 = new SWFObject("/swf/mediaplayer.swf", "mpl", "165", "20", "7");
	s1.addVariable("enablejs","true");
	s1.addVariable("javascriptid","mpl");
	s1.addVariable("height", "20");
	s1.addVariable("displayheight", "0");
	s1.addVariable("width", "165");
	s1.write("mplayer");
	objPlayer=thisMovie("mpl");
}

addEvent(window,'load',player_init,false);
