// JavaScript Document

var global_temp = "";

function swap(URL){
	global_temp = document.getElementById('mixtape').innerHTML;
	loadData(URL);
}
	
function loadData(URL){
	xmlhttp=null
	
	// Mozilla, etc.
	if (window.XMLHttpRequest){
  		xmlhttp=new XMLHttpRequest()
  	}
	
	// IE
	else if (window.ActiveXObject){
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  	}

	if (xmlhttp!=null){
 		xmlhttp.onreadystatechange=update
  		xmlhttp.open("GET",URL,true)
  		xmlhttp.send(null)
	}

	else{
  		alert("Your browser does not support XMLHTTP.")
	}
}

function update(){
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4){
		// if "OK"
		if (xmlhttp.status==200){
			document.getElementById('mixtape').innerHTML=xmlhttp.responseText
	  	}
	  	else{
	  		alert("Problem retrieving data:" + xmlhttp.statusText)
	  	}
	}
}

function show_item(){
	document.getElementById('mixtape').innerHTML = global_temp;
}
	