JavaLikeCalc.JavaScript
function setActMess(mess) {
	if(err.isEVal())	SYS.messNote("OP:"+this.ownerSess().user()+":"+shifr, "'"+shifr+"'."+mess);
	else SYS.nodeAt(err).nodePrev().messSet("'"+shifr+"'."+mess, 2, "OP", this.ownerSess().user());
}

if(f_start) {
	c1Sv = c1;
	contextMenu = "";
	if(!com.isEVal() || !close.isEVal())
		contextMenu =	(digComs.isEVal()?tr("Start"):digComs.parse(0,";").parse(0,"-"))+":open\n"+
								(digComs.isEVal()?tr("Stop"):digComs.parse(1,";").parse(0,"-"))+":close\n";

	toFastCalc = toFastCalc_ = false;
}

toFastCalc = false;

if(this.attr("focus") ||
	(!shifr.isEVal() && shifr.length && this.wdgAt("/s/pg_control/pg_ElCadr",true).attr("pgOpen") && this.wdgAt("/s/pg_control/pg_ElCadr",true).attr("prmShifr") == shifr))
{
	c1 = (c1 == c1Sv) ? "#00ddff" : c1Sv;
	toFastCalc = true;
} else c1 = c1Sv;
fillColor = "gray";
if((st_open == true && st_close != true) || (st_open.isEVal() && st_close == false)) {
	fillColor = "green";
	if(!digStts.isEVal())	fillColor = digStts.parse(0,";").parse(1,"-");
}
if((st_close == true && st_open != true) || (st_close.isEVal() && st_open == false)) {
	fillColor = "red";
	if(!digStts.isEVal())	fillColor = digStts.parse(1,";").parse(1,"-");
}

//Events process
for(ev_rez = "", off = 0; (sval=event.parse(0,"\n",off)).length; ) {
	//SYS.messInfo("Kran","Event: "+sval);
	if(sval == "usr_open") {
		com = true; close = false;
		if((comVal=digComs.parse(0,";")).length) comVal = tr("START");
		setActMess(tr("Command")+" : "+DESCR+" : : "+comVal);
	}
	else if(sval == "usr_close") {
		com = false; close = true;
		if((comVal=digComs.parse(0,";")).length) comVal = tr("STOP");
		setActMess(tr("Command")+" : "+DESCR+" : : "+comVal);
	}
	else ev_rez += sval+"\n";
}
event = ev_rez;

if(toFastCalc != toFastCalc_)	{ toFastCalc_ = toFastCalc; this.calcPer(toFastCalc?500:-3); }