function startUpload(pid, wid, uid, filename)
{
    callbackurl = "http://www.hku-tv.nl/backend/callback.php?pid=" + pid + "&wid=" + wid + "&uid=" + uid;
    //alert(filename);
    return ""+getApplet().startupload(""+filename, callbackurl);
}

var theapplet=null;
function getApplet()
{
    
  if(theapplet != null) return theapplet;
  if(document.getElementById) if(document.getElementById("UploadApplet").knockknock()=="Who's there?") return (theapplet = document.getElementById("UploadApplet"));
  if(document.applets) if(document.applets[0].knockknock()=="Who's there?") return (theapplet = document.applets[0]);
  
  item = null;
  e = document.getElementsByTagName("embed");
  for(i in e) { if(e[i].name == "UploadApplet") { item = e[i]; } }
  if(item != null && item.knockknock() == "Who's there?") return (theapplet = item);

  e = document.getElementsByTagName("object");
  for(i in e) { if(e[i].name == "UploadApplet") { item = e[i]; } }
  if(item != null && item.knockknock() == "Who's there?") return (theapplet = item);
  
}
