var currentMaxLine=0;function CompareCheckChanged(a,b){if(a.checked==true){IncrementValue(document.forms[0].txtSelectedPlansCount);AddPlanId(document.forms[0].txtSelectedPlans,b)}else{DecrementValue(document.forms[0].txtSelectedPlansCount);DeletePlanId(document.forms[0].txtSelectedPlans,b)}}function AddPlanId(b,a){b.value+=a+","}function DeletePlanId(b,a){b.value=b.value.replace(a+",")}function IncrementValue(b){var a=parseInt(b.value);a+=1;b.value=a}function DecrementValue(b){var a=parseInt(b.value);a-=1;if(a<0){a=0}b.value=a}function ValidateCompare(){var a=parseInt(document.forms[0].txtSelectedPlansCount.value);if(a>1){return true}else{alert("Please select more than one plan to compare.");return false}}function CreateFilterCrieteria(d,a){var b=document.getElementById("hdnCurrentFilter").value;if(d.checked){if(b==""){document.getElementById("hdnCurrentFilter").value=a}else{b+=a;document.getElementById("hdnCurrentFilter").value=b}}else{var c=RegExp(a,"i");document.getElementById("hdnCurrentFilter").value=document.getElementById("hdnCurrentFilter").value.replace(c,"")}return true}function setHeight(){var k=document.getElementById("hdnRecommendedDivIds").value;var a=[];var h=0;var d;var g=[];var e;if(k!=null){a=k.split(";");if(a!=null&&a!=""){for(d=0;d<a.length-1;d++){var c=a[d];if(parseInt(document.getElementById(c).offsetHeight)>parseInt(h)){h=parseInt(document.getElementById(c).offsetHeight)}}h=maxValue(g);if(h){if(navigator.appName=="Microsoft Internet Explorer"){var f;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){f=new Number(RegExp.$1)}if(parseInt(f)<7){h=parseInt(h)+1}else{h=parseInt(h)+61}}else{h=parseInt(h)+55}i=0;var b=a.length;for(i=0;i<b-1;){if(i!=b){var c=a[i];document.getElementById(c).style.height=h+"px"}i=i+1}maxHeight1=parseInt(h)+34;document.getElementById("tdDescription").style.height=maxHeight1+"px"}}}document.getElementById("hdnRecommendedDivIds").value=""}maxValue=function(a){mxm=a[0];for(i=0;i<a.length;i++){if(a[i]>mxm){mxm=a[i]}}return mxm};function clearCheckBoxesForAjax(){var b=document.getElementsByTagName("input");for(var a=0;a<b.length;a++){if(b[a].getAttribute("type")=="checkbox"){b[a].checked=0}}}function toggleMe(b,d){var c=document.getElementById(b);if(!c){return false}if(c.style.display=="none"){c.style.display="block";d.innerHTML='<img style="position:relative;top:3px;" src="/images/icons/arrowup.gif" /> collapse'}else{c.style.display="none";d.innerHTML='<img style="position:relative;top:3px;" src="/images/icons/arrow.gif" /> expand to learn'}if(window.event){window.event.cancelBubble=true}return false}function FlexPayMonthlyPopup(b,c){currentMaxLine=c;ValidateDeviceCheck();DisplayText();addToCart=b.href;document.getElementById("divProgressBar").style.display="none";var a=302+(32*parseInt(document.getElementById("hdnCurrPackageDeviceCount").value));openModalDiv("modalDivFlexPayConfirm","500",a,function(){});return false}var strCheckedDevice="";function ValidateDeviceCheck(){strCheckedDevice="";var a=document.getElementsByName("chbxDevice");for(var b=0;b<a.length;b++){if(b<currentMaxLine){a[b].checked=true;a[b].disabled=false;strCheckedDevice=strCheckedDevice+a[b].value+","}else{a[b].disabled=true;a[b].checked=false}}document.getElementById("spnAddToCart").style.display="";document.getElementById("spnInvAddToCart").style.display="none"}function CheckUncheckDevice(e){var a=document.getElementsByName("chbxDevice");var d=0;for(var c=0;c<a.length;c++){if(a[c].checked){d++}}if(e.checked){strCheckedDevice=strCheckedDevice+e.value+",";if(d>=currentMaxLine){for(var c=0;c<a.length;c++){if(a[c].checked==false){a[c].disabled=true}}}}else{strCheckedDevice=strCheckedDevice.replace(e.value+",","");for(var c=0;c<a.length;c++){a[c].disabled=false}}var b=currentMaxLine;if(currentMaxLine>1){b=2}if(d<b){document.getElementById("spnAddToCart").style.display="none";document.getElementById("spnInvAddToCart").style.display=""}else{document.getElementById("spnAddToCart").style.display="";document.getElementById("spnInvAddToCart").style.display="none"}}function DisplayText(){var a=document.getElementsByName("chbxDevice");if(a.length>1){if(currentMaxLine>1){if(a.length<currentMaxLine){document.getElementById("divFPayIndPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayPopDevInfoTxt").style.display="none";document.getElementById("divFPayPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayFamPopDevInfoTxt").style.visibility="visible";document.getElementById("divFPayFamPopDevInfoTxt").style.display="block";document.getElementById("divFPayIndPopDevInfoTxt").style.display="none";document.getElementById("divIndFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divIndFamPopDevInfoTxt").style.display="none"}else{document.getElementById("divFPayIndPopDevInfoTxt").style.display="none";document.getElementById("divFPayPopDevInfoTxt").style.display="block";document.getElementById("divFPayPopDevInfoTxt").style.visibility="visible";document.getElementById("divIndFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divIndFamPopDevInfoTxt").style.display="none";document.getElementById("divFPayFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayFamPopDevInfoTxt").style.display="none"}}else{document.getElementById("divFPayIndPopDevInfoTxt").style.visibility="visible";document.getElementById("divFPayIndPopDevInfoTxt").style.display="block";document.getElementById("divFPayPopDevInfoTxt").style.display="none";document.getElementById("divIndFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divIndFamPopDevInfoTxt").style.display="none";document.getElementById("divFPayFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayFamPopDevInfoTxt").style.display="none"}}else{document.getElementById("divFPayIndPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayPopDevInfoTxt").style.display="none";document.getElementById("divFPayIndPopDevInfoTxt").style.display="none";document.getElementById("divIndFamPopDevInfoTxt").style.visibility="visible";document.getElementById("divIndFamPopDevInfoTxt").style.display="block";document.getElementById("divFPayFamPopDevInfoTxt").style.visibility="hidden";document.getElementById("divFPayFamPopDevInfoTxt").style.display="none"}var c=currentMaxLine;if(currentMaxLine>1){c=2}if(a.length==c||a.length==1){for(var b=0;b<a.length;b++){var d="tdDeviceChk_"+b;document.getElementById(d).style.display="none"}}else{for(var b=0;b<a.length;b++){var d="tdDeviceChk_"+b;document.getElementById(d).style.display="block"}}}function Learn(){$(document).ready(function(){$("#body").pngFix();$(".learn").click(function(){$("#add-a-line-talk-light").css("display","block");$("#fade").css("display","block")})})}function OpenMBBLearnPopup(){this.showPackagesCss={padding:0,margin:0,top:"10%",left:"27%",textAlign:"left",color:"#000",border:"0px solid #aaa",backgroundColor:"",cursor:"auto",overflow:"auto",width:"auto"};this.showPackagesoverlayCSS={backgroundColor:"#000",opacity:"0.3",cursor:"default"};$.blockUI({message:$("#divMBBPopup").html(),css:this.showPackagesCss,overlayCSS:this.showPackagesoverlayCSS});var a="#Form1";var b=$(a);if(b!=null&&b.length>0){$("html,body").animate({scrollTop:b.offset().top},0)}$(".blockOverlay").click($.unblockUI)}function CloseLearnMBBPopup(){$.unblockUI();$(".blockUI").fadeOut("slow")}function close(){$(document).ready(function(){$("#body").pngFix();$(".close-lightbox").click(function(){$("#add-a-line-talk-light").css("display","none");$("#fade").css("display","none")})})};
