/* Copyright
   (c) 2010 bitSplit(tm) Enterprises
*/

BEGIN_ONLOAD

	[$DEF_name]UpdateConditions();
	
END_ONLOAD

BEGIN_DEFINITION

	var [$DEF_name]Global = new widgetGlobalVars;
	
	var [$DEF_name]ConditionsInterval 	= [$WIDGET_UPDATE_CONDITIONS_INTERVAL];
	var [$DEF_name]ConditionsIntervalID = 0;
	
	var	[$DEF_name]Clicked				= 0;
	
	var [$DEF_name]ImageArray			= 
	[[$IMAGE_LIST] 
	];

	var [$DEF_name]TextArray			= 
	[[$TEXT_LIST] 
	];

	//-----------------------------------------------------------------

	function [$DEF_name]UpdateConditions()
	{
		var globalObj 			= [$DEF_name]Global;
		var localObj			= new widgetLocalVars(globalObj);
		
		var	theDivObj			= document.getElementById("[$DEF_name]Div");
		
		var	theImageObj 		= document.getElementById("[$DEF_name]Image");
		var	theTextObj			= document.getElementById("[$DEF_name]Text");
		var	theTextLinkObj		= document.getElementById("[$DEF_name]TextLink");
		var	theTxtContentObj	= document.getElementById("[$DEF_name]Content1"); 	// text
		var	theImgContentObj	= document.getElementById("[$DEF_name]Content2"); 	// image

		var	theIFrameObj 		= document.getElementById("[$DEF_name]IFrame");

		var	colorObj			= null;
		
		//---
		// set up some initial values
		
		if (! localObj.steps) 
		{
			localObj.content 		= [$USE_TEXT];
			localObj.useWeather 	= [$USE_WEATHER];
			
			if (localObj.useWeather)
			{
				[$DEF_name]LoadWeather(1);
			}
		}
		else
		{
			if (localObj.useWeather)
				if ((globalObj.CurrentRealTime - globalObj.LastWeatherUpdate) >= 300000) // 5 min.
					[$DEF_name]LoadWeather(0);
		}

		//---
		
		if (! ON_DEVICE)
		{
			if (! DO_ANIMATE)
			{
				if ((localObj.steps)&&(! globalObj.waitForWeather))
					return;
			}
		}
		
		//---
					
		if ([$DEF_name]Clicked)
		{
			[$DEF_name]Clicked = 0;
			localObj.buttonClicked = 1;
		}
		
		widgetUpdateTime(globalObj);

		// localObj.time98 ranges from 0..1
		
		if (0)
		{
			localObj.time98 = globalObj.CurrentTime;
		}
		else // use a unit appropriate for the period to get a 'reasonable' 0 point
		{
			if (localObj.period98 <= 1)				localObj.time98 = globalObj.msAngle / 360 * 1000; 										
			else if (localObj.period98 <= 60)		localObj.time98 = globalObj.secondAngle / 360 * 60 * 1000; 							
			else if (localObj.period98 <= 3600)		localObj.time98 = globalObj.minuteAngle / 360 * 60 * 60 * 1000;			
			else if (localObj.period98 <= 86400)	localObj.time98 = globalObj.hourAngle24 / 360 * 24 * 60 * 60 * 1000;		
			else									localObj.time98 = globalObj.dayAngle / 360 * 31 * 24 * 60 * 60 * 1000;	
		}
		
		localObj.time98 = (localObj.time98 % (1000 * localObj.period98)) / (1000 * localObj.period98); // adjust to the period

		//---
		
		if (! ON_DEVICE)
		{
			if (! DO_ANIMATE)
			{
				localObj.time98 = 0;
			}
		}
		
		//---
		
		localObj.elapsedTime = globalObj.CurrentRealTime - globalObj.LastEvalTime;
		
		widgetKeepValuesInRange(localObj);
		
		str = theDivObj.style.left;
		localObj.left = parseInt(trimWhiteSpace(str), 10);

		str = theDivObj.style.top;
		localObj.top = parseInt(trimWhiteSpace(str), 10);
		
		str = theDivObj.style.width;
		localObj.width = parseInt(trimWhiteSpace(str), 10);

		str = theDivObj.style.height;
		localObj.height = parseInt(trimWhiteSpace(str), 10);

		if (globalObj.OrgWidth == undefined)	
			globalObj.OrgWidth = localObj.width;

		if (globalObj.OrgHeight == undefined)	
			globalObj.OrgHeight = localObj.height;

		if (theTextObj) 			colorObj = theTextObj;
		else if (theTextLinkObj)	colorObj = theTextLinkObj;
		else						colorObj = null;
		
		if (theDivObj)
		{
			var hslaArr = widgetGetHSLA(theDivObj.style.backgroundColor);
			
			if (hslaArr)
			{
				localObj.backHue 			= hslaArr[0];
				localObj.backSat			= hslaArr[1];
				localObj.backLite 			= hslaArr[2];
				localObj.backColorAlpha 	= hslaArr[3];
			}
			else
			{
				localObj.backHue 			= 0;
				localObj.backSat			= 100;
				localObj.backLite 			= 100;
				localObj.backColorAlpha 	= 100;
			}
		}
		
		if (colorObj)
		{
			var hslaArr = widgetGetHSLA(colorObj.style.color);

			if (hslaArr)
			{
				localObj.hue 			= hslaArr[0];
				localObj.sat			= hslaArr[1];
				localObj.lite 			= hslaArr[2];
				localObj.colorAlpha 	= hslaArr[3];
			}
			else
			{
				localObj.hue 			= 0;
				localObj.sat			= 100;
				localObj.lite 			= 50;
				localObj.colorAlpha 	= 100;
			}
		}

		localObj.left	+= gLast_left;
		localObj.top	+= gLast_top;
		
		// NOTE: we can't 'precompute' and values that depend on others
		// they may get changed by any of the conditions
		// so we need to always calculate them on the spot
		// (for example, distance to screen edge will change if we adjust the location before testing the distance)

		localObj.prevHue			= localObj.hue;
		localObj.prevSat			= localObj.sat;
		localObj.prevLite			= localObj.lite;
		localObj.prevColorAlpha		= localObj.colorAlpha;
		
		localObj.prevBackHue		= localObj.backHue;
		localObj.prevBackSat		= localObj.backSat;
		localObj.prevBackLite		= localObj.backLite;
		localObj.prevBackColorAlpha	= localObj.backColorAlpha;
		
		//---
		//---
		
		[$STYLE_CONDITIONS_1]
		
		//---
		//---
		
		[$STYLE_CONDITIONS_0]
		
		//---
		//---
		
		if (theIFrameObj) // if we have a full page iFrame, then we can only adjust visibility and orientation
		{
			try // these methods are only available on our own pages
			{
				if (localObj.visible)
				{
					theIFrameObj.contentWindow.hidePage(0);

					if (globalObj.LastAngle != gCond_DeviceAngle)
					{
						theIFrameObj.contentWindow.setAngle(gCond_DeviceAngle);
						theIFrameObj.contentWindow.updateOrientation();
						
						globalObj.LastAngle = gCond_DeviceAngle;
					}
				}
				else
				{
					theIFrameObj.contentWindow.hidePage(1);
				}
			}
			
			catch(err)
			{}
			
			//if (globalObj.LastVisible != localObj.visible)
			{	
				if (localObj.visible)	
				{
					document.getElementById("Main").style.display 		= 'none';  
					document.getElementById("Secondary").style.display 	= 'block';  
					
					theIFrameObj.style.visibility = 'visible';
					theDivObj.style.display	= 'block';  
					hidePage(1);
				}
				else			
				{
					document.getElementById("Secondary").style.display 	= 'none';  // otherwise *links* on 'Main' are disabled!
					document.getElementById("Main").style.display 		= 'block';  

					hidePage(0);
					theIFrameObj.style.visibility = 'hidden';
					theDivObj.style.display	= 'none';   
				}
			}
			
			globalObj.LastVisible = localObj.visible;
		}
		else
		{
			if (globalObj.LastVisible != localObj.visible)
			{	
				if (localObj.visible)	theDivObj.style.display	= 'block';  
				else					theDivObj.style.display	= 'none';   
			}
			
			if ((localObj.active)
				||(globalObj.LastActive) // when *becoming* inactive adjust settings one more time
			)
			{	
				if ((localObj.itIsTime)
					||(globalObj.LastDevAngle != gCond_DeviceAngle)
				)
				{
					localObj.left	-= gLast_left;
					localObj.top	-= gLast_top;

					//---
					
					if (localObj.setRotToDir)
					{
						var deltaX = localObj.left - globalObj.LastLeft;
						var deltaY = localObj.top - globalObj.LastTop;
						
						localObj.angle = 90 + Math.atan2(deltaY, deltaX)*(180/Math.PI); // NOTE: Y direction first; result in radians
					}
					
					if (localObj.absoluteRotation)
						localObj.angle -= gCond_DeviceAngle;
					
					widgetKeepValuesInRange(localObj);

					//---
					// keep text and image ids in range
					
					if ((localObj.imageID >= 0)&&([$DEF_name]ImageArray.length)) 	localObj.imageID = localObj.imageID % [$DEF_name]ImageArray.length;
					else															localObj.imageID = -1;

					if ((localObj.varImage0 >= 0)&&([$DEF_name]ImageArray.length))	localObj.varImage0 = localObj.varImage0 % [$DEF_name]ImageArray.length;
					else															localObj.varImage0 = -1;
					
					if ((localObj.varImage1 >= 0)&&([$DEF_name]ImageArray.length))	localObj.varImage1 = localObj.varImage1 % [$DEF_name]ImageArray.length;
					else															localObj.varImage1 = -1;
					
					if ((localObj.varImage2 >= 0)&&([$DEF_name]ImageArray.length))	localObj.varImage2 = localObj.varImage2 % [$DEF_name]ImageArray.length;
					else															localObj.varImage2 = -1;
					
					if ((localObj.textID >= 0)&&([$DEF_name]TextArray.length)) 		localObj.textID = localObj.textID % [$DEF_name]TextArray.length;
					else															localObj.textID = -1;
					
					//---
					// due to substitutions we have to process the text every time!
					
					if (globalObj.LastTextID != localObj.textID)
					{
						localObj.textChanged = 1;
						globalObj.LastTextID = localObj.textID;
					}

					if (globalObj.LastVarImage0 != localObj.varImage0)
					{
						localObj.textChanged = 1;
						globalObj.LastVarImage0 = localObj.varImage0;
					}

					if (globalObj.LastVarImage1 != localObj.varImage1)
					{
						localObj.textChanged = 1;
						globalObj.LastVarImage1 = localObj.varImage1;
					}

					if (globalObj.LastVarImage2 != localObj.varImage2)
					{
						localObj.textChanged = 1;
						globalObj.LastVarImage2 = localObj.varImage2;
					}

					if (localObj.content == 1)
					{
						if (theTextObj)
						{
							if ((localObj.textID >= 0)&&(localObj.textID < [$DEF_name]TextArray.length))	
							{
								var str, rep, src;
								var imgHeightStr;
								
								str = theTextObj.style.fontSize;
								
								globalObj.weatherIconsPath 	= "_Support_/WeatherIcons/"	//"[$DEFINITION]/WeatherIcons/";
								globalObj.weatherIconSet 	= "[$DEF_iconSet]";
								globalObj.fontSize 			= parseInt(trimWhiteSpace(str), 10);
								
								imgHeightStr = sprintf("%dpx", globalObj.fontSize);
								
								localObj.theText = widgetReplaceFormatPlaceholders(globalObj, [$DEF_name]TextArray[ localObj.textID ]);
								
								//---

								for (var i = 0; i < [$DEF_name]ImageArray.length; ++i)	
								{
									str = sprintf("\\$IMAGE_%d_", i);
									src = "[$DEFINITION]/" + [$DEF_name]ImageArray[i] + "[$IMGVERSION]";
									rep = '<img src="' + src + '" height="' + imgHeightStr + '" alt="" align=absmiddle>';
									
									localObj.theText = localObj.theText.replace(new RegExp(str,'g'), rep);
								}
								
								rep = "";
								src = "[$DEFINITION]/" + [$DEF_name]ImageArray[ localObj.varImage0 ] + "[$IMGVERSION]";
								if (localObj.varImage0 >= 0) rep = '<img src="' + src + '" height="' + imgHeightStr + '" alt="" align=absmiddle>';
								localObj.theText = localObj.theText.replace(/\$VAR_IMAGE0/g, rep);
								
								rep = "";
								src = "[$DEFINITION]/" + [$DEF_name]ImageArray[ localObj.varImage1 ] + "[$IMGVERSION]";
								if (localObj.varImage1 >= 0) rep = '<img src="' + src + '" height="' + imgHeightStr + '" alt="" align=absmiddle>';
								localObj.theText = localObj.theText.replace(/\$VAR_IMAGE1/g, rep);
								
								rep = "";
								src = "[$DEFINITION]/" + [$DEF_name]ImageArray[ localObj.varImage2 ] + "[$IMGVERSION]";
								if (localObj.varImage2 >= 0) rep = '<img src="' + src + '" height="' + imgHeightStr + '" alt="" align=absmiddle>';
								localObj.theText = localObj.theText.replace(/\$VAR_IMAGE2/g, rep);
							}

							//if (localObj.theText != theTextObj.innerHTML)
							
							if (localObj.theText != globalObj.LastText)
							{
								localObj.textChanged = 1;
								globalObj.LastText = localObj.theText;
							}
						}
					}
					
					if (globalObj.LastContent != localObj.content)
					{
						if (localObj.content == 0)	
						{
							if (theImgContentObj) theImgContentObj.style.display = 'block';
							if (theTxtContentObj) theTxtContentObj.style.display = 'none';
						}
						else
						{
							if (theTxtContentObj) theTxtContentObj.style.display = 'block';
							if (theImgContentObj) theImgContentObj.style.display = 'none';
						}
						
						globalObj.LastContent = localObj.content;
					}
					
					if (localObj.content == 0)
					{
						if (globalObj.LastImageID != localObj.imageID)
						{
							if (theImageObj)
							{
								if ((localObj.imageID >= 0)&&(localObj.imageID < [$DEF_name]ImageArray.length))	
									theImageObj.src = "[$DEFINITION]/" + [$DEF_name]ImageArray[ localObj.imageID ] + "[$IMGVERSION]";
							}
								
							globalObj.LastImageID = localObj.imageID;
						}
					}
					
					if (localObj.content == 1)
					{
						if (localObj.textChanged)
						{
							if (theTextObj)
								theTextObj.innerHTML = localObj.theText;
						}
					}

					if (globalObj.LastMirror != localObj.mirror)
					{
						if (theTextObj)
						{
							if (localObj.mirror)	theTextObj.style.webkitTransform = sprintf(" matrix(-1, 0, 0, 1, 0, 0)  ");
							else					theTextObj.style.webkitTransform = sprintf(" matrix(1, 0, 0, 1, 0, 0)  ");
						}
					}

					if ((globalObj.LastBackPerspective != localObj.backPerspective)
					)
					{
						theDivObj.style.webkitPerspective = sprintf("%dpx", localObj.backPerspective);
						globalObj.LastBackPerspective = localObj.backPerspective;
					}
					
					if ((globalObj.LastBackAngleY != localObj.backAngleY)
					)
					{
						theDivObj.style.webkitTransform = sprintf("rotateY(%fdeg)", localObj.backAngleY);
						globalObj.LastBackAngleY = localObj.backAngleY;
					}
					
					//---
					
					if (globalObj.LastOriginX != localObj.originX)
					{
						if (theImgContentObj) 
							theImgContentObj.style.webkitTransformOriginX = sprintf(" %f%% ", localObj.originX);
						
						if (theTxtContentObj)
							theTxtContentObj.style.webkitTransformOriginX = sprintf(" %f%% ", localObj.originX);
							
						globalObj.LastOriginX = localObj.originX;
					}
					
					if (globalObj.LastOriginY != localObj.originY)
					{
						if (theImgContentObj) 
							theImgContentObj.style.webkitTransformOriginY = sprintf(" %f%% ", localObj.originY);
						
						if (theTxtContentObj)
							theTxtContentObj.style.webkitTransformOriginY = sprintf(" %f%% ", localObj.originY);
							
						globalObj.LastOriginY = localObj.originY;
					}
					
					if (globalObj.LastOriginZ != localObj.originZ)
					{
						if (theImgContentObj) 
							theImgContentObj.style.webkitTransformOriginZ = sprintf(" %f%% ", localObj.originZ);
						
						if (theTxtContentObj)
							theTxtContentObj.style.webkitTransformOriginZ = sprintf(" %f%% ", localObj.originZ);
							
						globalObj.LastOriginZ = localObj.originZ;
					}
					
					//---
					
					if ((globalObj.LastAngle != localObj.angle)
						||(globalObj.LastAngleY != localObj.angleY)
						||(globalObj.LastAngleX != localObj.angleX)
						||(globalObj.LastPosZ != localObj.posZ)
						||(globalObj.LastScale != localObj.scale)
					)
					{
						if (theImgContentObj) 
							theImgContentObj.style.webkitTransform = sprintf(" rotate(%fdeg) rotateY(%fdeg) rotateX(%fdeg) translateZ(%dpx) scale(%f) ", localObj.angle, localObj.angleY, localObj.angleX, localObj.posZ, Math.abs(localObj.scale) / 100);
						
						if (theTxtContentObj)
							theTxtContentObj.style.webkitTransform = sprintf(" rotate(%fdeg) rotateY(%fdeg) rotateX(%fdeg) translateZ(%dpx) scale(%f) ", localObj.angle, localObj.angleY, localObj.angleX, localObj.posZ, Math.abs(localObj.scale) / 100);
							
						globalObj.LastPosZ 		= localObj.posZ;
						globalObj.LastAngle 	= localObj.angle;
						globalObj.LastAngleY 	= localObj.angleY;
						globalObj.LastAngleX 	= localObj.angleX;
						globalObj.LastScale 	= localObj.scale;
					}
					
					//---
					// set the color only if the conditions changed them
					// otherwise we'll always set a background color!
					
					if ((localObj.prevHue != localObj.hue)
						||(localObj.prevSat != localObj.sat)
						||(localObj.prevLite != localObj.lite)
						||(localObj.prevColorAlpha != localObj.colorAlpha)
					)
					{
						if (colorObj)
						{
							colorObj.style.color = sprintf("hsla(%d, %d%%, %d%%, %f)", localObj.hue, localObj.sat, localObj.lite, localObj.colorAlpha / 100);
							
							var hslaArr = widgetGetHSLA(colorObj.style.color);
						}
					}

					if ((localObj.prevBackHue != localObj.backHue)
						||(localObj.prevBackSat != localObj.backSat)
						||(localObj.prevBackLite != localObj.backLite)
						||(localObj.prevBackColorAlpha != localObj.backColorAlpha)
					)
					{
						if (theDivObj)
						{
							theDivObj.style.backgroundColor = sprintf("hsla(%d, %d%%, %d%%, %f)", localObj.backHue, localObj.backSat, localObj.backLite, localObj.backColorAlpha / 100);
						}
					}

					//---
					
					if (globalObj.LastLeft != localObj.left)
					{
						theDivObj.style.left = sprintf("%dpx", localObj.left);
						globalObj.LastLeft = localObj.left;
					}
					
					if (globalObj.LastTop != localObj.top)
					{
						theDivObj.style.top = sprintf("%dpx", localObj.top);
						globalObj.LastTop = localObj.top;
					}
					
					if (globalObj.LastWidth != localObj.width)
					{
						theDivObj.style.width = sprintf("%dpx", localObj.width);
						globalObj.LastWidth = localObj.width;
					}
					
					if (globalObj.LastHeight != localObj.height)
					{
						theDivObj.style.height = sprintf("%dpx", localObj.height);
						globalObj.LastHeight = localObj.height;
					}
					
					if (globalObj.LastAlpha != localObj.alpha)
					{
						theDivObj.style.opacity = sprintf("%f", localObj.alpha / 100);
						globalObj.LastAlpha = localObj.alpha;
					}
					
					globalObj.LastEvalTime = globalObj.CurrentRealTime;
					
					++globalObj.Steps;
				}

				globalObj.LastDevAngle			= gCond_DeviceAngle
				
				globalObj.LastAngleDirection	= localObj.angleDirection;
				globalObj.LastAngleYDirection	= localObj.angleYDirection;
				globalObj.LastAngleXDirection	= localObj.angleXDirection;
				globalObj.LastXDirection		= localObj.XDirection;
				globalObj.LastYDirection		= localObj.YDirection;
				globalObj.LastZDirection		= localObj.ZDirection;
				globalObj.LastWDirection		= localObj.WDirection;
				globalObj.LastHDirection		= localObj.HDirection;
				globalObj.LastAlphaDir			= localObj.alphaDirection;
				globalObj.LastScaleDir			= localObj.scaleDirection;
				
				globalObj.LastAngleSpeed		= localObj.angleSpeed;
				globalObj.LastAngleXSpeed		= localObj.angleXSpeed;
				globalObj.LastAngleYSpeed		= localObj.angleYSpeed;
				globalObj.LastXSpeed			= localObj.XSpeed;
				globalObj.LastUpSpeed			= localObj.upSpeed;
				globalObj.LastDownSpeed			= localObj.downSpeed;
				globalObj.LastZSpeed			= localObj.ZSpeed;
				globalObj.LastWSpeed			= localObj.WSpeed;
				globalObj.LastHSpeed			= localObj.HSpeed;
				globalObj.LastScaleSpeed		= localObj.scaleSpeed;
				
				globalObj.UserVar1Transition	= (globalObj.LastUserVar1 != localObj.userVar1) ? 1 : 0;
				globalObj.UserVar2Transition	= (globalObj.LastUserVar2 != localObj.userVar2) ? 1 : 0;
				globalObj.UserVar3Transition	= (globalObj.LastUserVar3 != localObj.userVar3) ? 1 : 0;
				globalObj.UserVar4Transition	= (globalObj.LastUserVar4 != localObj.userVar4) ? 1 : 0;
				globalObj.UserVar5Transition	= (globalObj.LastUserVar5 != localObj.userVar5) ? 1 : 0;

				globalObj.LastUserVar1			= localObj.userVar1;
				globalObj.LastUserVar2			= localObj.userVar2;
				globalObj.LastUserVar3			= localObj.userVar3;
				globalObj.LastUserVar4			= localObj.userVar4;
				globalObj.LastUserVar5			= localObj.userVar5;

				globalObj.LastTime98			= localObj.time98;
				globalObj.LastDecay98			= localObj.decay98;
				globalObj.LastPeriod98			= localObj.period98;
				globalObj.LastOffset98			= localObj.offset98;
				globalObj.LastAmplitude98		= localObj.amplitude98;
				globalObj.LastOscillation98		= localObj.oscillation98;
			}
		
			globalObj.LastVisible	= localObj.visible;
			globalObj.LastActive	= localObj.active;
		}
		
		//---
		
		if ([$DEF_name]ConditionsIntervalID)
		{
			clearInterval( [$DEF_name]ConditionsIntervalID );
			[$DEF_name]ConditionsIntervalID = 0;
		}
		
		if ([$DEF_name]ConditionsInterval)
			[$DEF_name]ConditionsIntervalID = setInterval([$DEF_name]UpdateConditions, [$DEF_name]ConditionsInterval);
	}
		
