Add ability for buttons to have highlights on touch
diff --git a/gui/button.cpp b/gui/button.cpp
index 72e2fe9..b9d1b52 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -107,7 +107,7 @@
 
     int ret = 0, ret2 = 0;
 
-    if (mButtonImg)         ret = mButtonImg->Update();
+    if (mButtonImg)             ret = mButtonImg->Update();
     if (ret < 0)            return ret;
 
     if (ret == 0)
@@ -188,7 +188,30 @@
 
 int GUIButton::NotifyTouch(TOUCH_STATE state, int x, int y)
 {
-    if (!isConditionTrue())     return -1;
+	static int last_state = 0;
+
+	if (!isConditionTrue())     return -1;
+	if (x < mRenderX || x - mRenderX > mRenderW || y < mRenderY || y - mRenderY > mRenderH || state == TOUCH_RELEASE) {
+		if (last_state == 1) {
+			last_state = 0;
+			if (mButtonLabel != NULL)
+				mButtonLabel->isHighlighted = false;
+			if (mButtonImg != NULL)
+				mButtonImg->isHighlighted = false;
+			mRendered = false;
+		}
+	} else {
+		if (last_state == 0) {
+			last_state = 1;
+			if (mButtonLabel != NULL)
+				mButtonLabel->isHighlighted = true;
+			if (mButtonImg != NULL)
+				mButtonImg->isHighlighted = true;
+			mRendered = false;
+		}
+	}
+	if (x < mRenderX || x - mRenderX > mRenderW || y < mRenderY || y - mRenderY > mRenderH)
+		return 0;
     return (mAction ? mAction->NotifyTouch(state, x, y) : 1);
 }
 
diff --git a/gui/image.cpp b/gui/image.cpp
index 44400e6..05e5178 100644
--- a/gui/image.cpp
+++ b/gui/image.cpp
@@ -32,6 +32,8 @@
     xml_node<>* child;
 
     mImage = NULL;
+	mHighlightImage = NULL;
+	isHighlighted = false;
 
     if (!node)
         return;
@@ -42,6 +44,9 @@
         attr = child->first_attribute("resource");
         if (attr)
             mImage = PageManager::FindResource(attr->value());
+		attr = child->first_attribute("highlightresource");
+        if (attr)
+            mHighlightImage = PageManager::FindResource(attr->value());
     }
 
     // Load the placement
@@ -75,7 +80,10 @@
 
 int GUIImage::Render(void)
 {
-    if (!mImage || !mImage->GetResource())      return -1;
+    if (isHighlighted && mHighlightImage && mHighlightImage->GetResource()) {
+		gr_blit(mHighlightImage->GetResource(), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY);
+		return 0;
+	} else if (!mImage || !mImage->GetResource())      return -1;
     gr_blit(mImage->GetResource(), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY);
     return 0;
 }
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 1f3f11a..8f78236 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -174,16 +174,21 @@
 	// Set number of characters to skip (for scrolling)
 	virtual int SkipCharCount(unsigned skip);
 
+public:
+	bool isHighlighted;
+
 protected:
     std::string mText;
     std::string mLastValue;
     COLOR mColor;
+	COLOR mHighlightColor;
     Resource* mFont;
     int mIsStatic;
     int mVarChanged;
     int mFontHeight;
 	unsigned maxWidth;
 	unsigned charSkip;
+	bool hasHighlightColor;
 
 protected:
     std::string parseText(void);
@@ -204,8 +209,12 @@
     //  Return 0 on success, <0 on error
     virtual int SetRenderPos(int x, int y, int w = 0, int h = 0);
 
+public:
+	bool isHighlighted;
+
 protected:
     Resource* mImage;
+	Resource* mHighlightImage;
 };
 
 // GUIFill - Used for fill colors
diff --git a/gui/text.cpp b/gui/text.cpp
index 90482fe..dc7a2d1 100644
--- a/gui/text.cpp
+++ b/gui/text.cpp
@@ -38,12 +38,16 @@
     mFontHeight = 0;
 	maxWidth = 0;
 	charSkip = 0;
+	isHighlighted = false;
+	hasHighlightColor = false;
 
     if (!node)      return;
 
     // Initialize color to solid black
     memset(&mColor, 0, sizeof(COLOR));
     mColor.alpha = 255;
+	memset(&mHighlightColor, 0, sizeof(COLOR));
+    mHighlightColor.alpha = 255;
 
     attr = node->first_attribute("color");
     if (attr)
@@ -51,6 +55,13 @@
         std::string color = attr->value();
         ConvertStrToColor(color, &mColor);
     }
+	attr = node->first_attribute("highlightcolor");
+    if (attr)
+    {
+        std::string color = attr->value();
+		ConvertStrToColor(color, &mHighlightColor);
+		hasHighlightColor = true;
+    }
 
     // Load the font, and possibly override the color
     child = node->first_node("font");
@@ -66,6 +77,14 @@
             std::string color = attr->value();
             ConvertStrToColor(color, &mColor);
         }
+
+		attr = child->first_attribute("highlightcolor");
+        if (attr)
+        {
+            std::string color = attr->value();
+			ConvertStrToColor(color, &mHighlightColor);
+			hasHighlightColor = true;
+        }
     }
 
     // Load the placement
@@ -117,7 +136,10 @@
             y -= mFontHeight;
     }
 
-    gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
+    if (hasHighlightColor && isHighlighted)
+		gr_color(mHighlightColor.red, mHighlightColor.green, mHighlightColor.blue, mHighlightColor.alpha);
+	else
+		gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
 
 	if (maxWidth)
 		gr_textExW(x, y, displayValue.c_str(), fontResource, maxWidth + x);