function download(url){
    newurl = url + '&page=' + window.location.pathname;
    reg = /utmcsr=([^|]+).*utmctr=([^;]+)/ig;
    match = reg.exec(document.cookie);
    if (match != null) newurl = newurl + '&se=' + match[1] + '&kw=' + match[2];
    params=newurl.replace(/^\/download\.stats\?/ig, "");
    $.ajax({
       type: "GET",
       url: Drupal.settings.basePath +"download.stats/JSCallByAJAX",
       data: params,
       async: false,
       dataType: "script"
   });
   location.href = newurl;
   return false;
}
function getid(){
    ct = new Date();
    m = ct.getUTCMonth()+1;
    return ""+ct.getUTCFullYear()+"-"+pad(m)+"-"+pad(ct.getUTCDate())+' '+pad(ct.getUTCHours())+":"+pad(ct.getUTCMinutes())+":"+pad(ct.getUTCSeconds())+' '+Math.floor(Math.random()*100000);
}
function pad(num){
  if(num<10) return "0"+num;
  else return ""+num;
}