function Tocar()
{
    document.getElementById('embPlayer').controls.play();
}

// controle para radio
function Parar()
{
    document.getElementById('embPlayer').controls.stop();
}

// controle incrementa volume
function MaisVol()
{
    if(document.getElementById('embPlayer').GetVolume != undefined)
	{
		curVolume = document.getElementById('embPlayer').GetVolume();
		newVolume = (curVolume + 10);
		if(newVolume < 100)
		{
			document.getElementById('embPlayer').SetVolume(newVolume);
		}
		else
		{	
			document.getElementById('embPlayer').SetVolume(100);	
		}
		//alert(document.embPlayer.GetVolume());
	}
	else
	{
		document.getElementById('embPlayer').settings.volume = document.getElementById('embPlayer').settings.volume + 20;
	}
}

// controle decrementa volume
function MenosVol()
{
    if(document.getElementById('embPlayer').GetVolume != undefined)
	{
		curVolume = document.getElementById('embPlayer').GetVolume();
		newVolume = (curVolume - 10);
		if(newVolume > 10)
		{
			document.getElementById('embPlayer').SetVolume(newVolume);
		}
		else
		{
			document.getElementById('embPlayer').SetVolume(0);
		}
		//alert(document.embPlayer.GetVolume());
	}
	else
	{
		document.getElementById('embPlayer').settings.volume = document.getElementById('embPlayer').settings.volume - 20;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




//script

xvolume = -600;

contiRPlayer = '<object id="WMPlay" width="0" height="0" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"   codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" viewastext hspace="0" vspace="0" align="baseline"> <param name="FileName" value="house-dj.asx"> <param name="AutoStart" value="True"> <param name="TransparentAtStart" value="True"> <param name="ShowControls" value="0"> <param name="ShowDisplay" value="true"> <param name="ShowStatusBar" value="1">  <param name="AutoSize" value="0"> <param name="AnimationAtStart" value="true"> <!--NETSCAPE PLUG-IN STARTS HERE-->              <embed width="172" height="19" autostart="True" align="baseline" type="application/x-mplayer2" id="MediaPlayer" transparentatstart="True" showcontrols="0" showdisplay="true" showstatusbar="1" animationatstart="true" filename="house-dj.asx" autosize="0"> </embed></object>';

tocando = 1;
function PlayClick() {
	if (tocando == 0) {
		document.getElementById("player").innerHTML = contiRPlayer;
		tocando = 1;
	}
}

function StopClick() {
	tocando = 0;
	document.getElementById("player").innerHTML = "";
}

function UpVolumeClick() {
	if (tocando == 1) {
		if ( xvolume <= -300){
			xvolume = xvolume+300;
		}
		
		document.getElementById("player").innerHTML = '<object id="WMPlay" width="0" height="0" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"   codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" viewastext hspace="0" vspace="0" align="baseline"> <param name="FileName" value="house-dj.asx"> <param name="AutoStart" value="True"> <param name="TransparentAtStart" value="True"> <param name="ShowControls" value="0"> <param name="ShowDisplay" value="true"> <param name="ShowStatusBar" value="1">  <param name="AutoSize" value="0"> <param name="AnimationAtStart" value="true"> <param name="Volume" value="'+xvolume+'"><!--NETSCAPE PLUG-IN STARTS HERE-->              <embed width="172" height="19" autostart="True" align="baseline" type="application/x-mplayer2" id="MediaPlayer" transparentatstart="True" showcontrols="0" showdisplay="true" showstatusbar="1" animationatstart="true" filename="house-dj.asx" autosize="0" volume="'+xvolume+'"> </embed></object>';
	}
}

function DownVolumeClick() {
	if (tocando == 1) {
		if ( xvolume >= -8000){
			xvolume = xvolume-300;
		}
		document.getElementById("player").innerHTML = '<object id="WMPlay" width="0" height="0" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"   codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" viewastext hspace="0" vspace="0" align="baseline"> <param name="FileName" value="house-dj.asx"> <param name="AutoStart" value="True"> <param name="TransparentAtStart" value="True"> <param name="ShowControls" value="0"> <param name="ShowDisplay" value="true"> <param name="ShowStatusBar" value="1">  <param name="AutoSize" value="0"> <param name="AnimationAtStart" value="true"> <param name="Volume" value="'+xvolume+'"><!--NETSCAPE PLUG-IN STARTS HERE-->              <embed width="172" height="19" autostart="True" align="baseline" type="application/x-mplayer2" id="MediaPlayer" transparentatstart="True" showcontrols="0" showdisplay="true" showstatusbar="1" animationatstart="true" filename="house-dj.asx" autosize="0" volume="'+xvolume+'"> </embed></object>';
	}
}
