//==================================================================
// iPhone Wheel (Selector 2 Items)
// Timur Prokopiev 2011
//==================================================================


function setDefaultValues() {
  var values = new Array();
  
// Number 1
  values.push({ name:"Number 1", type:"text", value:"4"});

// Number 2
  values.push({ name:"Number 2", type:"text", value:"20"});

// Label 1
  values.push({ name:"Label 1", type:"text", value:"mins"});

// Label 2
  values.push({ name:"Label 2", type:"text", value:"mins"});

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

}

function applyCurrentValues() {
  var values = Widget.elem.customData["currentValues"];

Widget.GetObjectByName("1 (active)1").textChars = values[0].value;
Widget.GetObjectByName("2 (active)1").textChars = values[1].value;

Widget.GetObjectByName("1 (active)2").textChars = values[2].value;
Widget.GetObjectByName("2 (active)2").textChars = values[3].value;

Widget.GetObjectByName("1 (column1)").textChars = parseInt(values[0].value)-2;
Widget.GetObjectByName("2 (column1)").textChars = parseInt(values[0].value)-1;
Widget.GetObjectByName("3 (column1)").textChars = parseInt(values[0].value)+1;
Widget.GetObjectByName("4 (column1)").textChars = parseInt(values[0].value)+2;

Widget.GetObjectByName("1 (column2)").textChars = parseInt(values[1].value)-2;
Widget.GetObjectByName("2 (column2)").textChars = parseInt(values[1].value)-1;
Widget.GetObjectByName("3 (column2)").textChars = parseInt(values[1].value)+1;
Widget.GetObjectByName("4 (column2)").textChars = parseInt(values[1].value)+2;

}

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