END_DEFINITION

BEGIN_COND_ACTION_MENU
	
	BEGIN_ENTRY
		ID = 1000
		DESC = Do Nothing
		CODE = 0
		VAR = 
		DEFAULT = 0
		MIN = 0
		MAX = 0
	END_ENTRY

	BEGIN_ENTRY
		ID = -3
		DESC = Actions
	END_ENTRY

	BEGIN_ENTRY
		ID = 1006
		DESC = Evaluate, otherwise Skip
		CODE = 96
		PRIORITY = 1
		BEGIN_BLOCK
			return;
		END_BLOCK
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 1001
		DESC = Show, otherwise Hide
		CODE = 6
		VAR = localObj.visible
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 1058
		DESC = Use Text
		CODE = 12
		VAR = localObj.content
	END_ENTRY

	BEGIN_ENTRY
		ID = 1057
		DESC = Use Image
		CODE = 13
		VAR = localObj.content
	END_ENTRY

	BEGIN_ENTRY
		ID = 1070
		DESC = Update Weather
		CODE = 99
		BEGIN_BLOCK
			[$DEF_name]LoadWeather(0);
		END_BLOCK
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Special Animation
	END_ENTRY
	
		BEGIN_ENTRY
			ID = 1051
			DESC = Pendulum (Curve)
			CODE = 99
			BEGIN_BLOCK
				localObj.angle = widgetSine98(globalObj, localObj);
			END_BLOCK
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1052
			DESC = Pulsating Scale (Curve)
			CODE = 99
			BEGIN_BLOCK
				localObj.scale = widgetHalfSine98(globalObj, localObj);
			END_BLOCK
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1053
			DESC = Pulsating Opacity (Curve)
			CODE = 99
			BEGIN_BLOCK
				localObj.alpha = widgetHalfSine98(globalObj, localObj);
			END_BLOCK
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1054
			DESC = Bounce Vertically (Curve)
			CODE = 99
			BEGIN_BLOCK
				localObj.top = widgetSine98(globalObj, localObj);
			END_BLOCK
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1055
			DESC = Bounce Horizontally (Curve)
			CODE = 99
			BEGIN_BLOCK
				localObj.left = widgetSine98(globalObj, localObj);
			END_BLOCK
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1069
			DESC = Roll Horizontally (Curve and Z Rot. Speed)
			CODE = 99
			BEGIN_BLOCK
				localObj.left	= widgetHalfSawtooth98(globalObj, localObj);
				localObj.angle	= localObj.time98 * 720 * localObj.angleSpeed * localObj.direction98;
			END_BLOCK
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Animate Location
	END_ENTRY
	
		BEGIN_ENTRY
			ID = 1010
			DESC = Move Horizontally (X)  by
			CODE = 5
			VAR = localObj.left
			VAR2 = localObj.XDirection * localObj.XSpeed
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY

		BEGIN_ENTRY
			ID = 1008
			DESC = Move Vertically (Y) by
			CODE = 5
			VAR = localObj.top
			VAR2 = localObj.YDirection * (localObj.YDirection > 0 ? localObj.downSpeed : localObj.upSpeed)
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1050
			DESC = Move along Z-axis by
			CODE = 5
			VAR = localObj.posZ
			VAR2 = localObj.ZDirection * localObj.ZSpeed
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY
	
		BEGIN_ENTRY
			ID = -1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Animate Rotation
	END_ENTRY
	
		BEGIN_ENTRY
			ID = 1005
			DESC = Rotate about Z-axis (Std.) by
			CODE = 5
			VAR = localObj.angle
			VAR2 = localObj.angleDirection * localObj.angleSpeed
			DEFAULT = 0
			MIN = -359
			MAX = 359
		END_ENTRY

		BEGIN_ENTRY
			ID = 1049
			DESC = Rotate about X-axis by
			CODE = 5
			VAR = localObj.angleX
			VAR2 = localObj.angleXDirection * localObj.angleXSpeed
			DEFAULT = 0
			MIN = -359
			MAX = 359
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1048
			DESC = Rotate about Y-axis by
			CODE = 5
			VAR = localObj.angleY
			VAR2 = localObj.angleYDirection * localObj.angleYSpeed
			DEFAULT = 0
			MIN = -359
			MAX = 359
		END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
		DESC = Animate Size
	END_ENTRY
	
		BEGIN_ENTRY
			ID = 1036
			DESC = Change Scale (%) by
			CODE = 5
			VAR = localObj.scale
			VAR2 = localObj.scaleDirection * localObj.scaleSpeed * localObj.scaleSpeedAdjust
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1022
			DESC = Change Width by
			CODE = 5
			VAR = localObj.width
			VAR2 = localObj.WDirection * localObj.WSpeed
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY
	
		BEGIN_ENTRY
			ID = 1024
			DESC = Change Height by
			CODE = 5
			VAR = localObj.height
			VAR2 = localObj.HDirection * localObj.HSpeed
			DEFAULT = 0
			MIN = -9999
			MAX = 9999
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Switch Page
	END_ENTRY

		BEGIN_ENTRY
			ID = 1059
			DESC = Switch to Lock Screen
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../LockBackground.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = 1060
			DESC = Switch to Home Screen
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../Widget.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = 1061
			DESC = Switch to WebPage1
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../WebPage1.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = 1062
			DESC = Switch to WebPage2
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../WebPage2.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = 1063
			DESC = Switch to WebPage3
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../WebPage3.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = 1064
			DESC = Switch to WebPage4
			CODE = 99
			BEGIN_BLOCK
				if (DO_ANIMATE)
					location.replace("../WebPage4.html#[$MODE]");
			END_BLOCK
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 1047
		DESC = Keep Horizontally on Screen
		CODE = 99
		BEGIN_BLOCK
			if (localObj.left <= 0) 	
				{localObj.XDirection = 1; localObj.left = 0;}
			if ((localObj.left + localObj.width) >= gDevice_ScreenWidth) 	
				{localObj.XDirection = -1; localObj.left = gDevice_ScreenWidth - localObj.width;}
		END_BLOCK
	END_ENTRY

	BEGIN_ENTRY
		ID = 1056
		DESC = Keep Vertically on Screen
		CODE = 99
		BEGIN_BLOCK
			if (localObj.top <= 0) 	
				{localObj.YDirection = 1; localObj.top = 0;}
			if ((localObj.top + localObj.height) >= gDevice_ScreenHeight) 	
				{localObj.YDirection = -1; localObj.top = gDevice_ScreenHeight - localObj.height;}
		END_BLOCK
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 1028
		DESC = Adjust Rotation to Direction of Movement
		CODE = 6
		VAR = localObj.setRotToDir
	END_ENTRY

	BEGIN_ENTRY
		ID = 1027
		DESC = Set Absolute Rotation
		CODE = 6
		VAR = localObj.absoluteRotation
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = -3
		DESC = Variables
	END_ENTRY

