function reset_sip_password(C,B){var D=confirm(t("confirm_reset_sip_password"));if(D!=true){return false}$("#sip_reset_password").hide();$("#sip_reset_password_loading").show();xhr=$.ajax({type:"POST",cache:false,url:"/ajax_reset_sip_password.cgi",data:"server_id="+C+"&ext="+B,error:function(F,H,G){$("#sip_reset_password_loading").hide();$("#sip_reset_password").show();E("An error has occurred making the request: "+G)},success:function(F){$("#sip_reset_password_loading").hide();$("#sip_reset_password").show();A(F)}});function A(F){alert(F)}function E(F){alert(F);return false}}function checkASCIIform(B){var A=B.elements.length;for(i=0;i=48&&A<=57)||(A>=97&&A<=122)||(A>=65&&A<=90)||(A>=33&&A<=40)||A==45||A==46||A==8||A==9||A==95||A==64||A==13){D=0}if(!F&&A==32){D=0}if(D){alert(C+" must only contain "+B+".");E.cancelBubble=true;E.returnValue=false;return false}return true}function checkNum(C,B,A){if(!A){var A=window.event}if(!C){C="This field"}if(A.keyCode){charCode=A.keyCode}else{if(A.which){charCode=A.which}}var D=0;if(((charCode<48)||(charCode>57))&&charCode!=13&&charCode!=8&&charCode!=192&&charCode!=46&&charCode!=37&&charCode!=39&&charCode!=91&&charCode!=9){D=1}if(B){if((charCode==42)||(charCode==35)||(charCode==43)||(charCode==119)){D=0}}if(!B){B=""}if(D){alert(C+" accepts only numbers"+B+".");A.cancelBubble=true;return false}}function checkPhoneNum(C,B,A){if(!A){var A=window.event}if(!C){C="This field"}if(A.keyCode){charCode=A.keyCode}else{if(A.which){charCode=A.which}}var D=0;if(((charCode<48)||(charCode>57))&&charCode!=32&&charCode!=40&&charCode!=41&&charCode!=45&&charCode!=13&&charCode!=8&&charCode!=192&&charCode!=46&&charCode!=37&&charCode!=39&&charCode!=91&&charCode!=9){D=1}if(B){if((charCode==42)||(charCode==35)||(charCode==43)||(charCode==119)){D=0}}if(!B){B=""}if(D){alert(C+" accepts only numbers"+B+".");A.cancelBubble=true;return false}}function placeFocus2(form_name,field_name){var this_form=eval("document.forms."+form_name+"."+field_name);this_form.focus()}function confirmSubmit(B){var A=confirm(B);if(A){return true}else{return false}}function setValueSubmit(A){return prompt(A)}function div_display(B,A){var C=document.getElementById(B);if(!C){return }if(A==1){C.style.display="block"}else{C.style.display="none"}}function MM_preloadImages(){var D=document;if(D.images){if(!D.MM_p){D.MM_p=new Array()}var C,B=D.MM_p.length,A=MM_preloadImages.arguments;for(C=0;C0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B2){if((A=MM_findObj(B[2]))!=null&&!A.MM_init){A.MM_init=true;A.MM_up=B[3];A.MM_dn=A.src;if((F=document[D])==null){F=document[D]=new Array()}F[F.length]=A;for(C=4;C"+E+"
'+F+'
 
";document.getElementById("prompt_text").focus();document.getElementById("prompt_text").select()}function setTableWidth(A){var B=document.getElementById(A);if(!B.new_width){B.new_width=B.rows[0].offsetWidth}B.style.width=B.new_width}function Browser(){var B,C,A;this.isIE=false;this.isNS=false;this.version=null;B=navigator.userAgent;C="MSIE";if((A=B.indexOf(C))>=0){this.isIE=true;this.version=parseFloat(B.substr(A+C.length));return }C="Netscape6/";if((A=B.indexOf(C))>=0){this.isNS=true;this.version=parseFloat(B.substr(A+C.length));return }C="Gecko";if((A=B.indexOf(C))>=0){this.isNS=true;this.version=6.1;return }}var browser=new Browser();var dragObj=new Object();dragObj.zIndex=0;function dragStart(C,E){var B;var A,D;if(E){dragObj.elNode=document.getElementById(E)}else{if(browser.isIE){dragObj.elNode=window.event.srcElement}if(browser.isNS){dragObj.elNode=C.target}if(dragObj.elNode.nodeType==3){dragObj.elNode=dragObj.elNode.parentNode}}if(browser.isIE){A=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;D=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}if(browser.isNS){A=C.clientX+window.scrollX;D=C.clientY+window.scrollY}dragObj.cursorStartX=A;dragObj.cursorStartY=D;dragObj.elStartLeft=parseInt(dragObj.elNode.style.left,10);dragObj.elStartTop=parseInt(dragObj.elNode.style.top,10);if(isNaN(dragObj.elStartLeft)){dragObj.elStartLeft=0}if(isNaN(dragObj.elStartTop)){dragObj.elStartTop=0}dragObj.elNode.style.zIndex=++dragObj.zIndex;if(browser.isIE){document.attachEvent("onmousemove",dragGo);document.attachEvent("onmouseup",dragStop);window.event.cancelBubble=true;window.event.returnValue=false}if(browser.isNS){document.addEventListener("mousemove",dragGo,true);document.addEventListener("mouseup",dragStop,true);C.preventDefault()}}function dragGo(B){var A,C;if(browser.isIE){A=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;C=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}if(browser.isNS){A=B.clientX+window.scrollX;C=B.clientY+window.scrollY}dragObj.elNode.style.left=(dragObj.elStartLeft+A-dragObj.cursorStartX)+"px";dragObj.elNode.style.top=(dragObj.elStartTop+C-dragObj.cursorStartY)+"px";if(browser.isIE){window.event.cancelBubble=true;window.event.returnValue=false}if(browser.isNS){B.preventDefault()}}function dragStop(A){if(browser.isIE){document.detachEvent("onmousemove",dragGo);document.detachEvent("onmouseup",dragStop)}if(browser.isNS){document.removeEventListener("mousemove",dragGo,true);document.removeEventListener("mouseup",dragStop,true)}}local=false;function setLocal(A){local=A}function localURL(B,C,A){if(local==true){B.href=C}else{B.href=A}}function disableText(A){A.disabled=true;A.style.backgroundColor=inputTextColorDisabled()}function enableText(A){A.disabled=false;A.style.backgroundColor=inputTextColorEnabled()}function inputTextColorEnabled(){for(h in document.styleSheets){var A=new Array();if(document.styleSheets[h].cssRules){A=document.styleSheets[h].cssRules}else{if(document.styleSheets[h].rules){A=document.styleSheets[h].rules}}for(i in A){if(A[i]["selectorText"]=="input.input_text"||A[i]["selectorText"]=="INPUT.input_text"){return A[i].style.backgroundColor}}}}function inputTextColorDisabled(){for(h in document.styleSheets){var A=new Array();if(document.styleSheets[h].cssRules){A=document.styleSheets[h].cssRules}else{if(document.styleSheets[h].rules){A=document.styleSheets[h].rules}}for(i in A){if(A[i]["selectorText"]=="input.input_text_disabled"||A[i]["selectorText"]=="INPUT.input_text_disabled"){return A[i].style.backgroundColor}}}}function showAllRows(C){var B=document.getElementById(C);for(var A=0;AH}else{I=A0){J=E;A=H}}if(J>G){F=D.removeChild(D.rows[J]);D.insertBefore(F,D.rows[G])}}D.style.display=K;return false}function clog(A){}function up_down(A){up_id=document.getElementById("up"+A);down_id=document.getElementById("down"+A);down_id.style.display=down_id.style.display=="none"?"inline":"none";var B=up_id.style.display=="none"?"inline":"none";up_id.style.display=B;if(B=="none"){sort_table("tbody",A,0)}else{sort_table("tbody",A,1)}}function validPhoneNumber(B){var A=/\D/g;B=B.replace(/[()\- ]/g,"");B=B.replace(/^\s*\+/,"");if(B.length<10){return false}else{if(B.match(A)){return false}else{return true}}}function fixTableWidths(A){var B=0;for(i=0;iB){B=$(A[i]).offsetWidth}}}for(i=0;i";$("callforward").value=$("call_forward_ext").value}else{if(document.getElementById("call_forward")&&document.getElementById("call_forward").value=="-keycode-"){call_fwd_exten=1;document.getElementById("call_fwd").innerHTML="";$("callforward").value=$("call_forward_ext").value}else{if($("call_forward")){$("callforward").value=$("call_forward").value}}}}function checkExten(){if(document.getElementById("call_forward_ext").value==""){call_fwd_exten=0;document.getElementById("call_fwd").innerHTML=call_fwd_list;if($("call_forward")){$("callforward").value=$("call_forward").value}}else{$("callforward").value=$("call_forward_ext").value}}var changedCID=0;function matchCID(B){if(changedCID==1){return false}if(B.selectedIndex==0){document.forms.f.caller_id.selectedIndex=0}didValue=B.options[B.selectedIndex].value;for(var A=1;A');FONALITY.panel.wait.render(document.body);FONALITY.panel.wait.show()}function defaultCDRSettings(A){if(!A.showinbound.checked&&!A.showoutbound.checked&&!A.showext2ext.checked&&!A.showacd.checked&&!A.showinternal.checked&&!A.showbarge.checked){A.showinbound.checked=A.showoutbound.checked=true}if(!A.src.checked&&!A.dst.checked&&!A.disposition.checked&&!A.calldate.checked&&!A.duration.checked&&!A.billsec.checked&&!A.clid.checked){A.src.checked=A.dst.checked=A.disposition.checked=A.calldate.checked=A.duration.checked=A.billsec.checked=true}}function setDates(A,B){if(!dateValidation(B)){alert("You have entered an invalid date format.")}}function alterFromCountry(){var C=document.forms[0]["country"];var A=document.forms[0]["Country_opermode_loadzone"];var E=C.options[C.selectedIndex].value;var D;for(var B=0;B-1){B=B.replace(/set_language=\w+/g,"")}if(B.length){B+="&set_language="+D}else{B="?set_language="+D}}var A=window.location+"";if(A.indexOf("?")>-1){A=A.substring(0,A.indexOf("?"))}window.location=A+B}function get_ext_info(E,H,F,D,C){var A="/ajax_get_ext_info.cgi?server_id="+E+"&extension="+H+"&action="+F+"&type="+D;var G=document.getElementById(C+"_loading");var B=document.getElementById(C);G.style.display="inline";B.style.display="none";ajax=new Ajax();ajax.onDone=function(J,K){var I=K.split("\n");if(I[0]==1){alert(I[1])}else{alert("You are not logged in correctly")}G.style.display="none";B.style.display="inline"};ajax.get(A);return false}function get_device_info(F,C,E,D){var A="/ajax_get_device_info.cgi?server_id="+F+"&device_id="+C+"&type="+E;var G=document.getElementById(D+"_loading");var B=document.getElementById(D);G.style.display="inline";B.style.display="none";ajax=new Ajax();ajax.onDone=function(I,J){var H=J.split("\n");if(H[0]==1){alert(H[1])}else{alert("You are not logged in correctly")}G.style.display="none";B.style.display="inline"};ajax.get(A);return false}function get_ftp_info(D,C){var A="/ajax_get_ftp_info.cgi?server_id="+D;var E=document.getElementById(C+"_loading");var B=document.getElementById(C);E.style.display="inline";B.style.display="none";ajax=new Ajax();ajax.onDone=function(G,H){var F=H.split("\n");if(F[0]==1){var I=F[1]+"\n"+F[2]+"\n"+F[3];alert(I)}else{alert("You are not logged in correctly")}E.style.display="none";B.style.display="inline"};ajax.get(A);return false}function check_reset_password_form(){var B=document.getElementById("email").value;var A=document.getElementById("username").value;if(B==""||A==""){alert(t("reset_enter_user_email","Please enter your username and email"));return false}else{return true}}function check_update_password_form(){var B=document.getElementById("new_pass").value;var A=document.getElementById("confirm_pass").value;if(B==""){alert(t("reset_enter_pass","Please enter a new password"));return false}else{if(B!=A){alert(t("reset_pw_dont_match","Passwords do not match"));return false}else{return true}}}function check_lan_access(D,C,B){var A=document.createElement("img");A.src="http://"+D+"/phone/spacer.gif";A.style.display="none";A.onload=C;if(B!=undefined){A.onerror=B}document.body.appendChild(A)}var viewport={getWinWidth:function(){this.width=0;if(window.innerWidth){this.width=window.innerWidth-18}else{if(document.documentElement&&document.documentElement.clientWidth){this.width=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){this.width=document.body.clientWidth}}}},getWinHeight:function(){this.height=0;if(window.innerHeight){this.height=window.innerHeight-18}else{if(document.documentElement&&document.documentElement.clientHeight){this.height=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){this.height=document.body.clientHeight}}}},getScrollX:function(){this.scrollX=0;if(typeof window.pageXOffset=="number"){this.scrollX=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){this.scrollX=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){this.scrollX=document.body.scrollLeft}else{if(window.scrollX){this.scrollX=window.scrollX}}}}},getScrollY:function(){this.scrollY=0;if(typeof window.pageYOffset=="number"){this.scrollY=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){this.scrollY=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){this.scrollY=document.body.scrollTop}else{if(window.scrollY){this.scrollY=window.scrollY}}}}},getAll:function(){this.getWinWidth();this.getWinHeight();this.getScrollX();this.getScrollY()}};var dw_event={add:function(D,C,A,B){B=B||false;if(D.addEventListener){D.addEventListener(C,A,B)}else{if(D.attachEvent){D.attachEvent("on"+C,A)}}},remove:function(D,C,A,B){B=B||false;if(D.removeEventListener){D.removeEventListener(C,A,B)}else{if(D.detachEvent){D.detachEvent("on"+C,A)}}},DOMit:function(A){A=A?A:window.event;A.tgt=A.srcElement?A.srcElement:A.target;if(!A.preventDefault){A.preventDefault=function(){return false}}if(!A.stopPropagation){A.stopPropagation=function(){if(window.event){window.event.cancelBubble=true}}}return A}};var RollTip={followMouse:true,overlaySelects:true,offX:12,offY:12,ID:"rolltipDiv",showAni:400,hideAni:200,ovTimer:0,ready:false,timer:null,tip:null,shim:null,supportsOverlay:false,init:function(){var C=navigator.userAgent;var B=C.indexOf("Opera");var A=(B==-1||parseFloat(C.slice(B+6))>7.5)?true:false;if(document.createElement&&document.body&&typeof document.body.appendChild!="undefined"&&A){var D=document.createElement("DIV");D.id=this.ID;document.body.appendChild(D);this.showMult=D.offsetWidth/this.showAni/this.showAni;this.hideMult=D.offsetWidth/this.hideAni/this.hideAni;D.style.clip="rect(0, 0, 0, 0)";D.style.visibility="visible";this.supportsOverlay=this.checkOverlaySupport();this.ready=true}},reveal:function(E,C,D,A,B){if(this.timer){clearTimeout(this.timer);this.timer=0}if(this.overlaySelects&&this.supportsOverlay){if(this.ovTimer){clearTimeout(this.ovTimer);this.ovTimer=0}this.ovTimer=setTimeout("RollTip.toggleOverlay("+1+")",10)}this.tip=document.getElementById(this.ID);this.writeTip("");this.writeTip(E);viewport.getAll();this.w=this.tip.offsetWidth;this.h=this.tip.offsetHeight;this.startTime=(new Date()).getTime();this.positionTip(C);if(this.tip){if(D){this.tip.style.backgroundColor=D}if(A){this.tip.style.width=A}if(B){this.tip.style.textAlign=B}}if(this.followMouse){dw_event.add(document,"mousemove",this.trackMouse,true)}this.timer=setInterval("RollTip.rollOut()",10)},rollOut:function(){var A=(new Date()).getTime()-this.startTime;if(Aviewport.width+viewport.scrollX){A=A-this.tip.offsetWidth-this.offX}else{A=A+this.offX}if(C+this.tip.offsetHeight+this.offY>viewport.height+viewport.scrollY){C=C-this.tip.offsetHeight-this.offY;if(C