// JavaScript Document
function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

function getDownloads(param, name) {
  http = createRequestObject(); 
  var myurl = 'http://www.agitpoprecords.com/scripts/get_downloads.php'; 
  http.open("GET", myurl + "?id=" + param + "&name="+name);
  http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  http.onreadystatechange = useHttpResponse;
  http.send(null);
} 

function useHttpResponse() {
  if (http.readyState == 4) {
    var textout = http.responseText;
	var x=document.getElementById('downloads').innerHTML=textout;
  }
}

function getDownArtistsList(){
  http_1 = createRequestObject(); 
  var myurl_1 = 'http://www.agitpoprecords.com/scripts/getDownArtistsList.php'; 
  http_1.open("GET", myurl_1);
  http_1.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  http_1.onreadystatechange = useHttpResponse_1;
  http_1.send(null);
}

function useHttpResponse_1() {
  if (http_1.readyState == 4) {
    var textout = http_1.responseText;
	var x=document.getElementById('artists_list').innerHTML=textout;
	getDownloads('DAT', 'DAT')
  }
}

function setSize(){
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById('artists_list').style.height='350';
		document.getElementById('downloads').style.height='350';
	}
	else{
		document.getElementById('artists_list').style.height='';
		document.getElementById('downloads').style.height='';
	}
}