//---	
// last id: 1070
//---
END_COND_ACTION_MENU
	
BEGIN_CONDITION_MENU
	
	BEGIN_ENTRY
		ID = 1
		DESC = Always
		VAR = 1
		CODE = 1
		NOT_IN_VALUE_MENU = 1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 2
		DESC = Startup
		VAR = (localObj.steps == 0) ? 1 : 0
		CODE = 1
		NOT_IN_VALUE_MENU = 1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 121
		DESC = Always, with X and Y
		VAR = 1
		CODE = 2
		NOT_IN_VALUE_MENU = 1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = State
	END_ENTRY

		BEGIN_ENTRY
			ID = 46
			DESC = Visible (0,1)
			VAR = localObj.visible
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 51
			DESC = Active (0,1)
			VAR = localObj.active
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 133
			DESC = Clicked (0,1)
			VAR = localObj.buttonClicked
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Location
	END_ENTRY

		BEGIN_ENTRY
			ID = 22
			DESC = Left (X Position)
			VAR = localObj.left
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 23
			DESC = Top (Y Position)
			VAR = localObj.top
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 67
			DESC = Depth (Z Position)
			VAR = localObj.posZ
		END_ENTRY

		BEGIN_ENTRY
			ID = 32
			DESC = Right
			VAR = localObj.left + localObj.width
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 33
			DESC = Bottom
			VAR = localObj.top + localObj.height
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Size
	END_ENTRY

		BEGIN_ENTRY
			ID = 30
			DESC = Width
			VAR = localObj.width
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 31
			DESC = Height
			VAR = localObj.height
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 44
			DESC = Scale (%)
			VAR = localObj.scale
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 112
			DESC = Scaled Size Bigger than Screen (0,1)
			VAR = (((localObj.width * localObj.scale / 100) > gDevice_ScreenWidth)&&((localObj.height * localObj.scale / 100) > gDevice_ScreenHeight)) ? 1 : 0
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Rotation
	END_ENTRY

		BEGIN_ENTRY
			ID = 24
			DESC = Std. (Z) Rotation (-359..359)
			VAR = localObj.angle
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 63
			DESC = Y Rotation (-359..359)
			VAR = localObj.angleY
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 64
			DESC = X Rotation (-359..359)
			VAR = localObj.angleX
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Origin for Scaling and Rotation
	END_ENTRY

		BEGIN_ENTRY
			ID = 125
			DESC = X Origin (%)
			VAR = localObj.originX
		END_ENTRY

		BEGIN_ENTRY
			ID = 124
			DESC = Y Origin (%)
			VAR = localObj.originY
		END_ENTRY

		BEGIN_ENTRY
			ID = 123
			DESC = Z Origin (%)
			VAR = localObj.originZ
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Appearance
	END_ENTRY
		
		BEGIN_ENTRY
			ID = 71
			DESC = Content (Image: 0, Text: 1)
			VAR = localObj.content
		END_ENTRY

		BEGIN_ENTRY
			ID = 47
			DESC = Opacity (%)
			VAR = localObj.alpha
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Image
	END_ENTRY

		BEGIN_ENTRY
			ID = 60
			DESC = Image ID
			VAR = localObj.imageID
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Text
	END_ENTRY

		BEGIN_ENTRY
			ID = 61
			DESC = Text ID
			VAR = localObj.textID
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 78
			DESC = ID for Inline Image 0
			VAR = localObj.varImage0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 79
			DESC = ID for Inline Image 1
			VAR = localObj.varImage1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 80
			DESC = ID for Inline Image 2
			VAR = localObj.varImage2
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 106
			DESC = Text Variable 1
			VAR = globalObj.TextVar1
		END_ENTRY

		BEGIN_ENTRY
			ID = 107
			DESC = Text Variable 2
			VAR = globalObj.TextVar2
		END_ENTRY

		BEGIN_ENTRY
			ID = 108
			DESC = Text Variable 3
			VAR = globalObj.TextVar3
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 70
			DESC = Mirror Text (0,1)
			VAR = localObj.mirror
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Color
	END_ENTRY

		BEGIN_ENTRY
			ID = 85
			DESC = Text Hue
			VAR = localObj.hue
		END_ENTRY

		BEGIN_ENTRY
			ID = 116
			DESC = Text Saturation
			VAR = localObj.sat
		END_ENTRY

		BEGIN_ENTRY
			ID = 117
			DESC = Text Lightness
			VAR = localObj.lite
		END_ENTRY

		BEGIN_ENTRY
			ID = 135
			DESC = Text Color Alpha
			VAR = localObj.colorAlpha
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 118
			DESC = Backgr. Hue
			VAR = localObj.backHue
		END_ENTRY

		BEGIN_ENTRY
			ID = 119
			DESC = Backgr. Saturation
			VAR = localObj.backSat
		END_ENTRY

		BEGIN_ENTRY
			ID = 120
			DESC = Backgr. Lightness
			VAR = localObj.backLite
		END_ENTRY

		BEGIN_ENTRY
			ID = 134
			DESC = Backgr. Color Alpha
			VAR = localObj.backColorAlpha
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Timing
	END_ENTRY

		BEGIN_ENTRY
			ID = 100
			DESC = Changed Millisecond
			VAR = globalObj.T1000Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 101
			DESC = Changed Hundreths
			VAR = globalObj.T100Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 102
			DESC = Changed Tenths
			VAR = globalObj.T10Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 56
			DESC = Changed Second
			VAR = globalObj.secondTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 55
			DESC = Changed Minute
			VAR = globalObj.minuteTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 54
			DESC = Changed Hour
			VAR = globalObj.hourTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 58
			DESC = Changed Weekday
			VAR = globalObj.dayTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 57
			DESC = Changed Day
			VAR = globalObj.dayTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 59
			DESC = Changed Month
			VAR = globalObj.monthTransition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 136
			DESC = Local Time Scale
			VAR = globalObj.CurrentTimeScale
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 137
			DESC = Local Time Offset (sec)
			VAR = globalObj.CurrentTimeOffset
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 138
			DESC = Global Time Scale
			VAR = gCond_CurrentTimeScale
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 139
			DESC = Global Time Offset (sec)
			VAR = gCond_CurrentTimeOffset
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -3
		DESC = Animation
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Curve Functions
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 173
			DESC = sine (0..1..-1..0)
			VAR = widgetSine98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 174
			DESC = 1/2 sine (0..1..0)
			VAR = widgetHalfSine98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 175
			DESC = 1/4 sine (0..1)
			VAR = widgetQuarterSine98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 176
			DESC = sawtooth (0..1..-1..0)
			VAR = widgetSawtooth98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 177
			DESC = 1/2 sawtooth (0..1..0)
			VAR = widgetHalfSawtooth98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 178
			DESC = 1/4 sawtooth (0..1)
			VAR = widgetQuarterSawtooth98(globalObj, localObj)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Curve Parameters
	END_ENTRY

		BEGIN_ENTRY
			ID = 97
			DESC = Curve Amplitude
			VAR = localObj.amplitude98
		END_ENTRY

		BEGIN_ENTRY
			ID = 96
			DESC = Curve Period (sec) 
			VAR = localObj.period98
		END_ENTRY

		BEGIN_ENTRY
			ID = 98
			DESC = Curve Offset
			VAR = localObj.offset98
		END_ENTRY

		BEGIN_ENTRY
			ID = 99
			DESC = Curve Decay
			VAR = localObj.decay98
		END_ENTRY

		BEGIN_ENTRY
			ID = 113
			DESC = Curve Value (-1..1)
			VAR = localObj.oscillation98
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 115
			DESC = Curve Direction (-1,1)
			VAR = localObj.direction98
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 114
			DESC = Curve Time (0..1)
			VAR = localObj.time98
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Direction
	END_ENTRY

		BEGIN_ENTRY
			ID = 25
			DESC = Horizontal Direction (-1,1)
			VAR = localObj.XDirection
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 26
			DESC = Vertical Direction (-1,1)
			VAR = localObj.YDirection
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 87
			DESC = Z-axis Direction (-1,1)
			VAR = localObj.ZDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 45
			DESC = Scale Direction (-1,1)
			VAR = localObj.scaleDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = 28
			DESC = Width Direction (-1,1)
			VAR = localObj.WDirection
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 29
			DESC = Height Direction (-1,1)
			VAR = localObj.HDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 27
			DESC = Z Rotation Direction (-1,1)
			VAR = localObj.angleDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = 65
			DESC = Y Rotation Direction (-1,1)
			VAR = localObj.angleYDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = 66
			DESC = X Rotation Direction (-1,1)
			VAR = localObj.angleXDirection
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 48
			DESC = Opacity Direction (-1,1)
			VAR = localObj.alphaDirection
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Speed
	END_ENTRY

		BEGIN_ENTRY
			ID = 38
			DESC = Horizontal Speed
			VAR = localObj.XSpeed
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 39
			DESC = Vertical Down Speed
			VAR = localObj.downSpeed
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 95
			DESC = Vertical Up Speed
			VAR = localObj.upSpeed
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 88
			DESC = Z-axis Speed
			VAR = localObj.ZSpeed
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 52
			DESC = Scale Speed
			VAR = localObj.scaleSpeed
		END_ENTRY

		BEGIN_ENTRY
			ID = 122
			DESC = Scale Acc. Adjustment
			VAR = localObj.scaleSpeedAdjust
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 89
			DESC = Width Speed
			VAR = localObj.WSpeed
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 90
			DESC = Height Speed
			VAR = localObj.HSpeed
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 91
			DESC = Z Rotation Speed
			VAR = localObj.angleSpeed
		END_ENTRY

		BEGIN_ENTRY
			ID = 92
			DESC = X Rotation Speed
			VAR = localObj.angleXSpeed
		END_ENTRY

		BEGIN_ENTRY
			ID = 93
			DESC = Y Rotation Speed
			VAR = localObj.angleYSpeed
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Continuous Time Angles
		NOT_IN_ACTION_MENU = 1
	END_ENTRY
		
		BEGIN_ENTRY
			ID = 140
			DESC = Millisecond Angle
			VAR = globalObj.msAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 73
			DESC = Seconds Angle
			VAR = globalObj.secondAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 74
			DESC = Minutes Angle
			VAR = globalObj.minuteAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 75
			DESC = 12 Hour Angle
			VAR = globalObj.hourAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 126
			DESC = 24 Hour Angle
			VAR = globalObj.hourAngle24
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 76
			DESC = Days Angle
			VAR = globalObj.dayAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 77
			DESC = Month Angle
			VAR = globalObj.monthAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Discrete Time Angles
		NOT_IN_ACTION_MENU = 1
	END_ENTRY
		
		BEGIN_ENTRY
			ID = 86
			DESC = Seconds Angle (Discrete)
			VAR = globalObj.secondAngleDis
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 81
			DESC = Minutes Angle (Discrete)
			VAR = globalObj.minuteAngleDis
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 82
			DESC = 12 Hour Angle (Discrete)
			VAR = globalObj.hourAngleDis
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 127
			DESC = 24 Hour Angle (Discrete)
			VAR = globalObj.hourAngleDis24
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 83
			DESC = Days Angle (Discrete)
			VAR = globalObj.dayAngleDis
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 84
			DESC = Month Angle (Discrete)
			VAR = globalObj.monthAngleDis
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Screen
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 49
			DESC = Screen Width
			VAR = gDevice_ScreenWidth
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 50
			DESC = Screen Height
			VAR = gDevice_ScreenHeight
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 34
			DESC = Left Distance to Screen Edge
			VAR = localObj.left
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 35
			DESC = Right Distance to Screen Edge
			VAR = gDevice_ScreenWidth - (localObj.left + localObj.width)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 36
			DESC = Top Distance to Screen Edge
			VAR = localObj.top
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 37
			DESC = Bottom Distance to Screen Edge
			VAR = gDevice_ScreenHeight - (localObj.top + localObj.height)
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Time and Date
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 9
			DESC = Second (0..59)
			VAR = globalObj.CurrentSeconds
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 8
			DESC = Minute (0..59)
			VAR = globalObj.CurrentMinutes
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 6
			DESC = Hour (1..12)
			VAR = globalObj.CurrentHours12
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 7
			DESC = Hour (0..23)
			VAR = globalObj.CurrentHours24
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 11
			DESC = Weekday (0..6, 0 = Sunday)
			VAR = globalObj.CurrentWeekday
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 10
			DESC = Day (1..31)
			VAR = globalObj.CurrentDay
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 12
			DESC = Month (1..12)
			VAR = globalObj.CurrentMonth
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 13
			DESC = Year
			VAR = globalObj.CurrentYear
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 103
			DESC = Milliseconds (0..999)
			VAR = globalObj.Current1000
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 104
			DESC = Hundredths (0..99)
			VAR = globalObj.Current100
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 105
			DESC = Tenths (0..9)
			VAR = globalObj.Current10
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Device
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 94
			DESC = Orientation (0, 90, 180, -90)
			VAR = gCond_DeviceAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 3
			DESC = Portrait (0, 1)
			VAR = gCond_Portrait
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1065
			DESC = Portrait (Button on Bottom)
			VAR = (gCond_DeviceAngle == 0) ? 1 : 0
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1066
			DESC = Portrait 180 (Button on Top)
			VAR = (gCond_DeviceAngle == 180) ? 1 : 0
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 4
			DESC = Landscape (0, 1)
			VAR = gCond_Landscape
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1067
			DESC = Landscape 90 (Button Right)
			VAR = (gCond_DeviceAngle == 90) ? 1 : 0
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 1068
			DESC = Landscape -90 (Button Left)
			VAR = (gCond_DeviceAngle == -90) ? 1 : 0
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 21
			DESC = Disk Space Used (%)
			VAR = gCond_SpaceUsed
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Application Badges
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 18
			DESC = Mail Badge# (E-Mails)
			VAR = gCond_NumMail
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 19
			DESC = SMS Badge# (Text Messages)
			VAR = gCond_NumSMS
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 20
			DESC = Phone Badge# (Calls, Voicemails)
			VAR = gCond_NumPhone
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Battery
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 14
			DESC = Level (0 .. 100, in steps of 5)
			VAR = gCond_BatteryLevel
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 15
			DESC = Battery Charging (0, 1)
			VAR = gCond_BatteryCharging
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 16
			DESC = Battery Full (0, 1)
			VAR = gCond_BatteryFull
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 17
			DESC = Battery Discharging (0, 1)
			VAR = gCond_BatteryDischarging
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 72
			DESC = Battery Level Angle
			VAR = gCond_BatteryAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Weather
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

		BEGIN_ENTRY
			ID = 148
			DESC = Current Temperature (F)
			VAR = globalObj.weather_tempF
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 149
			DESC = High Temperature (F)
			VAR = globalObj.weather_tempHiF
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 150
			DESC = Low Temperature (F)
			VAR = globalObj.weather_tempLoF
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 151
			DESC = Current Temperature (C)
			VAR = globalObj.weather_tempC
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 152
			DESC = High Temperature (C)
			VAR = globalObj.weather_tempHiC
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 153
			DESC = Low Temperature (C)
			VAR = globalObj.weather_tempLoC
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 154
			DESC = Barometric Pressure
			VAR = globalObj.weather_pressure
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 155
			DESC = Precipitation
			VAR = globalObj.weather_precip
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 156
			DESC = UV Index
			VAR = globalObj.weather_UVIndex
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 157
			DESC = Visibility
			VAR = globalObj.weather_visibility
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 158
			DESC = Wind Speed
			VAR = globalObj.weather_windSpeed
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 159
			DESC = Wind Coming From Angle (0..359)
			VAR = globalObj.weather_windAngle
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 160
			DESC = Sunrise Hour (0..23)
			VAR = globalObj.weather_sunRise_hour
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 161
			DESC = Sunrise Minute (0..59)
			VAR = globalObj.weather_sunRise_minute
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 162
			DESC = Sunrise 12h Angle (0..359)
			VAR = globalObj.weather_sunRiseAngle12
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 163
			DESC = Sunset Hour (0..23)
			VAR = globalObj.weather_sunSet_hour
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 164
			DESC = Sunset Minute (0..59)
			VAR = globalObj.weather_sunSet_minute
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 165
			DESC = Sunset 12h Angle (0..359)
			VAR = globalObj.weather_sunSetAngle12
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 166
			DESC = Moonrise Hour (0..23)
			VAR = globalObj.weather_moonRise_hour
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 167
			DESC = Moonrise Minute (0..59)
			VAR = globalObj.weather_moonRise_minute
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 168
			DESC = Moonrise 12h Angle (0..359)
			VAR = globalObj.weather_moonRiseAngle12
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 169
			DESC = Moonset Hour (0..23)
			VAR = globalObj.weather_moonSet_hour
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 170
			DESC = Moonset Minute (0..59)
			VAR = globalObj.weather_moonSet_minute
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 171
			DESC = Moonset 12h Angle (0..359)
			VAR = globalObj.weather_moonSetAngle12
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 172
			DESC = Weather Icon ID (0..31)
			VAR = globalObj.weather_icon
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
	BEGIN_ENTRY
		ID = -1
		DESC = Background
	END_ENTRY

		BEGIN_ENTRY
			ID = 69
			DESC = Background Perspective (0..1000)
			VAR = localObj.backPerspective
		END_ENTRY

		BEGIN_ENTRY
			ID = 68
			DESC = Background Y Rotation (-359..359)
			VAR = localObj.backAngleY
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = User Variables
	END_ENTRY

		BEGIN_ENTRY
			ID = 41
			DESC = User Variable 1
			VAR = localObj.userVar1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 42
			DESC = User Variable 2
			VAR = localObj.userVar2
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 43
			DESC = User Variable 3
			VAR = localObj.userVar3
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 141
			DESC = User Variable 4
			VAR = localObj.userVar4
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 142
			DESC = User Variable 5
			VAR = localObj.userVar5
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = 143
			DESC = Changed User Variable 1 
			VAR = globalObj.UserVar1Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 144
			DESC = Changed User Variable 2 
			VAR = globalObj.UserVar2Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 145
			DESC = Changed User Variable 3 
			VAR = globalObj.UserVar3Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 146
			DESC = Changed User Variable 4 
			VAR = globalObj.UserVar4Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 147
			DESC = Changed User Variable 5 
			VAR = globalObj.UserVar5Transition
			CODE = 1
			NOT_IN_ACTION_MENU = 1
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Global Variables
	END_ENTRY

		BEGIN_ENTRY
			ID = 128
			DESC = Global Variable 1
			VAR = gGlobalVar1
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 129
			DESC = Global Variable 2
			VAR = gGlobalVar2
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 130
			DESC = Global Variable 3
			VAR = gGlobalVar3
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 131
			DESC = Global Variable 4
			VAR = gGlobalVar4
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 132
			DESC = Global Variable 5
			VAR = gGlobalVar5
		END_ENTRY

		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 5
		DESC = Time Since Last Evaluation (ms)
		VAR = localObj.elapsedTime
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 62
		DESC = Evaluation Steps
		VAR = localObj.steps
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 40
		DESC = Random (0..1000)
		VAR = localObj.randNum1
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 110
		DESC = Random (0..359)
		VAR = localObj.randNum3
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 109
		DESC = Random (0..99)
		VAR = localObj.randNum2
		NOT_IN_ACTION_MENU = 1
	END_ENTRY

	BEGIN_ENTRY
		ID = 111
		DESC = Random (-1 or 1)
		VAR = localObj.randNum4
		NOT_IN_ACTION_MENU = 1
	END_ENTRY
	
