
// set subcmd value for submit
//
 function HR_SSUB(mp1str) {
     //alert(mp1str);
     if(mp1str.length > 0) {
 	window.document.form1.subcmd.value = mp1str; 
        window.document.form1.action = "/cgi-bin/appmain"; 
 	window.document.form1.submit();
 	}

     }

// set entire value for submit
//
 function HR_SUBC(mp1str) {
     //alert("/cgi-bin/appmain"+mp1str);
     if(mp1str.length > 0) {
        window.document.form1.action = "/cgi-bin/appmain?"+mp1str; 
 	window.document.form1.submit();
 	}

     }

// set command, subcmd values
//
 function hr_sub2(mp1str,mp2str) {
     //alert(mp1str);
     //alert(mp2str);
     if(mp1str.length > 0) {
 	window.document.form1.command.value = mp1str;
 	}
     if(mp2str.length > 0) {
 	window.document.form1.subcmd.value = mp2str; 
        window.document.form1.action = "/cgi-bin/appmain"; 
 	window.document.form1.submit();
 	}
     }

//
// - to remove the need for the server, just replace the hs_linkn function
//   with this ns_linkn function - it makes the same transfer, without using a server
//   (Does not carry the session_id ?? )


// effect the linkn call, without server 
//
 function ns_linkn(mp2str) {
     //alert(mp2str);
 	window.document.form1.command.value = "linkn";
 	window.document.form1.subcmd.value = mp2str; 
	var locj = "../" + mp2str + "?session_id=" + window.document.form1.session_id.value;
        window.document.location = locj;
 	//window.document.form1.submit();
     }


// call linkn with subcmd values - call lnkmain
//
 function hs_linkn(mp2str) {
     //alert(mp2str);
 	window.document.form1.command.value = "linkn";
 	window.document.form1.subcmd.value = mp2str; 
        window.document.form1.action = "/cgi-bin/lnkmain"; 
 	window.document.form1.submit();
     }

// set command, subcmd values - call lnkmain
//
 function hl_sub2(mp1str,mp2str) {
     //alert(mp1str);
     //alert(mp2str);
     if(mp1str.length > 0) {
 	window.document.form1.command.value = mp1str;
 	}
     if(mp2str.length > 0) {
 	window.document.form1.subcmd.value = mp2str; 
        window.document.form1.action = "/cgi-bin/lnkmain"; 
 	window.document.form1.submit();
 	}
     }

 function extract1(str) {
    //alert(str);
    theleft = str.indexOf("=") + 1;
    theright = str.lastIndexOf("&");
    if(theleft > theright) theright=200;
    return(str.substring(theleft, theright));
    }


// set command, subcmd values
//
 function hr_sub3(mp1str,mp2str) {
     //alert(mp1str);
     //alert(mp2str);
     if(mp1str.length > 0) {
 	window.document.form1.command.value = mp1str;
 	}
     if(mp2str.length > 0) {
 	//window.document.form1.session_id.value = session_id; 
 	window.document.form1.subcmd.value = mp2str; 
        window.document.form1.action = "/cgi-bin/appmain"; 
 	window.document.form1.submit();
 	}
     }

// set current time into page, and return value
//
 function gt24(pid, vid) {

     //alert(pid);
     var tag = "";
     now = new Date();
     hour = now.getHours();
     minutes = now.getMinutes();
     mins = (hour*60) + minutes;
     htag = '';
     if(hour < 10) htag='0';
     mtag = '';
     if(minutes < 10) mtag='0';
     time = htag + hour + ":" + mtag + minutes;
     //alert(time);

     //document.getElementById('show_d_2').innerHTML=time;
     //document.getElementById('ddow').value=time;
     document.getElementById(pid).innerHTML=time;
     document.getElementById(vid).value=mins;

     }

// set current date into page, and return value
//
 function gt_date(pid, vid) {
     //alert(pid);
     var tag = "";
     now = new Date();
     nday = now.getDate();
     nmonth = now.getMonth();
     nmonth += 1;
     nyear = now.getFullYear();

     sdate = nmonth + "/" + nday + "/" + nyear;

     document.getElementById(pid).innerHTML=sdate;
     document.getElementById(vid).value=sdate;

     }

 function dv_flip(pid, vid,s1,s2) {
     //alert(document.getElementById(vid).value);
     if(document.getElementById(vid).value == '0') document.getElementById(vid).value='1';
     else document.getElementById(vid).value='0';
     dv_set(pid, vid,s1,s2);
     }

 function dv_set(pid, vid,s1,s2) {
     //alert(document.getElementById(vid).value);
     if(document.getElementById(vid).value == '0')     document.getElementById(pid).innerHTML=s1;
     else      document.getElementById(pid).innerHTML=s2;
     }


  function no_back_button() {
 if(history.length>0) {
 /* self.location.reload(); */
 //alert("You cannot use the back button to get to this page");
 history.go(+1);
 return true;
 }
 }




