// JavaScript Document
function GetHTTPObject()
{   
	if (window.ActiveXObject) 
		return new ActiveXObject("Microsoft.XMLHTTP");   
	else if (window.XMLHttpRequest) 
		return new XMLHttpRequest();   
	else 
	{      
		alert("Your browser does not support AJAX.");      
		return null;   
	}
} 



function RefreshSong(id, taalId)
{       
	httpObject = GetHTTPObject();
	
	if (httpObject != null) 
	{   
		var url = "./song.php";
		var params = "ProductId="+id+"&TaalId="+taalId;
		httpObject.open("POST", url, true);
		
		//Send the proper header information along with the request
		httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		httpObject.setRequestHeader("Content-length", params.length);
		httpObject.setRequestHeader("Connection", "close");
		
		httpObject.onreadystatechange = function() {//Call a function when the state changes.
			if(httpObject.readyState == 4 && httpObject.status == 200) {
				$('#musicDiv').html(httpObject.responseText);
			}
		}
		httpObject.send(params);
	}	
}

function NewSong(id, taalId)
{
	RefreshSong(id, taalId);
	//$('#musicDiv').slideUp('slow', function() {RefreshSong(id);});
}
