//------------------------------------
//JScode for the Exit confirmation
//It's called from a form, whenever a form field is modified 
var changed_flag;
function f_store() {
  changed_flag = 'yes';
}
//-----------------------------------
function exit_confirm(back_url) {
  if (changed_flag) {
    if (confirm(msg)) {
	return window.location = back_url;
      }
  } else {
    return window.location = back_url;
  }
}
//-----------------------------------
//JScode for opening a window
function openwindow(url,title,properties) {
  mywin = window.open(url,title,properties);
}

//-----------------------------------
//JScode for opening a textarea for the description of a starting discussion thread
function open_textarea(label, done) {
        var clicked = document.f1.create_thread.checked;
        if ( clicked == true ) {
                var win = window.open('','Browse','toolbar=no,scrollbars=yes,status=no,width=480,height=310,resizable=yes');

                var html = '<HTML><BODY><FORM><FONT face=Arial>'+ label +':</FONT><br><CENTER><TEXTAREA NAME="description" ROWS=10 COLS=50 WRAP="SOFT"></TEXTAREA><br><br><INPUT TYPE="button" NAME="'+ done+ '" VALUE="Done" ONCLICK="window.opener.document.f1.thread_description.value=description.value;window.close()"></CENTER></BODY></FORM></HTML>';

                win.document.open();
                win.document.write(html);
                win.document.close();
        }
}

//-----------------------------------
//JScode for alerting about the correct importing of a tab-separated file into MS-Excel 
function alert_excel_import() {
  var txt = 'When a tab-separated file is opened with MS Excel, in Step 2 of the "Text Import Wizard", there is an option for the "Text qualifier", which by default is the double quote, but the user is cautioned to select the {none} option from the relevant menu, to avoid any problems from the presence of double quotes in the file contents.';
  alert(txt);
}



