var dlNr;
var dlFile;

function jsDownload(vNr,vFile)
{
  //jsBG();
	//jsLoader();
	jsTest();
	dlNr = vNr;
	dlFile = vFile;
	//document.getElementById('ajaxtext').innerHTML = 'Daten werden geladen...';
	var url="download_count.asp?nr="+vNr+"&rdm="+vRdm;
	xmlHttp.onreadystatechange=stateChangedCount;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChangedCount() 
{ 
	if (xmlHttp.readyState==4)
	{ 
  	//document.getElementById("ajax_loader").style.display = 'none';
    document.getElementById('dlcount'+dlNr).innerHTML = xmlHttp.responseText;
    if (dlFile.indexOf(".pdf") != -1)
    {
      //location.href= "download/"+dlFile;

      window.open("download/"+dlFile,"_blank","Download "+dlFile,"width="+screen.width+",height="+screen.height);
    }
    else
    {
      location.href= "download/"+dlFile;
    }
	}
}