//---	
// last id: 178
//---
END_CONDITION_MENU

BEGIN_OP_MENU
	
	BEGIN_ENTRY
		ID = 48
		DESC = =
		CODE = 4
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 49
		DESC = = 1
		CODE = 12
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 50
		DESC = = 0
		CODE = 13
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 56
		DESC = = -1
		CODE = 14
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 51
		DESC = +=
		CODE = 5
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 52
		DESC = -=
		CODE = 11
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 53
		DESC = *=
		CODE = 9
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 54
		DESC = /=
		CODE = 10
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 55
		DESC = 0 <=> 1
		CODE = 8
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 57
		DESC = +/-
		CODE = 7
	END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 63
		DESC = = 1/3.6 *
		CODE = 97
		BEGIN_BLOCK
			[$T] = [$V]/3.6;
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = 64
		DESC = = 3.6 *
		CODE = 97
		BEGIN_BLOCK
			[$T] = [$V]*3.6;
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = 71
		DESC = = 360 *
		CODE = 97
		BEGIN_BLOCK
			[$T] = [$V]*360;
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = 65
		DESC = = 100/60 *
		CODE = 97
		BEGIN_BLOCK
			[$T] = [$V]*100/60;
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 73
		DESC = = -1 *
		CODE = 97
		BEGIN_BLOCK
			[$T] = -[$V];
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = 67
		DESC = T = V - T
		CODE = 97
		BEGIN_BLOCK
			[$T] = [$V] - [$T];
		END_BLOCK
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
	END_ENTRY

	BEGIN_ENTRY
		ID = 58
		DESC = force <=
		CODE = 15
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY
	
	BEGIN_ENTRY
		ID = 59
		DESC = force >=
		CODE = 16
		DEFAULT = 0
		MIN = -9999
		MAX = 9999
	END_ENTRY

	BEGIN_ENTRY
		ID = 60
		DESC = = 1 if < X, -1 if > Y
		CODE = 17
	END_ENTRY

	BEGIN_ENTRY
		ID = 66
		DESC = = X if < X, Y if > Y
		CODE = 97
		BEGIN_BLOCK
			if ([$C] < [$X]) [$T] = [$X]; 
			if ([$C] > [$Y]) [$T] = [$Y]; 
		END_BLOCK
	END_ENTRY

