$("#page #alarmlogin a").click(function(){hideLoginPanel()});function submitLogin(){document.loginForm.submit();$(function(){});return false}function testClientCookies(){var a=false;if(arguments.length>0){a=arguments[0]}if(a){var c=new Date();var b=new Date(c.valueOf()+1000*5);document.cookie="cookieTest=persist;expires="+b.toGMTString()}else{document.cookie="cookieTest=session"}if((document.cookie).indexOf("cookieTest")==-1){return false}else{return true}}function doLoginTimeChecks(){if(testClientCookies()){document.forms.loginForm.cookieTest.value="1"}document.forms.loginForm.JavaScriptTest.value="1";var d=document.getElementById("login");var b=document.getElementById("rememberMe");if((d!=null)&&(b!=null)){var g=new Date();if(document.forms.loginForm.rememberMe.checked==true){var c=new Date(g.getTime()+7776000000);var a=c.toGMTString();document.cookie="login="+d.value+"; expires="+a}else{var e=new Date(g.getTime()-7776000000);var f=e.toGMTString();document.cookie="login="+d.value+"; expires="+f}}return true}function readCookie(a){var c="";var b=a+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}c=unescape(document.cookie.substring(offset,end))}}return c}function getQuerystring(b,d){if(d==null){d=""}b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+b+"=([^&#]*)");var a=c.exec(window.location.href);if(a==null){return d}else{return a[1]}}function rememberMeClick(){if(document.forms.loginForm.rememberMe.checked==true){if(!testClientCookies){window.location="/yourloginpagehere.xxx?m=cookies_off&browser="+browserCode;return}if(!testClientCookies(true)){alert('In order to take advantage of Alarm.com\'s "Remember My Login" feature, you must allow cookies to be stored on your computer.  Visit the Alarm.com FAQ for more information.');document.forms.loginForm.rememberMe.checked=false}}}function LoadRememberedLoginName(){var b="";b=readCookie("login");if(b!=""){var c=document.getElementById("login");if(c!=null){c.value=b}var a=document.getElementById("rememberMe");if(a!=null){a.checked=true}}}function showAlarmLoginMessage(){var b=getQuerystring("m");if(b==null){return}var c,a;c=null;largeMsg=null;detailMsg=null;solutionMsg=null;switch(b){case"bad_permission":detailMsg="We apologize, but it the page you are trying to reach no longer exists.";solutionMsg="If you reached this page via a bookmark, please delete your bookmark, navigate to the page you are trying to reach, and re-bookmark the page. We encourage everyone to use the Alarm.com site links rather than typing in URLs.<br>Please <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> and try again.";omniAJAXtrack("Notifications: Page Doesn't Exist","Notifications","","","BigDialogPopDown","","bad_permission","");break;case"cookies_off":detailMsg="In order to access this site, please Enable Cookies in your browser.";solutionMsg="Please enable Cookies in your browser. Once complete, please <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> and try again.";omniAJAXtrack("Notification: Please Enable Cookies","Notifications","","","BigDialogPopDown","","cookies_off","");break;case"logout":c="You have successfully logged out.";omniAJAXtrack("Notifications: Successfully Logged Out","Notifications","","","LoginPopDown","","logout","");break;case"no_session":c="Session expired. Please log in again.";omniAJAXtrack("Notifications: Session Expired, please log in again","Notifications","","","LoginPopDown","","no_session","");break;case"scripting_off":detailMsg="JavaScript is required. ";solutionMsg="Please enable JavaScript in your browser settings.<br>Please <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> and try again.";omniAJAXtrack("Notifications: JavaScript disabled","Errors","","","BigDialogPopDown","","scripting_off","");break;case"sensors_cmd_sent":detailMsg="A request has been sent to your system to retrieve an up-to-date sensor list.  It may take up to 2-3 minutes for this process to be completed.  After a few moments, please try to log in again.";solutionMsg="Please wait 2 - 3 minutes and <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> again.";omniAJAXtrack("Notifications: Sensors Command Sent","Notifications","","","BigDialogPopDown","","Sensors_cmd_sent","");break;case"web_error":detailMsg="We're sorry, an unexpected error occurred while processing the page you requested. As a security precaution you have been automatically logged out.  If the problem persists after you log back into the site, please contact us for help in resolving this problem.";solutionMsg="Please <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> and try again.";omniAJAXtrack("Errors: Unexpected Error","Errors","","","BigDialogPopDown","","web_error","");break;case"login_fail":a=getQuerystring("r");if(a=="lockout"){detailMsg="As a security precaution your account has been locked out due to too many incorrect password attempts.  To unlock your account, please request a new password by filling out the 'Forgot your password' form <A href='https://www.alarm.com/forgot_logininfo.asp'>here.</a>";solutionMsg="Please <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> again.";omniAJAXtrack("Notification: Lockout","Notifications","","","BigDialogPopDown","","lockout","")}else{if(a=="terminated"){detailMsg="Your account has been terminated.  If you believe this to be in error, or if you would like to re-activate your account, please contact us.";solutionMsg="Please call Melaleuca Security at 877.760.3444";omniAJAXtrack("Notifications: Account Terminated","","","","BigDialogPopDown","","Account Terminated","")}else{if(a=="no_panel"){detailMsg="Your control panel has not communicated with Alarm.com. Please make sure your control panel is powered on then try again. If you are still having trouble, please contact us.";solutionMsg="Please ensure your Control Panel is powered on and <a href='#' onclick='hideBigAlertMessage(); showLoginPanel(); return false;' style='color:#f78f11; text-decoration:underline;'>Sign In</a> and try again.";omniAJAXtrack("Notifications: Control Panel Not Communicating","","","","BigDialogPopDown","","no_panel","")}else{if(a=="error"){detailMsg="We're sorry, your account is currently unavailable. A message has automatically been sent to Technical Support to address this issue. We will contact you when the issue has been resolved.";solutionMsg="";omniAJAXtrack("Errors: Account Unavailable","","","","BigDialogPopDown","","error","")}else{if(a=="custom"){detailMsg=getQuerystring("cm");solutionMsg="";omniAJAXtrack("Custom:"+getQuerystring("cm"),"","","","BigDialogPopDown","","custom","")}else{if(a=="no_match"){c="Incorrect Username/Password. <A href='https://www.alarm.com/forgot_logininfo.asp' style='color:white; text-decoration: underline'>Forgot your password?</a>";omniAJAXtrack("Notifications: Wrong Username or Password","","","","LoginPopDown","","no_match","")}}}}}}break;default:break}if(c!=null){$(function(){$("div#errorMsg").css("display","block");showLoginPanel(c)})}else{if(detailMsg!=null){showBigAlertMessage(detailMsg,solutionMsg)}}}function showBigAlertMessage(b,a){$(function(){$("#page #bigAlertMessage #alertDetails").html(b);$("#page #bigAlertMessage #alertSolution").html(a);$("#page #bigAlertMessage").css("display","block");$("#page #bigAlertMessage").animate({top:"0px"})});return false}function hideBigAlertMessage(){$(function(){$("#page #bigAlertMessage").animate({top:"-221px"},"slow")});return false}function showLoginPanel(a){$(function(){$("#page #alarmlogin #errorMsg").html(a);$("#page #alarmlogin").css("display","block");$("#page #alarmlogin").animate({top:"0px"},"slow")});return false}function hideLoginPanel(){$("#page #alarmlogin").animate({top:"-196px"},"slow");$("#page #alarmlogin").css("display","block");return false}$(function(){});