var tracks=new Object();
tracks.createWindow=function(){
	if($('#download-page').length<1){
		var mes='<div class="close-button"></div><div id="download-page"><div class="content"><div class=message><div class=links><span class="download-header">'+canDownload+'</span></div></div></div></div>';
		$('body').append(mes);}
	$('#download-page').animate({opacity:1});	
	if($('#download-back').length<1)
		$('body').append('<div id="download-back"></div>');
	$('#download-back').animate({opacity:0.6});
	}

tracks.removeWindow=function(){
	$('#download-page').animate({opacity:0},function(){	$('#download-page').remove();});	
	$('#download-back, .close-button').animate({opacity:0},function(){	$('#download-back').remove();});};

tracks.createLink=function(links){
	if(typeof(links)=='undefined') return '';
	return '<a href="'+links.url+'" target=_blank>'+links.name+'</a><br>';}

tracks.download=function(track){
	tracks.createWindow();
	for(var i=0;i<track.length;i++)
		$('#download-page .content .message .links').append(tracks.createLink(track[i]));
	$('#download-page .content .message').jScrollPane({showArrows:true,scrollbarWidth:10,dragMaxHeight:71});};

	$('#download-back, .close-button').live('click',function(){
		tracks.removeWindow();});
