//==================================================================
// WP7 Status Bar
// Timur Prokopiev 2011
//==================================================================


function setDefaultValues() {
  var values = new Array();
  
// Theme
  values.push({ name:"Theme", type:"ComboBox", value:"Dark,Dark,Light"});

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

// Enable 3G
  values.push({ name:"3G", type:"Boolean",  value:"true" });

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

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

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

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

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

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

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

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

}

function applyCurrentValues() {
  var values = Widget.elem.customData["currentValues"];
  var theme  = values[0].value.split(",")[0].toString();
  var signal = (values[1].value.toString()=="false");
  var net = (values[2].value.toString()=="false");
  var call = (values[3].value.toString()=="false");
  var roaming = (values[4].value.toString()=="false");
  var wifi = (values[5].value.toString()=="false");
  var bluetooth = (values[6].value.toString()=="false");
  var ring = (values[7].value.toString()=="false");
  var input = (values[8].value.toString()=="false");
  var battery = (values[9].value.toString()=="false");

		Widget.GetObjectByName("signal").visible = (!signal);
		Widget.GetObjectByName("3g").visible = (!net);	
		Widget.GetObjectByName("call").visible = (!call);		
		Widget.GetObjectByName("roaming").visible = (!roaming);		
		Widget.GetObjectByName("wifi").visible = (!wifi);		
		Widget.GetObjectByName("bluetooth").visible = (!bluetooth);		
		Widget.GetObjectByName("ring").visible = (!ring);		
		Widget.GetObjectByName("input").visible = (!input);		
		Widget.GetObjectByName("battery").visible = (!battery);		

		if (theme == "Dark") {
		Widget.GetObjectByName("signal").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("3g").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("call").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("roaming").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("wifi").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("bluetooth").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("ring").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("input").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("battery").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("time").pathAttributes.fillColor = "#FFFFFF";
		Widget.GetObjectByName("bg").pathAttributes.fillColor = "#000000";
		}
	
		if (theme == "Light") {
		Widget.GetObjectByName("signal").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("3g").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("call").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("roaming").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("wifi").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("bluetooth").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("ring").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("input").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("battery").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("time").pathAttributes.fillColor = "#000000";
		Widget.GetObjectByName("bg").pathAttributes.fillColor = "#FFFFFF";
		}
		
}

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