function trim(a){return new String(a).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function getHTTPObject(){var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
   try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
      try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
         xmlhttp = false;
      }
   }
@else
   xmlhttp = false;
@end @*/
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}return xmlhttp}function m_curl(b){var a=getHTTPObject();a.open("GET",b,true);a.send(null)}function m_rpc(c,b){var a=getHTTPObject();a.open("GET",c,true);a.onreadystatechange=function(){if(a.readyState==4){b.innerHTML=a.responseText}};a.send(null)}function m_logout(a){if(!a||a=="/"){a="/login/"}$.post("/rpc/login","do=logout",function(b){if(b.success==1){if(b.redirect){document.location=b.redirect}else{document.location=a}}else{alert("Logout Failed")}},"json")}function m_login(b,c){var a=b.re.value;if(!a){a="/user/"}$("#"+c).slideUp();$.post("/rpc/login",$(b).serialize(),function(d){if(d.success==1){document.location=a}else{if(d.redirect){document.location=d.redirect}else{$("#"+c).html(d.msg);$("#"+c).slideDown()}}},"json");if(b.rememberme&&b.rememberme.checked){Set_Cookie("email",b.e.value,100,"/","","")}else{Set_Cookie("email","",100,"/","","")}}function m_preview_statusemail(){window.open("/user/handler?do=preview-status-email","A","width=700,height=400,status=0,toolbar=0,scrollbars=1,resizable=1,location=0")}function m_signup(l,b,k){var j=trim(l.firstName.value);var i=trim(l.lastName.value);var h=trim(l.email.value).toLowerCase();var g=trim(l.phone.value).toLowerCase();var e=trim(l.password1.value);var d=trim(l.password2.value);var f=document.getElementById(b);var m="";if(j==""){m+="<br>Required: First Name"}if(i==""){m+="<br>Required: Last Name"}if(h==""){m+="<br>Required: Email"}if(g==""){m+="<br>Required: Phone"}if(e==""){m+="<br>Required: Password"}if(d==""){m+="<br>Required: Confirm Password"}if(m!=""){f.innerHTML=trim(m);return}var c="do=signup&email="+encodeURIComponent(h)+"&phone="+encodeURIComponent(g)+"&firstName="+encodeURIComponent(j)+"&lastName="+encodeURIComponent(i)+"&password1="+encodeURIComponent(e)+"&password2="+encodeURIComponent(d)+"";var a="/rpc/signup";var n=getHTTPObject();n.open("POST",a,true);n.setRequestHeader("Content-type","application/x-www-form-urlencoded");n.setRequestHeader("Content-length",c.length);n.setRequestHeader("Connection","close");n.onreadystatechange=function(){if(n.readyState==4){var o=trim(n.responseText);if(o=="OK"){document.location="/user/dashboard?newuser=1"}else{f.innerHTML=o}}};n.send(c)}function m_help(c){var a="/user/support/help/";if(c){a+="?itemId="+c}var b=window.open(a,"HELP","WIDTH=700,HEIGHT=350,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0");b.focus()}function Set_Cookie(c,e,a,h,d,g){var b=new Date();b.setTime(b.getTime());if(a){a=a*1000*60*60*24}var f=new Date(b.getTime()+(a));document.cookie=c+"="+escape(e)+((a)?";expires="+f.toGMTString():"")+((h)?";path="+h:"")+((d)?";domain="+d:"")+((g)?";secure":"")}function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function m_popupServiceLevels(){window.open("/popup-compare-service-levels.jsp","","width=670,height=800,,status=0,toolbar=0,scrollbars=1,resizable=1,location=0")}function ringme(){var b=window;var a=b.open;a("http://www.ringcentral.com/ringme/?uc=F535E04AA0A55519AAD219FC75E657DF780157084664,0,&s=no&v=2&number=1234","Callback_RingMe","resizable=no,width=380,height=360")}function dialNum(c){var b="/rpc/dial?dial="+c;var a=getHTTPObject();a.open("GET",b,true);a.onreadystatechange=function(){if(a.readyState==4){var d=trim(a.responseText);if(d!="OK"){alert(d)}}};a.send(null)}function chat(){var c=location.protocol.indexOf("https")==0?"https":"http";var a=c+"://messenger.providesupport.com/messenger/automaticsitemap.html";var b="width=650,height=440,left=50,top=50";window.open(a,"LIVECHAT",b)}function windowWidth(){if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){return window.innerWidth}if(navigator.appName.indexOf("Microsoft")!=-1){return document.body.offsetWidth}}}function windowHeight(){if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){return window.innerHeight}if(navigator.appName.indexOf("Microsoft")!=-1){return document.body.offsetHeight}}}function screenWidth(){return screen.width}function screenHeight(){return screen.height};
