//==================================================================
// iPhone Icon
// Timur Prokopiev 2011
//==================================================================


function setDefaultValues() {
  var values = new Array();
  
// Text
  values.push({ name:"Text", type:"text", value:"iPhone 4" });
  
// Color
  values.push({ name:"Color", type:"color", value:"#00ABA9" });

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

// Guide Icon
  values.push({ name:"Guide Icon", type:"Boolean",  value:"true" });

// Download
  values.push({ name:"Download", type:"Boolean",  value:"false" });

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

}

function applyCurrentValues() {
  var values = Widget.elem.customData["currentValues"];
  var guideicon = (values[3].value.toString()=="false");
  var download = (values[4].value.toString()=="false");

  Widget.GetObjectByName("text").textChars = values[0].value;
  Widget.GetObjectByName("color base").pathAttributes.fillColor = values[1].value;
  Widget.GetObjectByName("light").opacity = values[2].value;
  Widget.GetObjectByName("guide_icon").visible = (!guideicon);
  Widget.GetObjectByName("download").visible = (!download);

}

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