
function startDownload(mediaType, file)
{
	var downloadPopup = document.getElementById("downloadPopup");
	
	if (downloadPopup == null)
	{
		downloadPopup = document.createElement("div");
		downloadPopup.id = "downloadPopup";
	}
	
	downloadPopup.innerHTML = '<p>To download the ' + mediaType + ' file you\'ve requested, please <a href="' + file + '">right click here</a> and choose "save as".</p><p>You will then need to choose the location on your computer where you want the file to be saved.</p><h4>Terms of use</h4><div id="termsOfUse">The ABC (through Australia Network) grants you a licence to download these files for your private use only. You may not copy, reproduce, edit, adapt, alter, republish, post, broadcast, transmit, make available to the public or otherwise use these files in any way except for your own personal, non-commercial use. You may not download, or use these files for the purpose of promoting, advertising, endorsing or implying a connection with you (or any third party) and Australia Network (or the ABC), its agents or employees. Australia Network (and the ABC) will not be liable for any loss or damage (including any costs charged by your service provider incurred by you in receiving the download), which you may suffer as a result of or connected with the download or use of these files.</div><a id="downloadPopupClose" href="#" title="Close this popup">Close this popup</a>';
	document.getElementById("page").appendChild(downloadPopup);
	
	var downloadPopupClose = document.getElementById("downloadPopupClose");
	downloadPopupClose.onclick = closeDownload;
};




function closeDownload()
{
	var downloadPopup = document.getElementById("downloadPopup");
	downloadPopup.parentNode.removeChild(downloadPopup);
	
	return false;
};
