
function SoundManager() {
	//init
	var mp3URL = '';
	var html = ['<object id="mediaplayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject"><param name="hidden" value="true"/><param name="URL" value=""/></object>',
		'<embed type="application/x-mplayer2"></embed>'];
	this.component = document.getElementById('player');
	//document.body.appendChild(this.component);

	if (navigator.appName.toLowerCase().indexOf('microsoft')+1) {
		this.component.innerHTML = html[0];
	} 
	else {
		this.component.innerHTML = html[1];
	}

	this.load = function(mp3Url) {
		//this.o.URL = mp3Url;
		this.mp3Url = mp3Url;
	}
	this.play = function() {
		if (document.mediaplayer) {
			document.mediaplayer.fileName = this.mp3Url;
			document.mediaplayer.play();
		}
	}
	this.stop = function() {
		if (document.mediaplayer) {
			document.mediaplayer.stop();
		}
	}
	//TODO: for future use
	/*
	this.pause = function() {
	}*/
}

var soundManager = null;

function soundManagerInit() {
  soundManager = new SoundManager();
}

soundManagerInit();
wmpPostInitHook();
