JavaLikeCalc.JavaScript
curTm = SYS.time();
if(!trnd1_tSek) trnd1_tSek = curTm;

//Events process
for(off = 0, ev_rez = ""; (ev_cur=event.parse(0,"\n",off)).length; ) {
	//Special.FLibSYS.messPut("Trend",0,"Event: "+ev_cur);
	if(ev_cur == "key_presSC#3b:/trnd1")			trnd1_tSek -= trnd1_tSize/2;
	else if(ev_cur == "key_presSC#3c:/trnd1")	trnd1_tSek += trnd1_tSize/2;
	else ev_rez += (ev_cur+"\n");
}
event = ev_rez;

//Trend time control
if(trnd1_curSek > trnd1_tSek || trnd1_curSek < (trnd1_tSek-trnd1_tSize)) trnd1_curSek = trnd1_tSek;
if(trnd1_tSek < curTm)	trnd1_trcPer = 0;
else trnd1_trcPer = 1, trnd1_tSek = 0;

//Generic
name_arg0val = grpName;

for(i = 0; i < 8; i++) {
	el = this["el"+(i+1)];
	if(el.attr("prmAddr").isEVal())	{ el.attrSet("en",false); this.trnd1.attrSet("prm"+i+"addr",""); }
	else {
  		el.attrSet("en", true);
		this.trnd1.attrSet("prm"+i+"addr",el.attr("prmAddr"))
						.attrSet("prm"+i+"bordL",el.attr("min")).attrSet("prm"+i+"bordU",el.attr("max"))
						.attrSet("prm"+i+"color",el.attr("bordColor"));
	}
}