//---	
// last id: 73
//---
END_OP_MENU

BEGIN_FORMAT_MENU
	
	BEGIN_ENTRY
		ID = -1
		DESC = Time and Date
	END_ENTRY

		BEGIN_ENTRY
			ID = 1
			CODE = 1
			DESC = Default
			FORMAT = $HOUR12:$MINUTE0 $AMPM<br>$WEEKDAY, $MONTH_NAME $DAY '$YEAR0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 2
			CODE = 0
			DESC = Hour (1..12)
			FORMAT = $HOUR12
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 3
			CODE = 0
			DESC = Hour (01..12)
			FORMAT = $HOUR012
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 4
			CODE = 0
			DESC = Hour (0..23)
			FORMAT = $HOUR24
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 5
			CODE = 0
			DESC = Hour (00..23)
			FORMAT = $HOUR024
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 6
			CODE = 0
			DESC = Minute (0..59)
			FORMAT = $MINUTE
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 7
			CODE = 0
			DESC = Minute (00..59)
			FORMAT = $MINUTE0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 8
			CODE = 0
			DESC = Second (0..59)
			FORMAT = $SECOND
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 9
			CODE = 0
			DESC = Second (00..59)
			FORMAT = $SECOND0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 10
			CODE = 0
			DESC = Am/Pm
			FORMAT = $AMPM
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 11
			CODE = 0
			DESC = Weekday
			FORMAT = $WEEKDAY
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 12
			CODE = 0
			DESC = Short Weekday
			FORMAT = $WEEKDAY3
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 13
			CODE = 0
			DESC = Month Name
			FORMAT = $MONTH_NAME
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 14
			CODE = 0
			DESC = Short Month Name
			FORMAT = $MONTH_NAME3
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 15
			CODE = 0
			DESC = Month (1..12)
			FORMAT = $MONTH
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 16
			CODE = 0
			DESC = Month (01..12)
			FORMAT = $MONTH0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 17
			CODE = 0
			DESC = Day (1..31)
			FORMAT = $DAY
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 18
			CODE = 0
			DESC = Day (01..31)
			FORMAT = $DAY0
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 19
			CODE = 0
			DESC = Year
			FORMAT = $YEAR
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 20
			CODE = 0
			DESC = Short Year
			FORMAT = $YEAR0
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 30
			CODE = 0
			DESC = Milliseconds (000..999)
			FORMAT = $MS0
		END_ENTRY

		BEGIN_ENTRY
			ID = 31
			CODE = 0
			DESC = Milliseconds (0..999)
			FORMAT = $MS
		END_ENTRY

		BEGIN_ENTRY
			ID = 32
			CODE = 0
			DESC = Hundredths (00..99)
			FORMAT = $HUNDREDTHS0
		END_ENTRY

		BEGIN_ENTRY
			ID = 33
			CODE = 0
			DESC = Hundredths (0..99)
			FORMAT = $HUNDREDTHS
		END_ENTRY

		BEGIN_ENTRY
			ID = 34
			CODE = 0
			DESC = Tenths (0..9)
			FORMAT = $TENTHS
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
		END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
		DESC = Application Badges
	END_ENTRY

		BEGIN_ENTRY
			ID = 21
			CODE = 0
			DESC = Mail Count
			FORMAT = $MAIL_COUNT
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 22
			CODE = 0
			DESC = Calls Count
			FORMAT = $CALLS_COUNT
		END_ENTRY

		BEGIN_ENTRY
			ID = 23
			CODE = 0
			DESC = Text Message Count
			FORMAT = $SMS_COUNT
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
		END_ENTRY
	
	BEGIN_ENTRY
		ID = -1
		DESC = Device
	END_ENTRY

		BEGIN_ENTRY
			ID = 25
			CODE = 0
			DESC = Battery Level
			FORMAT = $BATTERY_LEVEL
		END_ENTRY

		BEGIN_ENTRY
			ID = 26
			CODE = 0
			DESC = Disk Space Used (%)
			FORMAT = $SPACE_USED
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Weather
	END_ENTRY

		BEGIN_ENTRY
			ID = 38
			CODE = 1
			DESC = Default
			FORMAT = $CITY<br>$CTF $SD00<br>$LICON00$WICON01$WICON02$WICON03$WICON04$WICON05$WICON06<br>Hi: $HTF00 Lo: $LTF00<br>Sunrise: $SR Sunset: $SS
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 39
			CODE = 1
			DESC = City, Description, Temp, Hi, Lo (F)
			FORMAT = $CITY: $SD00<br>Cur: $CTF Hi: $HTF00 Lo: $LTF00
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 40
			CODE = 1
			DESC = City, Description, Temp, Hi, Lo (C)
			FORMAT = $CITY: $SD00<br>Cur: $CTC Hi: $HTC00 Lo: $LTC00
		END_ENTRY
		
		//---
		
		BEGIN_ENTRY
			ID = 41
			CODE = 0
			DESC = 7-Day Icons
			FORMAT = $WICON00$WICON01$WICON02$WICON03$WICON04$WICON05$WICON06
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 42
			CODE = 0
			DESC = Air Quality and Pollen Counts
			FORMAT = Air: $AIR Tree: $PTREE Weed: $PWEED Grass: $PGRASS Mold: $PMOLD
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 43
			CODE = 0
			DESC = Sunrise and Sunset
			FORMAT = Sunrise: $SR Sunset: $SS
		END_ENTRY
		
		//---
	
		BEGIN_ENTRY
			ID = 44
			CODE = 0
			DESC = Normal Icon
			FORMAT = $WICON00
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 45
			CODE = 0
			DESC = Large Icon
			FORMAT = $LICON00
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 46
			CODE = 0
			FORMAT = $SICON00
			DESC = Small Icon
		END_ENTRY

		BEGIN_ENTRY
			ID = 47
			CODE = 0
			FORMAT = $CITY
			DESC = City
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 49
			CODE = 0
			FORMAT = $SD00 
			DESC = Short Description
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 50
			CODE = 0
			FORMAT = $LD00 
			DESC = Long Description
		END_ENTRY

		BEGIN_ENTRY
			ID = 51
			CODE = 0
			FORMAT = $DAY00 
			DESC = Weekday
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 52
			CODE = 0
			FORMAT = $DATE00 
			DESC = Date
		END_ENTRY

		BEGIN_ENTRY
			ID = 53
			CODE = 0
			FORMAT = $CTF 
			DESC = Current Temperature (F)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 54
			CODE = 0
			FORMAT = $HTF00 
			DESC = High Temperature (F)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 55
			CODE = 0
			FORMAT = $LTF00 
			DESC = Low Temperature (F)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 56
			CODE = 0
			FORMAT = $RCTF 
			DESC = Current Temperature (F) 'Feels Like'
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 57
			CODE = 0
			FORMAT = $RHTF00 
			DESC = High Temperature (F) 'Feels Like'
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 58
			CODE = 0
			FORMAT = $RLTF00 
			DESC = Low Temperature (F) 'Feels Like'
		END_ENTRY

		BEGIN_ENTRY
			ID = 59
			CODE = 0
			FORMAT = $HUM 
			DESC = Humidity
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 60
			CODE = 0
			FORMAT = $PRES 
			DESC = Barometric Pressure
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 61
			CODE = 0
			FORMAT = $PRESDIR 
			DESC = Barometer Trend
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 62
			CODE = 0
			FORMAT = $PRECIP 
			DESC = Current Precipitation
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 63
			CODE = 0
			FORMAT = $UV 
			DESC = UV Index
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 64
			CODE = 0
			FORMAT = $VIS 
			DESC = Visibility
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 65
			CODE = 0
			FORMAT = $AIR 
			DESC = Air Quality
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 66
			CODE = 0
			FORMAT = $PTREE 
			DESC = Tree Pollen
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 67
			CODE = 0
			FORMAT = $PWEED 
			DESC = Weed Pollen
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 68
			CODE = 0
			FORMAT = $PGRASS 
			DESC = Grass Pollen
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 69
			CODE = 0
			FORMAT = $PMOLD 
			DESC = Mold Pollen
		END_ENTRY
			
		BEGIN_ENTRY
			ID = 70
			CODE = 0
			FORMAT = $WS00 
			DESC = Wind Speed
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 71
			CODE = 0
			FORMAT = $WD00 
			DESC = Wind Coming From
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 72
			CODE = 0
			FORMAT = $WG00 
			DESC = Wind Gust
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 73
			CODE = 0
			FORMAT = $PR00 
			DESC = Precipitation
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 74
			CODE = 0
			FORMAT = $RAIN00 
			DESC = Rain
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 75
			CODE = 0
			FORMAT = $SNOW00 
			DESC = Snow
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 76
			CODE = 0
			FORMAT = $MAXUV00 
			DESC = Max. UV
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 77
			CODE = 0
			FORMAT = $TSTORM00 
			DESC = Thunderstorm Probability
		END_ENTRY

		BEGIN_ENTRY
			ID = 78
			CODE = 0
			FORMAT = $CTC 
			DESC = Current Temperature (C)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 79
			CODE = 0
			FORMAT = $HTC00 
			DESC = High Temperature (C)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 80
			CODE = 0
			FORMAT = $LTC00 
			DESC = Low Temperature (C)
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 81
			CODE = 0
			FORMAT = $RCTC 
			DESC = Current Temperature (C) 'Feels Like'
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 82
			CODE = 0
			FORMAT = $RHTC00 
			DESC = High Temperature (C) 'Feels Like'
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 83
			CODE = 0
			FORMAT = $RLTC00 
			DESC = Low Temperature (C) 'Feels Like'
		END_ENTRY

		BEGIN_ENTRY
			ID = 84
			CODE = 0
			FORMAT = $SR 
			DESC = Sunrise
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 85
			CODE = 0
			FORMAT = $SS 
			DESC = Sunset
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 86
			CODE = 0
			FORMAT = $MR 
			DESC = Moonrise
		END_ENTRY
		
		BEGIN_ENTRY
			ID = 87
			CODE = 0
			FORMAT = $MS 
			DESC = Moonset
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
		END_ENTRY

	BEGIN_ENTRY
		ID = -1
		DESC = Condition Variables
	END_ENTRY

		BEGIN_ENTRY
			ID = 24
			CODE = 0
			DESC = Inline Image (replace '0' with image ID)
			FORMAT = $IMAGE_0_
		END_ENTRY

		BEGIN_ENTRY
			ID = 27
			CODE = 0
			DESC = Variable Inline Image 0
			FORMAT = $VAR_IMAGE0
		END_ENTRY

		BEGIN_ENTRY
			ID = 28
			CODE = 0
			DESC = Variable Inline Image 1
			FORMAT = $VAR_IMAGE1
		END_ENTRY

		BEGIN_ENTRY
			ID = 29
			CODE = 0
			DESC = Variable Inline Image 2
			FORMAT = $VAR_IMAGE2
		END_ENTRY

		BEGIN_ENTRY
			ID = -1
		END_ENTRY

		BEGIN_ENTRY
			ID = 35
			CODE = 0
			DESC = Text Variable 1
			FORMAT = $VAR1
		END_ENTRY

		BEGIN_ENTRY
			ID = 36
			CODE = 0
			DESC = Text Variable 2
			FORMAT = $VAR2
		END_ENTRY

		BEGIN_ENTRY
			ID = 37
			CODE = 0
			DESC = Text Variable 3
			FORMAT = $VAR3
		END_ENTRY
		
		BEGIN_ENTRY
			ID = -2
		END_ENTRY

//---	
// last id: 87
//---
END_FORMAT_MENU
