//==================================================================
// WP7 Quick Jump List
// 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"});

// List Items 
  values.push({ name:"list1", type:"Boolean",  value:"false" });
  values.push({ name:"text1", type:"text", value:"Architecture" });

  values.push({ name:"list2", type:"Boolean",  value:"false" });
  values.push({ name:"text2", type:"text", value:"Bowling" });

  values.push({ name:"list3", type:"Boolean",  value:"false" });
  values.push({ name:"text3", type:"text", value:"Candy" });

  values.push({ name:"list4", type:"Boolean",  value:"false" });
  values.push({ name:"text4", type:"text", value:"Dogs" });

  values.push({ name:"list5", type:"Boolean",  value:"false" });
  values.push({ name:"text5", type:"text", value:"Expenses" });

  values.push({ name:"list6", type:"Boolean",  value:"false" });
  values.push({ name:"text6", type:"text", value:"Food" });

  values.push({ name:"list7", type:"Boolean",  value:"false" });
  values.push({ name:"text7", type:"text", value:"Friends" });

  values.push({ name:"list8", type:"Boolean",  value:"false" });
  values.push({ name:"text8", type:"text", value:"Holidays" });

  values.push({ name:"list9", type:"Boolean",  value:"false" });
  values.push({ name:"text9", type:"text", value:"Monkeys" });

  values.push({ name:"list10", type:"Boolean",  value:"false" });
  values.push({ name:"text10", type:"text", value:"Tools" });

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

}

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

  var list1 = (values[1].value.toString()=="false");
  var list2 = (values[3].value.toString()=="false");
  var list3 = (values[5].value.toString()=="false");
  var list4 = (values[7].value.toString()=="false");
  var list5 = (values[9].value.toString()=="false");
  var list6 = (values[11].value.toString()=="false");
  var list7 = (values[13].value.toString()=="false");
  var list8 = (values[15].value.toString()=="false");
  var list9 = (values[17].value.toString()=="false");
  var list10 = (values[19].value.toString()=="false");

  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("text1").textChars = values[2].value;
		Widget.GetObjectByName("text2").textChars = values[4].value;
		Widget.GetObjectByName("text3").textChars = values[6].value;
		Widget.GetObjectByName("text4").textChars = values[8].value;
		Widget.GetObjectByName("text5").textChars = values[10].value;
		Widget.GetObjectByName("text6").textChars = values[12].value;
		Widget.GetObjectByName("text7").textChars = values[14].value;
		Widget.GetObjectByName("text8").textChars = values[16].value;
		Widget.GetObjectByName("text9").textChars = values[18].value;
		Widget.GetObjectByName("text10").textChars = values[20].value;

		if (color == "Magenta") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = magenta;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = magenta;

		}

		if (color == "Purple") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = purple;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = purple;

		}

		if (color == "Teal") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = teal;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = teal;

		}

		if (color == "Lime") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = lime;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = lime;

		}
		
		if (color == "Brown") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = brown;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = brown;

		}

		if (color == "Pink") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = pink;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = pink;

		}

		if (color == "Orange") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = orange;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = orange;

		}

		if (color == "Blue") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = blue;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = blue;

		}

		if (color == "Red") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = red;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = red;

		}


		if (color == "Green") {
		Widget.GetObjectByName("list1").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list2").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list3").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list4").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list5").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list6").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list7").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list8").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list9").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list10").pathAttributes.fillColor = green;
		Widget.GetObjectByName("list11").pathAttributes.fillColor = green;

		}

		if (values[1].value.toString()=="true") {
 		Widget.GetObjectByName("list1").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[3].value.toString()=="true") {
 		Widget.GetObjectByName("list2").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[5].value.toString()=="true") {
 		Widget.GetObjectByName("list3").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[7].value.toString()=="true") {
 		Widget.GetObjectByName("list4").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[9].value.toString()=="true") {
 		Widget.GetObjectByName("list5").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[11].value.toString()=="true") {
 		Widget.GetObjectByName("list6").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[13].value.toString()=="true") {
 		Widget.GetObjectByName("list7").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[15].value.toString()=="true") {
 		Widget.GetObjectByName("list8").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[17].value.toString()=="true") {
 		Widget.GetObjectByName("list9").pathAttributes.fillColor = "#1F1F1F";	
		}
		if (values[19].value.toString()=="true") {
 		Widget.GetObjectByName("list10").pathAttributes.fillColor = "#1F1F1F";	
		}
}

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