
function init() {

    if (hasNabtoPluginWithSSO()) {
        //var login = document.getElementById("login");
        //var form = login.getElementsByTagName("form");
        //var form = document.getElementsByTagName("form");
        //form[0].action = "nabto://self/login/execute";

	var form = document.getElementById("loginform");
	// The login form wasn't found, no reason for updating it
	if (form == undefined) {
	  return;
        }
	form.action = "nabto://self/login/execute";

        // adhere to plugin name scheme
        var username = document.getElementById("username");
        username.name = "email";

        // display icon for the user to know that the plugin is detected
        var pf = document.getElementById("pluginflag");
        pf.style.display = "inline";
    }
}

writeTestCanvas();
addEvent(window, "load", init);

