// JavaScript Document
var xmlHttp
var loadstatustext="<img src='loading.gif' /> Requesting content..."

function showHint(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="play.php";
url=url+"?sID="+str;
document.getElementById("txtHint").innerHTML=loadstatustext
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}
// Indika -------------------------------------------------------------------------------------
// Artists
function getArtist(str)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="artists.php";
	url=url+"?alpha="+str;
	document.getElementById("artistArea").innerHTML=loadstatustext
	xmlHttp.onreadystatechange=artistChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function artistChanged() 
{ 
	if (xmlHttp.readyState==4)
		{ 
		
		document.getElementById("artistArea").innerHTML=xmlHttp.responseText;
		}
}

// Songs
function getSongs(str)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="songs.php";
	url=url+"?Artist="+str;
	document.getElementById("songArea").innerHTML=loadstatustext
	xmlHttp.onreadystatechange=songChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function songChanged()  // Actually Song Area
{ 
	if (xmlHttp.readyState==4)
		{ 
		document.getElementById("songArea").innerHTML=xmlHttp.responseText;
		}
}



// Video
function getVideo(str)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="videos.php";
	url=url+"?Song="+str;
	document.getElementById("txtHint").innerHTML=loadstatustext
	xmlHttp.onreadystatechange=videoChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function videoChanged()  // Actually Song Area
{ 
	if (xmlHttp.readyState==4)
		{ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		}
}

// Indika -------------------------------------------------------------------------------------

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}