function logInfo(a){if(window.console){console.log(a)}}function hideIwPassword(){$(".iwPassword").each(function(){$(this).hide()})}function showIwPassword(){$(".iwPassword").each(function(){$(this).show()})}function hideVa(){$(".vaContent").each(function(){$(this).hide()})}function hideHelium(){$(".heContent").each(function(){$(this).hide()})}function hideHeliumPush(){$("#inWeboPush").hide()}function showHeliumPush(){$("#inWeboPush").show()}function showOpenAMForm(){$("#loginForm").show()}function hideOpenAMForm(){$("#loginForm").hide()}function setInWeboAuthType(a){$("input[name='callback_2']").val(a)}function startPushForm(){logInfo("Starting inWebo Push Form Authenticator");var a=$("#idToken1").val();$("#inWeboPushLogin").val(a);hideVa();hideHelium();hideOpenAMForm();showHeliumPush()}function startHeliumPush(){try{logInfo("Starting inWebo Helium Push Authenticator");hideVa();hideHelium();setInWeboAuthType("BROWSER");var a=$("#inWeboPushLogin").val();if(a===""){logInfo("no entering login");return false}else{logInfo("Send push notification for user '"+a+"'");$("#idToken1").val(a);$("#inWeboPushConfirm").attr("disabled","disabled");$("#loginButton_0").attr("disabled","disabled");hideHeliumPush();hideIwPassword();showOpenAMForm();$("#inwebo_login").text(a);$("#heliumAuthenticate").attr("action","push_authenticate");$("#heliumDesign").attr("container","helium_push");start_helium("heliumAuthenticate",function(c,d){if(d.result==="ok"){logInfo("inWebo Helium Push Authenticator activated");$("#loginButton_0").removeAttr("disabled");$("#idToken1").val(d.values[0]);$("#idToken2").val(d.values[1]);$("#loginButton_0").click()}else{startOtpDisplay()}})}}catch(b){logInfo("Error: could not start inWebo Helium Push in this browser. "+b.toString());startOtpDisplay()}}function startHelium(b){try{logInfo("Starting inWebo Helium Authenticator");hideVa();setInWeboAuthType("BROWSER");start_helium("heliumAuthenticate",function(c,d){if(d.result==="ok"){logInfo("inWebo Helium Authenticator activated");$("#idToken1").val(d.values[0]);$("#idToken2").val(d.values[1]);$("#loginButton_0").click()}else{if(d.result==="nok"&&d.error==="no_profile"&&b==="true"){startPushForm()}else{logInfo("inWebo Helium Authenticator is not activated");startOtpDisplay()}}})}catch(a){logInfo("Error: could not start inWebo Helium in this browser. "+a.toString());startOtpDisplay()}}function startOtpDisplay(){logInfo("Starting InWebo OTP Authenticator");setInWeboAuthType("OTP");$("#loginButton_0").removeAttr("disabled");hideVa();hideHelium();hideHeliumPush();showIwPassword();showOpenAMForm()}function startVa(c){try{logInfo("Starting inWebo VA Authenticator");hideOpenAMForm();hideHeliumPush();hideHelium();setInWeboAuthType("BROWSER");var a=$("#idToken1").val();$("#inwebologin").text(a);$("#inwebo_login").text(a);iwstart("vaStart",function(d,e){if(e.type==="success"&&e.code==="ok"&&e.action==="authentication"){hideHelium();$("#idToken1").val(e.result.values[0]);$("#idToken2").val(e.result.values[1]);$("#loginButton_0").click()}else{if(e.code==="info"&&e.result.reason==="ui_shown"){hideHelium()}else{if(e.code==="nok"){if(e.result.reason==="no_container"){logInfo("inWebo Virtual Authenticator display container could not be found!")}else{if(e.result.reason==="no_profile"){logInfo("inWebo Virtual Authenticator no_profile")}}startHelium(c)}}}})}catch(b){logInfo("Error: could not start inWebo Virtual Authenticator in this browser. "+b.toString());startHelium()}};