window.onload = function()
{
	UpdateWifi();
	networkImage.src = "images/network.png";
	
}

System.Network.Wireless.signalStrengthChanged = function()
{
	UpdateWifi();
}

System.Network.Wireless.connectionChanged = function()
{
	UpdateWifi();
}

function UpdateWifi()
{

	if(System.Network.Wireless.secureConnection)
		networkImagesecure.src = "images/key.png";
	else
		networkImagesecure.src = "images/null.png";

	networkName.innerHTML = System.Network.Wireless.ssid;
	var signalS = System.Network.Wireless.signalStrength;

	var signalImage
	
	if(signalS <= 16.5)
		signalImage ="w00.png";
	if(signalS >= 16.5)
		signalImage ="w10.png";
	if(signalS >= 33)
		signalImage ="w20.png";
	if(signalS >= 49.5)
		signalImage ="w30.png";
	if(signalS >= 66)
		signalImage ="w40.png";
	if(signalS >= 82)
		signalImage ="w50.png";

	controlImage.src = "images/Status/" + signalImage;
}
