NAME = Background
FIXED_AT_BOTTOM = 1
IS_BACKGROUND = 1
ONLY_ONE = 1

CAN_EDIT_STYLE = 1
CAN_EDIT_BACKGROUND_IMAGE = [$DEFINITION]/LockBackground.png

BEGIN_ONLOAD

   DefaultBackgroundImageLoad();

END_ONLOAD

BEGIN_DEFINITION

	var DefaultBackgroundImageLoadInterval 		= 1000 * 5;
	var DefaultBackgroundImageLoadIntervalID 	= 0;

	function DefaultBackgroundImageLoad()
	{
   		DefaultBackgroundImageLoad2([$USE_DEFAULT_BACKGROUND_IMAGE]);
	}
	
	function DefaultBackgroundImageLoad2(use)
	{
		var CurrentTimestamp 	= new Date();
		var CurrentTime 		= CurrentTimestamp.getTime();
		
		delete CurrentTimestamp;

		if (use)
		{
			document.getElementById("DefaultBackgroundImage").style.display = 'block';
			
			if (ON_DEVICE)
			{
				if (use == 4)		path = "/private/var/mobile/Library/SpringBoard/LockBackground.jpg?v=" + CurrentTime;
				else if (use == 3)	path = "/private/var/mobile/Library/SpringBoard/HomeBackground.jpg?v=" + CurrentTime;
				else if (use == 2)	path = "/private/var/mobile/Library/HomeBackground.jpg?v=" + CurrentTime;
				else				path = "/private/var/mobile/Library/LockBackground.jpg?v=" + CurrentTime;
			}
			else
			{
				path = "[$DEFINITION]/Default.png";
			}
			
			document.getElementById("DefaultBackgroundImage").src = path;
			
			//---
			
			if (DefaultBackgroundImageLoadIntervalID)
			{
				clearInterval( DefaultBackgroundImageLoadIntervalID );
				DefaultBackgroundImageLoadIntervalID = 0;
			}
			
			if (DefaultBackgroundImageLoadInterval)
				DefaultBackgroundImageLoadIntervalID = setInterval(DefaultBackgroundImageLoad, DefaultBackgroundImageLoadInterval);
		}
		else
		{
			document.getElementById("DefaultBackgroundImage").style.display = 'none';
		}
	}
	
END_DEFINITION

BEGIN_DEF
	
	DEF_name = 
	
END_DEF

BEGIN_STYLE
STYLE_background = url('990_Background/LockBackground.png[$IMGVERSION]') no-repeat;
STYLE_background-color = none;
END_STYLE

ENABLE = 1
