//==================================================================
// WP7 Notification
// Timur Prokopiev 2011
//==================================================================

function setDefaultValues() {
  var values = new Array();
  
// Accent Color
  values.push({ name:"Accent Color", type:"ComboBox", value:"Orange,Magenta,Purple,Teal,Lime,Brown,Pink,Orange,Blue,Red,Green"});

// Button Label
  values.push({ name:"Text", type:"text", value:"Thomas   Did you happen to see the game last wee" });

Widget.elem.customData["currentValues"] = values;

}

function applyCurrentValues() {
  var values = Widget.elem.customData["currentValues"];
  var color  = values[0].value.split(",")[0].toString();

  var magenta = "#FF0097";
  var purple = "#A200FF";
  var teal = "#00ABA9";
  var lime = "#8CBF26";
  var brown = "#996600";
  var pink = "#E671B8";
  var orange = "#F09609";
  var blue = "#1BA1E2";
  var red = "#E51400";
  var green = "#339933";

  Widget.GetObjectByName("text").textChars = values[1].value;

		if (color == "Magenta") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = magenta;}

		if (color == "Purple") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = purple;}

		if (color == "Teal") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = teal;}

		if (color == "Lime") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = lime;}

		if (color == "Brown") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = brown;}

		if (color == "Pink") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = pink;}

		if (color == "Orange") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = orange;}

		if (color == "Blue") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = blue;}

		if (color == "Red") {
		Widget.GetObjectByName("bg").pathAttributes.fillColorr = red;}

		if (color == "Green") {
		Widget.GetObjectByName("bg").pathAttributes.fillColor = green;}

}

switch (Widget.opCode)
{
	case 1: setDefaultValues();   break;
	case 2: applyCurrentValues(); break;
}