// important notes about change_dest()
//
// form_handler.php will eat all GET variables passed directly to it, so the resulting page will not see them.
// thus, if you want the header code (initially executed as a part of form_handler) to see your GET vars,
// call them like this: change_dest("myscript.php&myvar=myval");.  If you want the final page to see the GET
// variables, call like this: change_dest("myscript.php?myvar=myval");.  This is because the original GET will
// interpret the '?' as part of a value, but will interpret the '&' as the beginning of the next variable.
function change_dest(dest) {
   if (window.document.tmcopsForm != null) {
    window.document.tmcopsForm.action='form_handler.php?dest=' + dest;
    window.document.tmcopsForm.submit();
   } else {
        window.location=dest;
   }
}

function change_dest_no_handler(dest) {
   if (window.document.tmcopsForm != null) {
    window.document.tmcopsForm.action=dest;
    window.document.tmcopsForm.submit();
   } else {
        window.location=dest;
   }
}

function change_dest_no_submit(dest) {
   if (window.document.tmcopsForm != null) {
    window.document.tmcopsForm.action='form_handler.php?dest=' + dest;
   }
}

function value_copy() {
	return;
}

function sidebarSubmit(token) {
    if (window.document.tmcopsForm != null) {
//      alert("posting tmcopsForm");
        window.document.tmcopsForm.action=window.document.sidebar_form.action;
        window.document.tmcopsForm.sidebar_token.value=token;
        window.document.tmcopsForm.submit();
    } else {
//      alert("posting sidebar_form");

        window.document.sidebar_form.sidebar_token.value=token;
        window.document.sidebar_form.submit();
    }
}