
//  we call check_double_click with arguments: 
//  the name of the form the name of the hidden which keeps 
//  the number of clicks and the multilingual alert text
function  check_double_click(fname,hidd_name,alert_text) {
    if (eval("document."+fname+"."+hidd_name+".value") == 'clicked') {
       alert(alert_text)
       return false
    } else {
       eval("document."+fname+"."+hidd_name+".value = 'clicked'")    
       return true
    }
    
}


//  we call check_double_upload with arguments:
//  - the name of the form,
//  - the name of the hidden which keeps the time the last click happened and
//  - the multilingual alert text
function  check_double_upload(fname,hidd_name,alert_text) {
    now = new Date();
    then = eval("document."+fname+"."+hidd_name+".value");
//    alert("Now=" + now.getTime() + "\nThen=" + then + "\ndif=" + (now.getTime() - then));

    if ( (then > 0) && (now.getTime() - then) < 5000 ) {
       eval("document."+fname+"."+hidd_name+".value =" + now.getTime());
       alert(alert_text);
       return false
    } else {
       eval("document."+fname+"."+hidd_name+".value =" + now.getTime());
       eval("document."+fname+".submit()");
       return true
    }

}
