/*--------------------------------------------*/
// Music Online verion 3.1
/*--------------------------------------------*/

function confirmDelete() {
var agree=confirm("Are you sure you want to delete selected song?");
  if (agree)
	return true ;
else
	return false ;

}

function CheckAll()
{
	var fmobj = document.forms['mutliact'];
	for (var i=0; i<fmobj.elements.length; i++)
	{
		var e = fmobj.elements[i];
		if ((e.name != 'allbox') && (e.type == 'checkbox') && (!e.disabled) && (e.value))
		{
			e.checked = fmobj.elements['allbox'].checked;
		}
	}
}

function toggleuploadmode(file) {
	if (file) {
		document.getElementById('upfile').style.display='block';
		document.getElementById('upurl').style.display='none';
		
	} else {
		document.getElementById('upfile').style.display='none';
		document.getElementById('upurl').style.display='block';
		
	}
}

function focusfield(fl) {
	if (fl.value=="Enter link here") {
		fl.value='';
		//fl.style.color='black';
	}
}

function changeMute(){
Player.settings.mute = 'true';
mute.innerHTML='<a href="#" onClick="changeMute2();">Mute*</a>';
}
function changeMute2(){
Player.settings.mute = 'false';
mute.innerHTML='<a href="#" onClick="changeMute();">Mute</a>';
}
function initiateStation(){
toPlay = document.getElementById('thisStation')
toPlay = toPlay.options[toPlay.options.selectedIndex].value
newRadio = "";
newRadio += "<OBJECT width='380' height='320' ID='Player'  classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'>"
newRadio += "<PARAM name='URL' value='" + toPlay + "' id='insert_1'>"
newRadio += "<PARAM name='uiMode' value='full'>"
newRadio += "<PARAM name='mute' value='false'>"
newRadio += "<PARAM name='ShowControls' value='1'>"
newRadio += "<PARAM name='ShowStatusBar' value='1'>"
newRadio += "<PARAM name='ShowDisplay' value='1'>"
newRadio += "<PARAM name='Volume' value='100'>"
newRadio += "<EMBED type='application/x-mplayer2' "
newRadio += "pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/' "
newRadio += "SRC='" + toPlay + "' "
newRadio += "name='Player' "
newRadio += "width='380' "
newRadio += "height='320' "
newRadio += "AutoStart='true' "
newRadio += "showcontrols='1' "
newRadio += "showstatusbar='1' "
newRadio += "showdisplay='1' "
newRadio += "id='insert_2'>"
newRadio += "</EMBED>"
newRadio += "</OBJECT>"
document.getElementById('radio').innerHTML = newRadio
}
function updateSourcePage(url){
	if (top.mainWindow){
		if (top.mainWindow.closed){
			top.mainWindow = parent.window.open(url);
			top.mainWindow.opener = this;
		} else {
			top.mainWindow.location = url;
		}
		top.mainWindow.focus();
	} else if ((parent.window.opener == null) || (parent.window.opener.closed)){
		var OriginalWindow = parent.window.open(url);
		OriginalWindow.opener = this;
		OriginalWindow.focus();
	} else {
		parent.window.opener.location = url;
		parent.window.opener.focus();
	}
}

function fullScreen() {
	document.getElementById('Player').fullScreen=true;
}

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 

function mtitle(e,num){
	var curLink = "";
	var span = document.getElementById('title' + num);
	if(curLink != ""){ curLink.style.display = 'none'; }
	curLink = span;
	if(!document.all){
		span.style.left = e.pageX + 25;
	}else{
		op = e.srcElement.offsetParent;
		span.style.pixelLeft = e.clientX + document.body.scrollLeft + 25;
	}
	span.style.display = 'block';
}

function unmtitle(num){
	var span = document.getElementById('title' + num );
	span.style.display = 'none';
}
function validateDelete() {	
	if(document.mutliact.aw.value == "del")
	{
		var agree=confirm("Are you sure you want to delete selected song?");
		  if (agree)
			return true ;
		else
			return false ;
	}
	return true;
}