function logInfo(a){if(window.console){console.log(a)}}function hideInWeboCallBack(){$("div.iw3").remove();$("div.iw4").remove();$("div.iw5").remove()}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='inWeboAuthType']").val(a)}function startPushForm(){logInfo("Starting inWebo Push Form Authenticator");var a=$("#IDToken1").val();$("#inWeboPushLogin").val(a);hideVa();hideHelium();hideOpenAMForm();showHeliumPush()}function startOtpDisplay(){logInfo("Starting InWebo OTP Authenticator");setInWeboAuthType("OTP");$("#Login.Submit").attr("disabled","disabled");hideVa();hideHelium();hideHeliumPush();showIwPassword();showOpenAMForm()}function startHeliumPush(){try{logInfo("Starting inWebo Helium Push Authenticator");setInWeboAuthType("BROWSER");hideVa();hideHelium();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");$("#Login.Submit").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");$("#Login.Submit").removeAttr("disabled");c.insertFields(d)}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");c.insertFields(d)}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 startVa(b){try{logInfo("Starting inWebo VA Authenticator");hideOpenAMForm();hideHeliumPush();hideHelium();setInWeboAuthType("BROWSER");iwstart("vaStart",function(c,d){if(d.type==="success"&&d.code==="ok"&&d.action==="authentication"){c.insertFields(d.result)}else{if(d.code==="info"&&d.result.reason==="ui_shown"){hideHelium()}else{if(d.code==="nok"){if(d.result.reason==="no_container"){logInfo("inWebo Virtual Authenticator display container could not be found!")}else{if(d.result.reason==="no_profile"){logInfo("inWebo Virtual Authenticator no_profile")}}startHelium(b)}else{startHelium(b)}}}})}catch(a){logInfo("Error: could not start inWebo Virtual Authenticator in this browser. "+a.toString());startHelium(b)}};