function download_links()
{
  ext = new Array('ppt', '.wmv', '.avi', '.swf', '.doc', '.txt', '.mp3');
  objA = document.getElementById('content').getElementsByTagName('a');
  if (objA.length>0)
  {
	for (a=0; a<objA.length; a++)
	{
	  pos = zoekr(objA[a].href, '.');
	  if (pos>-1)
	  {
		extentie = objA[a].href.substring(pos, objA[a].href.length);
		result = false;
		for (f=0; f<ext.length; f++) if (ext[f]==extentie) result = true;
		if (result)
		{
		  pos2 = objA[a].href.indexOf('/bestanden');
		  if (pos2>-1)
		  {
			 objA[a].href = 'download.php?file=' + objA[a].href.substring(pos2, objA[a].href.length);
		  }
		}
	  }
	}
  }
} 
function zoekr(str,gezocht)
{
  if (str.length==0) return -1;
  for (zr=str.length-1; zr>=0; zr--)
  {
	if (str.substring(zr,zr+gezocht.length)==gezocht)
	{
	  return zr;
	}
  }
  return -1;
}
