
function previewSelect(loc,id) {
    // here you can do something after selecting a file - loc is the parameter you provide in the config!
    // id the number you have selected in the list!
   // you can call e.g. a php page where you have stored infos when selecting a file!
   document.getElementById("status").innerHTML = "Status: previewSelect(..) called. Parameter: loc=" + loc + ", id=" + id;
}

function deleteFile(loc) {
    // here you can do something after deleting a file - loc is the parameter you provide in the config!
     document.getElementById("status").innerHTML = "Status: deleteFile(..) called. Parameter: loc=" + loc;
}

function changeFolder(loc) {
    // here you can do something after changing a folder - loc is the parameter you provide in the config!
     document.getElementById("status").innerHTML = "Status: changeFolder(..) called. Parameter: loc=" + loc;
}

function createFolder(status,loc) {
    // here you can do something after creating a folder - loc is the parameter you provide in the config!
     if (status == "exists")     statusstr="folder exists"; 
     else if (status == "true")  statusstr="folder created";
     else if (status == "false") statusstr="folder not created";
     else statusstr = "unknown status";
     document.getElementById("status").innerHTML = "Status: changeFolder(..) called. Parameter: loc=" + loc + ", status=" + statusstr;
}

function renameFolder(status,loc) {
    // here you can do something after renaming a folder - loc is the parameter you provide in the config!
     if (status == "exists")     statusstr="destination folder exists"; 
     else if (status == "true")  statusstr="folder renamed";
     else if (status == "false") statusstr="folder not renamed";
     else statusstr = "unknown status";
     document.getElementById("status").innerHTML = "Status: renameFolder(..) called. Parameter: loc=" + loc + ", status=" + statusstr;
}

function deleteFolder(status,loc) {
    // here you can do something after deleting a folder - loc is the parameter you provide in the config!
     if (status == "true")     statusstr="folder deleted"; 
     else if (status == "false") statusstr="folder not deleted";
     else statusstr = "unknown status";
     document.getElementById("status").innerHTML = "Status: deleteFolder(..) called. Parameter: loc=" + loc + ", status=" + statusstr;
}

function copymove(doCopyFolder,type,total,ok,error,exits,param) {
  // here you can do something after copying/moving a file or folder - loc is the parameter you provide in the config!
   // doCopyFolder = if "true" a folder action was done, "false" a file action
   // type = "m" = move, otherwise copy
   // total = Total number of files moved/copied
   // ok = Files copied/moved without errors
   // error = Files copied/moved with errors
   // exits = Number of files that already existed and are not overwritten
   // param = is the parameter you provide in the config!
   targetstr = (doCopyFolder == "true") ?  "folder" : "file";
   typestr = (type == "m") ? "move" : "copy";
   document.getElementById("status").innerHTML = "Status: copymove(..) called. Parameter: loc=" + loc + ", target=" + targetstr + ", type=" + typestr + ", total=" + total + ", ok=" + ok + ", error=" + error + ", exists="+exists;
}


/**
This function is only here to demonstrate the different languages of TWG
Normaly you add this parameter directly like shown below in the code.
*/
function changeLanguage(lang) {
   var so = new SWFObject("twg_flash_uploader.swf?lang=" + lang, "mymovie", "650", "340", "8", "#ffffff");
   so.addParam("scale","noScale");
   so.addParam("allowfullscreen","true");
   so.write("flashcontent");
}
