//==================================================================
// iPhone Alert (Log&Pass)
// Timur Prokopiev 2011
//==================================================================


function setDefaultValues() {
  var values = new Array();
  
// Alert Label
  values.push({ name:"Alert Label", type:"text", value:"VPN Connection" });

// Alert Text
  values.push({ name:"Alert Text", type:"text", value:"Enter your user authentication" });

// Login
  values.push({ name:"Login", type:"text", value:"username" });

// Inactive Label
  values.push({ name:"Inactive Btn", type:"text", value:"Cancel" });

// Active Label
  values.push({ name:"Active Btn", type:"text", value:"OK" });

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

}

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

		Widget.GetObjectByName("alert label").textChars = values[0].value;
 		Widget.GetObjectByName("alert text").textChars = values[1].value;
 		Widget.GetObjectByName("login").textChars = values[2].value;
  		Widget.GetObjectByName("cancel").textChars = values[3].value;
  		Widget.GetObjectByName("ok").textChars = values[4].value;

}

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