//==================================================================
// iPhone Switch
// Timur Prokopiev 2011
//==================================================================


function setDefaultValues() {
  var values = new Array();
  
// Switch State
  values.push({ name:"State", type:"ComboBox", value:"On,On,Off"});

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

}

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

  Widget.GetObjectByName("on").visible = (state == "On");
  Widget.GetObjectByName("off").visible = (state == "Off");

}

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