var xmlHttp;

function showSetList(setID){ 
	// LIVE
	var urlSet="http://www.deejaycountzero.com/includes/setlists.php";	
	// Test
	// var urlSet="http://localhost/CO/includes/setlists.php";
	// var urlTrack="http://localhost/CO/includes/trackinfo.php";

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		document.getElementById("setList").innerHTML= "Browser does not support HTTP Request"; 
		return ;
	}
	urlSet=urlSet+"?setID="+setID+"&sid="+Math.random();
	//alert("URL is : " + urlSet);
	xmlHttp.onreadystatechange=stateChanged_Set; 
	document.getElementById("setList").innerHTML="<table width='585'><tr><td width='585'>Getting Data .........................</td></tr></table>";
	xmlHttp.open("GET",urlSet,true);
	xmlHttp.send(null);
	return;
}


function showTrackInfo(setID, trackID){ 
	// LIVE
	var urlSet="http://www.deejaycountzero.com/includes/setlists.php";	
	// Test
	// var urlSet="http://localhost/CO/includes/setlists.php";
	var urlTrack="http://localhost/CO/includes/trackinfo.php";

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		document.getElementById("trackID").innerHTML= "Browser does not support HTTP Request"; 
		return ;
	}
	urlTrack=urlTrack+"?setID="+setID+"&trackID="+trackID+"&sid="+Math.random();
	//alert("URL is : " + urlTrack);
	xmlHttp.onreadystatechange=stateChanged_Track; 
	document.getElementById("trackID").innerHTML="<table width='585'><tr><td width='585'>Getting Data .........................</td></tr></table>";
	xmlHttp.open("GET",urlTrack,true);
	xmlHttp.send(null);
	return;
}

function stateChanged_Set() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("setList").innerHTML=xmlHttp.responseText ;
	} 
}

function stateChanged_Track() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("trackID").innerHTML=xmlHttp.responseText ;
	} 
}

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;
}

/*
If an item in the drop down box is selected the function executes the following:
1 Calls on the GetXmlHttpObject function to create an XMLHTTP object 
2 Defines the url (filename) to send to the server 
3 Adds a parameter (q) to the url with the content of the dropdown box 
4 Adds a random number to prevent the server from using a cached file 
5 Call stateChanged when a change is triggered 
6 Opens the XMLHTTP object with the given url. 
7 Sends an HTTP request to the server 
*/