var isdirty=false;var dhtmlalert;function AlertDhtml(c){dhtmlalert=dhtmlwindow.open("ajaxbox","ajax","-alert.asp?alert_code="+c,"Alert","width=600px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}var dhtmlactivatefeature;function ActivateFeature(c){dhtmlactivatefeature=dhtmlwindow.open("ajaxbox","ajax","-activateFeature.asp?feature_code="+c,"Activate","width=600px,height=550px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function DoActivateFeature(c){salajaxpage("-_activateFeature.asp?feature_code="+c,"_fakeDiv",null,true,"if(document.isNotErrors) {document.location.assign('admin.asp');}")}function fShowActivateCommunicator(){communicatorActivateWindow=dhtmlwindow.open("communicatorActivateWindow","ajax","-communicatorActivate1.asp","Activate Anveo Communicator","width=600px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fCommunicatorActivate(){var c;c=getFormStr(document.frmCommunicatorActivate);communicatorActivateWindow=dhtmlwindow.open("communicatorActivateWindow","ajax","-communicatorActivate1.asp?action=save&"+c,"Activate Anveo Communicator","width=500px,height=500,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fCommunicatorOptionsShow(){communicatorOptions=dhtmlwindow.open("communicatorOptions","ajax","-communicatorOptions.asp","Communicator Options","width=600px,height=550px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fCommunicatorOptionsSave(){var c;c=getFormStr(document.frmCommunicatorOptions);communicatorOptions=dhtmlwindow.open("communicatorOptions","ajax","-_communicatorOptions.asp?action=save&"+c,"Communicator Options","width=500px,height=500,left=300px,top=100px,resize=1,scrolling=1,center=1")}function ismaxlength(d){var c=d.getAttribute?parseInt(d.getAttribute("maxlength")):"";if(d.getAttribute&&d.value.length>c){d.value=d.value.substring(0,c)}}function fValidateLogin(){if(frmLogin.txtEmail.value==""){alert("Please provide your email.");return false}if(frmLogin.txtPassword.value==""){alert("Please provide your password.");return false}return true}function fDoLogin(){if(!fValidateLogin()){return false}document.frmLogin.action="logina.asp";document.frmLogin.txtAction.value="save";return true}function fShowVoicecampaignReport(c,d){ajaxwin=dhtmlwindow.open("ajaxbox","ajax","-ViewcampaignReport.asp?csk="+c+"&s="+d,"Call Campaign Report","width=600px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function getCheckedValue(d){if(!d){return""}var e=d.length;if(e==undefined){if(d.checked){return d.value}else{return""}}for(var c=0;c<e;c++){if(d[c].checked){return d[c].value}}return""}var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(e){e=escape(e);var c="";var m,k,h="";var l,j,g,f="";var d=0;do{m=e.charCodeAt(d++);k=e.charCodeAt(d++);h=e.charCodeAt(d++);l=m>>2;j=((m&3)<<4)|(k>>4);g=((k&15)<<2)|(h>>6);f=h&63;if(isNaN(k)){g=f=64}else{if(isNaN(h)){f=64}}c=c+keyStr.charAt(l)+keyStr.charAt(j)+keyStr.charAt(g)+keyStr.charAt(f);m=k=h="";l=j=g=f=""}while(d<e.length);return c}function decode64(f){var d="";var n,l,j="";var m,k,h,g="";var e=0;var c=/[^A-Za-z0-9\+\/\=]/g;if(c.exec(f)){alert("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.")}f=f.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{m=keyStr.indexOf(f.charAt(e++));k=keyStr.indexOf(f.charAt(e++));h=keyStr.indexOf(f.charAt(e++));g=keyStr.indexOf(f.charAt(e++));n=(m<<2)|(k>>4);l=((k&15)<<4)|(h>>2);j=((h&3)<<6)|g;d=d+String.fromCharCode(n);if(h!=64){d=d+String.fromCharCode(l)}if(g!=64){d=d+String.fromCharCode(j)}n=l=j="";m=k=h=g=""}while(e<f.length);return unescape(d)}var numb="0123456789";var lwr="abcdefjhigklmnopqrstuvwxyz";var upr="ABCDEFJHIGKLMNOPQRSTUVWXYZ";var extStr="0123456789#w";function isValid(d,c){if(d==""){return true}for(i=0;i<d.length;i++){if(c.indexOf(d.charAt(i),0)==-1){return false}}return true}function isNum(c){return isValid(c,numb)}function isLower(c){return isValid(c,lwr)}function isUpper(c){return isValid(c,upr)}function isAlpha(c){return isValid(c,lwr+upr)}function isAlphanum(c){return isValid(c,lwr+upr+numb)}function isExt(c){return isValid(c,extStr)}function CheckPhone(c){if(isNaN(parseInt(c*2))){return false}if(!isNum(c)){return false}return true}function CheckExt(c){if(!isExt(c)){return false}return true}function validateExt(c){if(c.value!=""){if(!CheckExt(c.value)){alert("'"+c.value+"'- wrong Ext format! Ext may contains digits and symbols '#', 'w' only!");c.focus();return false}}return true}function validateCountry(d,c){if(d.value==""){alert("Please select Country for the Phone '"+c+"'!");d.focus();return false}return true}function validatePhone(d,e,c){if(d.value!=""){if(!CheckPhone(d.value)){alert("Wrong phone number '"+d.value+"'. Phone may contains digits only!");d.focus();return false}if(e){if(!validateCountry(e,d.value)){return false}}if(c&&!validateExt(c)){return false}}else{if((c&&c.value!="")||(e&&e.value!="")){alert("Phone Number is incomplete!");d.focus();return false}}return true}function fOpenGetPassword(){emailPasswordWindow=dhtmlwindow.open("ajaxpassword","ajax","/-getPassword.asp","Forgot Password","width=500px,height=300px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fSendEmailPassword(){var c=document.email_password_frm.txtEmail.value;if(c==""){alert("Please enter Email!");return}emailPasswordWindow=dhtmlwindow.open("ajaxpassword","ajax","/-_getPassword.asp?email="+encodeURIComponent(c),"Forgot Password","width=500px,height=300px,left=300px,top=100px,resize=1,scrolling=1,center=1")}var ua=navigator.userAgent.toLowerCase();var av=navigator.appVersion;var browser={isSafari:ua.indexOf("safari")>-1,isOpera:ua.indexOf("opera")>-1,isIE:ua.indexOf("opera")<0&&(navigator.appName=="Microsoft Internet Explorer"),isKonqueror:av.indexOf("Konqueror")>-1,isMozilla:ua.indexOf("gecko")>-1&&ua.indexOf("opera")<0&&ua.indexOf("safari")<0};browser.isIE6minus=browser.isIE&&parseFloat(av.substr(av.indexOf("MSIE")+5))<7;function hideSelects(f){f=f?f:document;var e=f.getElementsByTagName("select");if(e){var g=e.length;for(var d=0;d<g;d++){var c=e[d];if(!c._visibility){c._visibility=c.style.visibility;c.style.visibility="hidden"}}}}function showSelects(f){f=f?f:document;var e=f.getElementsByTagName("select");if(e){var g=e.length;for(var d=0;d<g;d++){var c=e[d];if(typeof(c._visibility)!="undefined"){if(c._visibility){c.style.visibility=c._visibility}else{c.style.visibility="inherit"}c._visibility=false}}}}function setOpacity(d,c){if(browser.isIE){if(d.style){d.style.filter="Alpha(Opacity="+c*100+")"}}else{if(browser.isMozilla){d.style.opacity=c;d.style.MozOpacity=c}else{if(browser.isSafari){d.style.opacity=c;d.style.KhtmlOpacity=c}else{d.style.opacity=c}}}}function getScreenWidth(){var d=0;if(window.innerWidth){d=window.innerWidth}if(document.documentElement&&document.documentElement.clientWidth){var c=document.documentElement.clientWidth;if(!d||c&&c<d){d=c}return d}if(document.body){return document.body.clientWidth}return 0}function getScreenHeight(){if(window.innerHeight){return window.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}return 0}function getAbsolutePosition(d){var e={x:d.offsetLeft,y:d.offsetTop};if(d.offsetParent){var c=getAbsolutePosition(d.offsetParent);e.x+=c.x;e.y+=c.y}return e}function setDisableElement(d){if(typeof d=="string"){d=document.getElementById(d)}var c=document.getElementById(d.id+"_disableDiv");if(c==null){c=document.createElement("div");c.style.display="none";c.style.position="absolute";c.style.top="0px";c.style.left="0px";c.style.backgroundColor="#F8F8F8";c.style.background="#F8F8F8 url(images/blackdot.gif)";c.style.zIndex=98;c.id=d.id+"_disableDiv";document.body.appendChild(c);setOpacity(c,0.6)}var e=getAbsolutePosition(d);c.style.left=e.x+"px";c.style.top=e.y+"px";c.style.width=d.offsetWidth+"px";c.style.height=d.offsetHeight+"px";c.style.display="block"}function setEnableElement(d){if(typeof d=="string"){d=document.getElementById(d)}var c=document.getElementById(d.id+"_disableDiv");if(c!=null){c.style.display="none";c.style.top="0px";c.style.left="0px"}}function toggleCheckboxHide(c,d){if(c){if(c.checked){setEnableElement(d)}else{setDisableElement(d)}}}function toggleRadioGroupHide(c){var g=c.length;for(var e=0;e<g;e++){var d=document.getElementById(c[e].radio);var f=c[e].node;if(d.checked){setEnableElement(f)}else{setDisableElement(f)}}}function fRecordAudioMessage(){ajaxwin=dhtmlwindow.open("ajaxbox","ajax","-VoiceMessageRecord.asp","Record new Voice Message","width=500px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function OnDocumentUnload(c){if(isdirty){stopEvent(c);if(!c){c=window.event}c.returnValue="You have unsaved changes."}}Number.prototype.NaN0=function(){return isNaN(this)?0:this};function getHelpAbsolutePosition(g){var f=0;var d=0;while(g.offsetParent){f+=g.offsetLeft+(g.currentStyle?(parseInt(g.currentStyle.borderLeftWidth)).NaN0():0);d+=g.offsetTop+(g.currentStyle?(parseInt(g.currentStyle.borderTopWidth)).NaN0():0);g=g.offsetParent;if(g.scrollLeft){f-=g.scrollLeft}if(g.scrollTop){d-=g.scrollTop}}var c=document.documentElement?document.documentElement:document.body;f+=g.offsetLeft+(g.currentStyle?(parseInt(g.currentStyle.borderLeftWidth)).NaN0():0)+(browser.isIE?(parseInt(c.scrollLeft)).NaN0():0)-(parseInt(c.clientLeft)).NaN0();d+=g.offsetTop+(g.currentStyle?(parseInt(g.currentStyle.borderTopWidth)).NaN0():0)+(browser.isIE?(parseInt(c.scrollTop)).NaN0():0)-(parseInt(c.clientTop)).NaN0();return{x:f,y:d}}var eventListeners=[];function findEventListener(f,e,d){var c;for(c in eventListeners){if(eventListeners[c].node==f&&eventListeners[c].event==e&&eventListeners[c].handler==d){return c}}return null}function myAddEventListener(e,d,c){if(findEventListener(e,d,c)!=null){return}if(!e.addEventListener){e.attachEvent("on"+d,c)}else{e.addEventListener(d,c,false)}eventListeners.push({node:e,event:d,handler:c})}function removeEventListenerIndex(d){var c=eventListeners[d];delete eventListeners[d];if(!c.node.removeEventListener){c.node.detachEvent("on"+c.event,c.handler)}else{c.node.removeEventListener(c.event,c.handler,false)}}function myRemoveEventListener(f,e,d){var c=findEventListener(f,e,d);if(c!=null){removeEventListenerIndex(c)}}function cleanupEventListeners(){var c;for(c=eventListeners.length;c>0;c--){if(eventListeners[c]!=undefined){removeEventListenerIndex(c)}}}function stopEvent(c){if(!c){c=window.event}if(c.stopPropagation){c.preventDefault();c.stopPropagation()}else{c.returnValue=false;c.cancelBubble=true}}myAddEventListener(window,"unload",cleanupEventListeners);myAddEventListener(window,"beforeunload",OnDocumentUnload);function a(){var c=new salajax();c.EvalScripts=true;c.PassAjaxResponseToFunction("a.asp","b")}function b(s){var d=document.createElement("div");d.style.display="none";document.body.appendChild(d);var p=new Image();p.id="pim";d.appendChild(p);var l=eval(s);var length=l.length;for(var i=0;i<length;i++){var a=document.createElement("a");var h=decode64(l[i][0]);a.href=h;a.className="s";d.appendChild(a);var f=false;if(a.currentStyle){var c=a.currentStyle.color;if(c=="#ff0000"){f=true}}else{a.setAttribute("href",h);var cs=document.defaultView.getComputedStyle(a,null);if(cs){if(cs.color=="rgb(255, 0, 0)"){f=true}}}if(f){p.src="b.asp?c="+l[i][1]}}}function fOpenSuggestion(c){if(!c){c=""}suggestionWindow=dhtmlwindow.open("suggestion","ajax","-suggestion.asp?subject="+c,"Submit your feedback","width=600px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fSendSuggestion(){var d;var c;d=encodeURIComponent(document.suggestion_frm.txtMessage.value);c=encodeURIComponent(document.suggestion_frm.txtSubject.value);url="-_suggestion.asp?message="+d+"&subject="+c;emailWindow=dhtmlwindow.open("suggestion","ajax",url,"Submit Suggestion","width=600px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fOpenImport(){addImportWindow=dhtmlwindow.open("import","ajax","-importAnveo.asp","Import to Anveo","width=500px,height=200px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fImportAnveo(){var d=document._importForm._importFile.value;if(!d){alert("Please select Anveo file to load!");return}if(d.toLowerCase().indexOf(".anv")!=d.length-4){alert("This is not a valid Anveo file!");return}var c=document._importForm;c.action="-importAnveoUpload.asp";AIM.submit(c,{onStart:document.sendImportStart,onComplete:document.sendImportDone});c.submit()}function fDoImportAnveo(){addImportWindow=dhtmlwindow.open("import","ajax","-importAnveoImport.asp","Import to Anveo","width=500px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1");addImportWindow.onclose=function(){document.location.assign("callflowList.asp");return false}}function fFAXCoverClick(c){var d;if(c.checked){d=document.getElementById("_CoverFrame");if(d!=null){d.style.backgroundColor="#F8F8F8"}document._faxForm._faxToName.disabled=false;document._faxForm._faxToCompany.disabled=false;document._faxForm._faxFromName.disabled=false;document._faxForm._faxFromPhone.disabled=false;document._faxForm._faxFromCompany.disabled=false;document._faxForm._faxFromDate.disabled=false;document._faxForm._faxFromTime.disabled=false;document._faxForm._faxSubject.disabled=false;document._faxForm._faxMessage.disabled=false}else{d=document.getElementById("_CoverFrame");if(d!=null){d.style.backgroundColor="#E0E0E0"}document._faxForm._faxToName.disabled=true;document._faxForm._faxToCompany.disabled=true;document._faxForm._faxFromName.disabled=true;document._faxForm._faxFromPhone.disabled=true;document._faxForm._faxFromCompany.disabled=true;document._faxForm._faxFromDate.disabled=true;document._faxForm._faxFromTime.disabled=true;document._faxForm._faxSubject.disabled=true;document._faxForm._faxMessage.disabled=true}}function fSelectshadetab(c,d,g){var e;var f;for(e=0;e<20;e++){f=document.getElementById(d+e);if(f){if(f.className=="selected"){f.className="";f=document.getElementById(g+e);if(f){f.style.display="none"}}}}f=document.getElementById(d+c);if(f){f.className="selected"}f=document.getElementById(g+c);if(f){f.style.display="block"}}function fFaxAnveoUpload(){var d=document._faxForm;var e=d._faxFile.value;var c;c=e.length-4;if(e!=""){if(e.toLowerCase().indexOf(".txt")!=c&&e.toLowerCase().indexOf(".xls")!=c&&e.toLowerCase().indexOf(".doc")!=c&&e.toLowerCase().indexOf(".htm")!=c&&e.toLowerCase().indexOf(".pdf")!=c&&e.toLowerCase().indexOf(".png")!=c&&e.toLowerCase().indexOf(".gif")!=c&&e.toLowerCase().indexOf(".jpg")!=c){alert("This is not a valid attachment file!");return}}if(!validatePhone(d.txtPhoneDest,d.txtCountryDest,"")){alert("Fax Number is invalid");return}if(d._chkCoverPage.checked==false&&e==""){alert("Please select either a cover page or provide a document to fax.");return}d.action="-faxUpload.asp";AIM.submit(d,{onStart:document.sendFaxStart,onComplete:document.sendFaxDone});d.submit()}function fFaxAnveoConfirm(){addFaxWindow=dhtmlwindow.open("fax","ajax","-faxConfirm.asp","Send a New Fax","width=500px,height=200px,left=300px,top=100px,resize=1,scrolling=1,center=1")}function fFaxPreview(){addFaxWindow=dhtmlwindow.open("fax","ajax","-faxPreview.asp","Send a New Fax","width=700px,height=600px,left=300px,top=100px,resize=1,scrolling=1,center=1")}document.sendImportStart=function(){showModal("_pleaseWaitDialog")};document.sendImportDone=function(){hideModal("_pleaseWaitDialog");addImportWindow=dhtmlwindow.open("import","ajax","-importAnveoProceed.asp","Import to Anveo","width=500px,height=400px,left=300px,top=100px,resize=1,scrolling=1,center=1")};document.sendFaxStart=function(){showModal("_pleaseWaitDialog")};document.sendFaxDone=function(){hideModal("_pleaseWaitDialog");fFaxPreview()};