
/* ----------- Image Upload ----------- */

var fproc;
var formInfoId;


function uploadFile() {
  if (!fproc) {
    fproc = new fProcess();
  }

  // fproc.debug=true;
  fproc.onerror = errorUploadFile;
  fproc.onsuccess = imageHandler;
  fproc.init('UPLOAD', '/de/binary/upload_userimage.xml');
  fproc.submit();
}

function imageHandler(res) {
  if (res.content) {
    document.getElementById('image0').src = res.content.picuri;
  }
}

function errorUploadFile(res) {
  // alert(res);
}

/* ----------- tooltip ----------- */
wmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e){
    if (wmtt != null) {
        var x;
        var y;
        if (!e) {
            e = window.event;
        }

        if (e.pageX) {
            x = e.pageX;
            y = e.pageY;
        }
        else {
            x = e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
            y = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        }
        wmtt.style.left = (x - 120) + "px";
        wmtt.style.top = (y + 20) + "px";
    }
}

function showWMTT(id){
    wmtt = document.getElementById(id);
    wmtt.style.display = "block"
}

function hideWMTT(){
    wmtt.style.display = "none";
    wmtt = null;
}

