JavaLikeCalc.JavaScript
var bordWidth_;
if(bordWidth_.isEVal())	bordWidth_ = bordWidth;
if(f_stop)	bordWidth = bordWidth_;
if(!pDscr.isEVal())
	tipTool = pDscr + ((!pErr.isEVal()&&pErr.toInt())?"\n"+tr("Error")+": "+pErr:"");
name_en = pName.length;
name_text = pName;
name_geomW = pNameSz;
val_arg0val = pVal;
val_font = "Arial 20 1 0 0 0";
if(!prec.isEVal()) val_arg0cfg = ((prec>=0)?";f;":";g;")+abs(prec);
if(pVal.isEVal()) {
	val_color = "grey";
	val_font = "Arial 20 0 1 0 1";
	alarm = "";
	pErrCode = 0;
	bordColor = "gray", bordWidth = bordWidth_;
	return;
}

//Notification create
if(!pErr.isEVal() && pErrCode != pErr) {
	pErrCode = pErr;
	alTp = (!spName.isEVal() && spName.length) ? 7 : 3;
	if(pErrCode == 1 || pErrCode == 2)	alarm = "100|"+pNAME+"||1";
	else if(pErrCode == 3)	alarm = "50|"+pNAME+"|"+spName+" "+tr("above alarm border")+".|"+alTp;
	else if(pErrCode == 4)	alarm = "50|"+pNAME+"|"+spName+" "+tr("bellow alarm border")+".|"+alTp;
	else if(pErrCode == 5)	alarm = "10|"+pNAME+"|"+spName+" "+tr("above warning border")+".|"+alTp;
	else if(pErrCode == 6)	alarm = "10|"+pNAME+"|"+spName+" "+tr("bellow warning border")+".|"+alTp;
	else if(pErrCode == 10) alarm = "10|"+pNAME+"|"+pErr.parse(1,":")+".|"+alTp;
	else if(pErrCode == 11) alarm = "50|"+pNAME+"|"+pErr.parse(1,":")+".|"+alTp;
	else if(alarmSt&0x100) alarm = "1|"+pNAME+"||1";
}
if(!pErrCode && alarmSt&0x100 && !(alarmSt&0x10000)) alarm = "";

//Notification color change
alarmLev = alarmSt&0xFF;
if(alarmLev && alarmSt&0x100) {
	blinkPr = true;
	if(!pErrCode || alarmLev <= 1) wColor = labColorGood;
	else if(alarmLev < 30)	wColor = labColorWarning;
	else if(alarmLev < 75)	wColor = labColorAlarm;
	else { wColor = "grey"; blinkPr = false; }
	if(blinkPr) val_color = (alarmSt&0x10000 && val_color == wColor) ? "grey" : wColor;
	else { 
		if(pErrCode == 1 || pErrCode == 2)	{ val_color = wColor; val_font = "Arial 20 0 1 0 1"; }
		else val_color = wColor;
	}
}
else val_color = labColorGood;

//Blink focused or linked with ElCadr
if(this.attr("focus") ||
	(!pNAME.isEVal() && pNAME.length && this.wdgAt("/s/pg_control/pg_ElCadr",true).attr("pgOpen") && this.wdgAt("/s/pg_control/pg_ElCadr",true).attr("prmShifr") == pNAME))
{
  bordColor = (bordColor == "silver") ? "grey" : "silver";
  bordWidth = 2;
}
else { bordColor = "grey"; bordWidth = bordWidth_; }