
function vxCredits(){
	var sCredits = 'Embedded Windows Media Player version 3.1\nWrapper by Voynex.com';
	alert(sCredits);
}

function bool2str(fVal){
}

function bool2char(fVal){
	return fVal ? "1" : "0";
}

function vxCreateWmp(fShowControls, sFileName){
	var csWmpCodeBase = 'http://www.microsoft.com/Windows/MediaPlayer';
	var sTxt = "";
	var isIE = (window.ActiveXObject != null);

	sTxt+= '	<object id="wmpplugin"';
	if( isIE ){
		var csWmp7Clsid = 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6';
		sTxt+= ' classid="' + csWmp7Clsid + '"';
		sTxt+= ' type="application/x-oleobject"';
	}
	else{
		sTxt+= ' data="' + sFileName + '"';
		sTxt+= ' type="application/x-ms-wmp"';
	}

	sTxt+= ' codebase="' + csWmpCodeBase + '"';
	sTxt+= '  standby="Loading Windows Media Player components...">';
	sTxt+= '	<param name="ShowControls" value="' + fShowControls + '" />';
	sTxt+= '	<param name="TransparentAtStart" value="false" />';
	sTxt+= '	<param name="SendPlayStateChangeEvents" value="false" />';
	sTxt+= '	<param name="EnableContextMenu" value="false" />';

	if( isIE && sFileName ){
		sTxt+= '		<param name="URL" value="'+ sFileName + '" />';
	}

	sTxt+= '	  <embed type="application/x-mplayer2" name="wmp"';
	sTxt+= '		   pluginspage="' + csWmpCodeBase + '"';

	if( sFileName ){
		sTxt+= '		   src="' + sFileName + '" ';
	}

	sTxt+= '		   autostart="1" SendPlayStateChangeEvents="0" EnableContextMenu="0" ShowControls="' + bool2char(fShowControls) + '"></embed>';
	sTxt+= '	</object>';

	document.writeln(sTxt);

	return document.getElementById("wmpplugin");
}

//constructor for the main vxEncWmp class

/*
function vxEncWmp(fShowControls, sFileName){
	this.oCore = vxCreateWmp(fShowControls, sFileName);
}
*/

function vxEncWmp(fShowControls, sFileName){
	if( sFileName ){
		sFileName = vxDecrypt(sFileName);
	}
	this.oCore = vxCreateWmp(fShowControls, sFileName);
}


vxEncWmp.prototype.play = function(){
	this.oCore.controls.play();
}

vxEncWmp.prototype.stop = function(){
	this.oCore.controls.stop();
}

vxEncWmp.prototype.forward = function(){
	this.oCore.controls.fastForward();
}

vxEncWmp.prototype.reverse = function(){
	this.oCore.controls.fastReverse();
}

vxEncWmp.prototype.fullScreen = function(fFullScreen){
	this.oCore.fullScreen = fFullScreen;
}

vxEncWmp.prototype.setUrl = function(sUrl){
	sUrl = vxDecrypt(sUrl);
	this.oCore.URL = sUrl;
}
