$(document).ready(function(){$("#planFinder").css({border:"1px solid #cccccc",cursor:"default"}).empty().append('<div id="finderBreadcrumbs" style="padding: 5px; background: #ddd; font-weight: bold;"></div><div id="finderMenuBar" style="padding: 5px; background: #eee;"></div><div id="finderContent" style="padding: 5px;"></div><div id="finderHidden" style="display: none;"></div>');setInterval("checkAnchor()",250)});var execMilliSec=600,currentAnchor=null,firstTime=true;
function checkAnchor(){if(currentAnchor!=document.location.hash){currentAnchor=document.location.hash;switch(currentAnchor.substring(1)){case "internet-mobiledata":loadMobileData();break;case "phone-fixedline":loadFixedline();break;case "phone-voip":loadVoip();break;case "phone-mobilegateway":loadMobileGateway();break;case "phone-prepaidmobile":loadPrepaidMobile();break;case "phone-postpaidmobile":loadPostpaidMobile();break;case "home":loadHome();break;default:if(firstTime){setHash("home");loadHome();
firstTime=false}}}}
function loadHome(){$("#finderHidden").empty();$("#finderBreadcrumbs").empty().text("Home");$("#finderMenuBar").empty().html("<button disabled=true>Welcome to Plan Finder</button>");$("#finderContent").empty().append('<h3>Hi there! <span style="font-weight: normal !important;">To get started, pick a table:</span></h3><div class="blueHeaderBG" style="padding: 5px; margin: 5px 0; color: #fff;">Please do note that providers are increasingly bundling both Phone and Internet services into packages. Please view the <b>"Phone and Internet"</b> table to find these plans.</div><table style="width: 100%;"><tr><td style="vertical-align: top; width: 50%; padding: 10px; background: #ddd;"><h3>Pick a plan comparison table which is available on Plan Finder now:</h3><ul id="homeMenu"><li><b>Standalone Internet plans:</b><ul class="homeMenuHoverHighlight"><li id="adslbroadband" style="cursor: pointer;"><a href="Plan_Finder_for_ADSL_Broadband" style="text-decoration: none; color: #000 !important;">ADSL Broadband</a></li><li id="mobiledata" style="cursor: pointer; margin-top: 15px;">Mobile Data</li></ul></li><li><b>Standalone Phone plans:</b><ul class="homeMenuHoverHighlight"><li id="fixedline" style="cursor: pointer;">Fixed Line Telephone</li><li id="voip" style="cursor: pointer;">Voice over Internet Protocol (VoIP)</li><li id="mobilegateway" style="cursor: pointer;">Mobile Gateway Telephony</li><li id="prepaidmobile" style="cursor: pointer; margin-top: 15px;">Prepaid Mobile</li><li id="postpaidmobile" style="cursor: pointer;">Postpaid Mobile</li></ul></li></ul></td><td style="vertical-align: top; width: 50%; padding: 10px; background: #ccc"><h3>... or one still slowly packing their things at their old pages:</h3><ul id="homeMenu"><li><b>Phone and Internet packages:</b><ul><li><a href="Internet_Plan_and_Pricing_Comparisons:_Phone_and_Internet_Packages">Phone and Internet</a></li></ul></li><li><b>Standalone Internet plans:</b><ul><li><a href="Internet_Plan_and_Pricing_Comparisons:_Naked_DSL_plans">Naked DSL</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_Dial-up_plans">Dial-up</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_Wireless_plans">Wireless</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_Wi-Fi_plans">Wi-Fi</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_Cable_plans">Cable</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_Fibre_Optic_plans">Fibre Optic</a></li><li><a href="Internet_Plan_and_Pricing_Comparisons:_BlackBerry_plans">BlackBerry Internet Service</a></li></ul></li></ul><br/><br/><i>We\'re working really hard to get these plan comparison tables moved in to their new homes here on this page - you\'ll see them here soon!</i></td></tr><tr><td colspan="2"><br/><div class="greenHeaderBG" style="padding: 5px; margin: 5px 0; color: #fff;">Do you have any issues, queries or suggestions with Plan Finder? Tell us on <a style="color: #fff; text-decoration: underline;" href="Main_Page#tab4">our forum</a></div></td></tr></table>');$("#homeMenu #mobiledata").click(function(){setHash("internet-mobiledata")});
$("#homeMenu #fixedline").click(function(){setHash("phone-fixedline")});$("#homeMenu #voip").click(function(){setHash("phone-voip")});$("#homeMenu #mobilegateway").click(function(){setHash("phone-mobilegateway")});$("#homeMenu #prepaidmobile").click(function(){setHash("phone-prepaidmobile")});$("#homeMenu #postpaidmobile").click(function(){setHash("phone-postpaidmobile")})}function setHash(a){document.location.hash="#"+a}
function stripDollarSign(a){re=/^\$|,/g;return a!=undefined?a.replace(re,""):a}function zeroPad(a,e){for(a=a+"";a.length<e;)a="0"+a;return a}function setMenuBar(a){$("#finderBreadcrumbs").empty().append("Home > "+a);$("#finderMenuBar").empty().html("<button disabled='true'>Loading...</button>");$("#finderContent").empty().append('<img src="http://www.nzconnection.net/images/d/de/Ajax-loader.gif" />&nbsp;&nbsp;&nbsp;<b>Please wait...</b>')}
function tableHeading(a,e){return"<th class="+e+">"+a+"</th>"}
function checkAJAXLoaded(a){if($("#finderHidden").is(":empty")){setHash("home");$("#finderHidden").append('<div id="errordialog" title="Loading '+a+' table failed"><p>The table for "'+a+'" could not be loaded.<br/><br/>Please try again, or come back at a later time.</p></div>');$("#errordialog").dialog({bgiframe:true,width:400,height:120,modal:true,draggable:false,resizable:false,buttons:{OK:function(){$(this).dialog("close");$("#errordialog").remove()}}})}}
function editUnitEquals1(a,e,g,h){parseFloat(a)==1?$(e).text(g):$(e).text(h)}function editUnitLessThan1(a,e,g,h){parseFloat(a)<1?$(e).text(g):$(e).text(h)}
var filterSortHeadingPTag1='<p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding: 4px; text-align: center;">',filterSortHeadingPTag2='<p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding: 4px; text-align: center; margin-bottom: 15px;">',sortOrderTableTag1='<table id="sortOrder" class="ui-corner-all" style="background: #cccccc; width: 100%; border-collapse: collapse: border: 0; padding: 0; margin: 0; cursor: pointer;"><tr><td id="sortAZ" class="ui-corner-all ui-state-default" style="padding: 3px; text-align: center; margin: 1px; width: 50%;">A &#8594; Z</td><td id="sortZA" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 50%;">Z &#8594; A</td></tr></table>',planInfoBarDivTag1=
'<div id="planInfoBar" style="display: none;"><button id="returnToTable">Return to Table</button></div>',innerContentWelcomeWithSortFilterDivTag1='<div id="innerContent">Click on any row to view plan details.<br/><br/>To sort or filter results, click "Sort/Filters".<div style="height: 1px; background: #ccc; margin: 10px 0;"></div></div><div id="planInfoContent" style="display: none;"></div>',innerContentWelcomeWithoutSortFilterDivTag1='<div id="innerContent">Click on any row to view plan details.<br/><br/><br/><div style="height: 1px; background: #ccc; margin: 10px 0;"></div></div><div id="planInfoContent" style="display: none;"></div>',
onnetInfo1='On-net represents all mobiles connected to the provider\'s own network:<ul><li><b>2degrees network</b>: <a href="2degrees">2degrees</a></li><li><b>Telecom network</b>: <a href="Telecom New Zealand">Telecom New Zealand</a>, <a href="TelstraClear">TelstraClear</a></li><li><b>Vodafone network</b>: <a href="Vodafone New Zealand">Vodafone New Zealand</a>, <a href="Black and White">Black + White</a>, <a href="Compass Communications">Compass Communications</a>, <a href="Orcon">Orcon</a>, <a href="Slingshot">Slingshot</a></li></ul>',
indicatorsDisclaimer1="Any indicators or information given in this table are intended only as a guide to plans listed in this table.<br/>See plan details for more information.<br/><br/>Visual indicators may be calculated relative to the list of plans in this table.",noGuarantee1="There is no guarantee content on this page is accurate.<br/>Always check plan details with the provider.";
function returnTableInfo(){return"This table contains "+(countNo-1)+" items and was last edited: "+$("#finderHidden #lastModified").text()+".</div>"}
function openPlanDetail(){lastScrollPosition=$(window).scrollTop();pfOffset=$("#planFinder").offset().top-12;filterBarActive=$("#filterBar").is(":visible");if(lastScrollPosition>pfOffset)$("html, body").animate({scrollTop:pfOffset},execMilliSec);else lastScrollPosition=-1;$("#filterBar").slideUp(execMilliSec);$("#innerContent").slideUp(execMilliSec,function(){$("#finderMenuBar #menuBar").hide();$("#finderMenuBar #planInfoBar").show();$("#planInfoContent").slideDown(execMilliSec)})}
function closePlanDetail(){$("#planInfoContent").slideUp(execMilliSec,function(){$("#finderMenuBar #planInfoBar").hide();$("#finderMenuBar #menuBar").show();filterBarActive&&$("#filterBar").slideDown(execMilliSec);lastScrollPosition!=-1&&$("html, body").animate({scrollTop:lastScrollPosition},execMilliSec);$("#innerContent").slideDown(execMilliSec)})}function bindClosePlanDetail(){$("#returnToTable").unbind().click(closePlanDetail)}$("#returnToHome").live("click",function(){setHash("home")});
function loadMobileData(){setMenuBar("Mobile Data");$("#finderHidden").empty().load("Plan_Finder_-_Internet_-_Mobile_Data #content #bodyContent",function(){function a(){if(l!=$("#sortFilter").find(".ui-state-default").attr("id")||m!=$("#sortOrder").find(".ui-state-default").attr("id")){var i=[],b=0;l=$("#sortFilter").find(".ui-state-default").attr("id");m=$("#sortOrder").find(".ui-state-default").attr("id");switch(l){case "sortProvider":$("#finderContent .planRow").each(function(){i[b]=$.trim($(this).children(".provider").text())+
"_"+zeroPad(b,3)+"_"+$(this).attr("rownumber");b++});break;case "sortPrice":$("#finderContent .planRow").each(function(){i[b]=zeroPad($(this).attr("fee"),7)+"_"+zeroPad(b,3)+"_"+$(this).attr("rownumber");b++});break;case "sortData":$("#finderContent .planRow").each(function(){i[b]=zeroPad($(this).attr("usageGB")*1024,8)+"_"+zeroPad(b,3)+"_"+$(this).attr("rownumber");b++});break;case "sortOverage":$("#finderContent .planRow").each(function(){i[b]=zeroPad($(this).attr("overageGB")*100,8)+"_"+zeroPad(b,
3)+"_"+$(this).attr("rownumber");b++});break;case "sortTerm":$("#finderContent .planRow").each(function(){i[b]=zeroPad($(this).attr("termmonths")+1,3)+"_"+zeroPad(b,3)+"_"+$(this).attr("rownumber");b++});break}i.sort();m=="sortZA"&&i.reverse();$.each(i,function(j){$("#finderContent .planTable tr[rownumber="+this.substr(this.length-3)+"]").insertAfter("#finderContent .planTable tr:eq("+j+")")})}if(e!=$("#monthlyfee").slider("values",0)||g!=$("#monthlyfee").slider("values",1)||h!=$("#usage").slider("values",
0)||k!=$("#usage").slider("values",1)||f!=$("#term").slider("values",0)||d!=$("#term").slider("values",1)){e=$("#monthlyfee").slider("values",0);g=$("#monthlyfee").slider("values",1);h=$("#usage").slider("values",0);k=$("#usage").slider("values",1);f=$("#term").slider("values",0);d=$("#term").slider("values",1);$(".planRow").each(function(){termValue=parseFloat($(this).attr("termmonths"))==-1?0:parseFloat($(this).attr("termmonths"));parseFloat($(this).attr("fee"))<e||parseFloat($(this).attr("fee"))>
g||parseFloat($(this).attr("usageGB"))<h||parseFloat($(this).attr("usageGB"))>k||termValue<f||termValue>d?$(this).hide():$(this).show()})}}checkAJAXLoaded("Mobile Data");if(document.location.hash!="#internet-mobiledata")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button><span style="float: right;"><button id="toggleSortAndFilters">Sort/Filters</button></span><div id="filterBar" style="display: none; padding: 10px;"><div style="color: #888; font-size: 0.9em; text-align: center;">You can change the slider bar values by dragging the handles or by clicking the handles and using the arrow keys on your keyboard.</div><table style="width: 100%; background: none;"><tr><td style="width: 33.3%; padding: 10px;">'+
filterSortHeadingPTag1+'Monthly fee:<br/>$<span id="monthlyfeevalue1"></span>&nbsp;-&nbsp;$<span id="monthlyfeevalue2"></span></p><div class="slider" id="monthlyfee"></div></td><td style="width: 33.3%; padding: 10px;">'+filterSortHeadingPTag1+'Data allowance:<br/><span id="usagevalue1"></span>&nbsp;<span id="usageunit1"></span>&nbsp;-&nbsp;<span id="usagevalue2"></span>&nbsp;<span id="usageunit2"></span></p><div class="slider" id="usage"></div></td><td style="width: 33.3%; padding: 10px;">'+filterSortHeadingPTag1+
'Minimum contract term:<br/><span id="termvalue1"></span>&nbsp;<span id="termunit1"></span>&nbsp;-&nbsp;<span id="termvalue2"></span>&nbsp;<span id="termunit2"></span></p><div class="slider" id="term"></div></td></tr><tr><td colspan="2" style="padding: 10px;">'+filterSortHeadingPTag1+'Sort<br/>by</span></p><table id="sortFilter" class="ui-corner-all" style="background: #cccccc; width: 100%; border-collapse: collapse: border: 0; padding: 0; margin: 0; cursor: pointer;"><tr><td id="sortProvider" class="ui-corner-all ui-state-default" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Provider</td><td id="sortPrice" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Price</td><td id="sortData" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Data</td><td id="sortOverage" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Overage</td><td id="sortTerm" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Term</td></tr></table></td><td style="padding: 10px;">'+
filterSortHeadingPTag1+"Sort<br/>order</span></p>"+sortOrderTableTag1+"</td></tr></table></div></div>"+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("Price","price")+tableHeading("Data","data")+tableHeading("Overage","overage")+tableHeading("Term",
"term")+"</tr></table>");countNo=1;maxMonthlyFeeValue=0;minMonthlyFeeValue=undefined;maxUsageGBValue=0;minUsageGBValue=undefined;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan={};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim($(this).children(".plan.name").text());
plan.cost=parseFloat(stripDollarSign($.trim($(this).children(".plan.cost").text()))).toFixed(2);if(zeroPad(plan.cost,7)>zeroPad(maxMonthlyFeeValue,7))maxMonthlyFeeValue=plan.cost;if(minMonthlyFeeValue==undefined||plan.cost<minMonthlyFeeValue)minMonthlyFeeValue=plan.cost;plan.data={};plan.data.value={};plan.data.value.raw=$.trim($(this).children(".data").text());plan.data.unit=plan.data.value.raw.substr(plan.data.value.raw.length-2).toUpperCase();switch(plan.data.unit){case "GB":plan.data.numberGB=
parseFloat(plan.data.value.raw.substring(0,plan.data.value.raw.length-2));plan.data.number=plan.data.numberGB;break;case "MB":plan.data.numberGB=parseFloat(plan.data.value.raw.substring(0,plan.data.value.raw.length-2))/1024;plan.data.number=plan.data.numberGB*1024;break;default:alert("An error has occured.\nIf you have recently edited the data table, please check data input.\n\nPlease notify NZ Connections to rectify this issue if it persists.")}if(plan.data.numberGB>maxUsageGBValue)maxUsageGBValue=
plan.data.numberGB;if(minUsageGBValue==undefined||plan.data.numberGB<minUsageGBValue)minUsageGBValue=plan.data.numberGB;plan.excess={};plan.excess.overageraw=$.trim($(this).children(".overage").text());plan.excess.overagecost=parseFloat(stripDollarSign(plan.excess.overageraw.split("/")[0])).toFixed(2);plan.excess.overageunit=$.trim(plan.excess.overageraw.split("/")[1]).substr($.trim(plan.excess.overageraw.split("/")[1]).length-2).toUpperCase();plan.excess.overageunitnumber=$.trim(plan.excess.overageraw.split("/")[1]).substring(0,
$.trim(plan.excess.overageraw.split("/")[1]).length-2);if(plan.excess.overageunitnumber=="")plan.excess.overageunitnumber=1;if(plan.excess.overageunit!=""){switch(plan.excess.overageunit){case "GB":plan.excess.overagecostGB=(plan.excess.overagecost/parseFloat(plan.excess.overageunitnumber)).toFixed(2);break;case "MB":plan.excess.overagecostGB=(plan.excess.overagecost/parseFloat(plan.excess.overageunitnumber)*1024).toFixed(2);break;default:alert("An error has occured.\nIf you have recently edited the data table, please check data input.\n\nPlease notify NZ Connections to rectify this issue, if it persists.")}overageActive=
true}else{plan.excess.overagecostGB=(0).toFixed(2);overageActive=false}plan.term={};plan.term.raw=$.trim($(this).children(".term").text());if(plan.term.raw=="Prepaid"){plan.term.monthvalue="-1";plan.term.value="Prepaid"}else{plan.term.monthvalue=$.trim(plan.term.raw.replace(/months|month/gi,""));plan.term.value=plan.term.monthvalue}plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="price">$'+plan.cost+'</td><td class="data">'+
plan.data.number+plan.data.unit+'</td><td class="overage">';if(overageActive==true){if(plan.excess.overageunitnumber==1)plan.excess.overageunitnumber="";plan.rowHTML=plan.rowHTML+'<div style="background: #AA0000; color: #ffffff; padding: 0; font-weight: bold; border: 1px solid #000000; text-align: center;">$'+plan.excess.overagecost+"/"+plan.excess.overageunitnumber+plan.excess.overageunit+"</div>"}else plan.rowHTML+='<div style="background: #008000; color: #ffffff; padding: 0; font-weight: bold; border: 1px solid #000000; text-align: center;">N</div>';
plan.rowHTML+='</td><td class="term">';if(plan.term.value=="Prepaid")plan.rowHTML+="Prepaid";else{plan.rowHTML+=plan.term.value;plan.rowHTML+=plan.term.value=="1"?" month":" months"}plan.rowHTML+="</td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'" fee="'+plan.cost+'" usageGB="'+plan.data.numberGB+'" overageGB="'+plan.excess.overagecostGB+'" termMonths="'+plan.term.monthvalue+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});$(".planRow").each(function(){usageGBValue=
parseFloat($(this).attr("usagegb"));pcOverallGB=Math.round(usageGBValue/maxUsageGBValue*100);redValue=Math.round(170*(1-pcOverallGB*0.01));greenValue=Math.round(140*pcOverallGB*0.01);blueValue=0;$(this).children(".data").html('<div style="border: 1px solid #000; background-color: #000; position: relative;"><div style="background-color: rgb('+redValue+", "+greenValue+", "+blueValue+"); width: "+pcOverallGB+'%;">&nbsp;</div><div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center; color: #fff; font-weight: bold;">'+
$(this).children(".data").text()+"</div></div>")});$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+onnetInfo1+"<br/>"+indicatorsDisclaimer1+"<br/><br/>"+noGuarantee1+"<br/><br/>"+returnTableInfo());$("#monthlyfee").slider({range:true,value:Math.ceil(maxMonthlyFeeValue),min:Math.floor(minMonthlyFeeValue),max:Math.ceil(maxMonthlyFeeValue),values:[Math.floor(minMonthlyFeeValue),
Math.ceil(maxMonthlyFeeValue)],step:1,slide:function(i,b){$("#monthlyfeevalue1").text(b.values[0]);$("#monthlyfeevalue2").text(b.values[1]);a()},stop:function(i,b){$("#monthlyfeevalue1").text(b.values[0]);$("#monthlyfeevalue2").text(b.values[1]);a()}});$("#monthlyfeevalue1").text($("#monthlyfee").slider("values",0));$("#monthlyfeevalue2").text($("#monthlyfee").slider("values",1));$("#usage").slider({range:true,value:Math.floor(minUsageGBValue),min:Math.floor(minUsageGBValue),max:Math.ceil(maxUsageGBValue),
values:[Math.floor(minUsageGBValue),Math.ceil(maxUsageGBValue)],step:0.0625,slide:function(i,b){editUnitLessThan1(b.values[0],"#usagevalue1",b.values[0]*1024,Math.round(b.values[0]*100)/100);editUnitLessThan1(b.values[0],"#usageunit1","MB","GB");editUnitLessThan1(b.values[1],"#usagevalue2",b.values[1]*1024,Math.round(b.values[1]*100)/100);editUnitLessThan1(b.values[1],"#usageunit2","MB","GB");a()},stop:function(i,b){editUnitLessThan1(b.values[0],"#usagevalue1",b.values[0]*1024,Math.round(b.values[0]*
100)/100);editUnitLessThan1(b.values[0],"#usageunit1","MB","GB");editUnitLessThan1(b.values[1],"#usagevalue2",b.values[1]*1024,Math.round(b.values[1]*100)/100);editUnitLessThan1(b.values[1],"#usageunit2","MB","GB");a()}});editUnitLessThan1($("#usage").slider("values",0),"#usagevalue1",$("#usage").slider("values",0)*1024,Math.round($("#usage").slider("values",0)*100)/100);editUnitLessThan1($("#usage").slider("values",0),"#usageunit1","MB","GB");editUnitLessThan1($("#usage").slider("values",1),"#usagevalue2",
$("#usage").slider("values",1)*1024,Math.round($("#usage").slider("values",1)*100)/100);editUnitLessThan1($("#usage").slider("values",1),"#usageunit2","MB","GB");$("#term").slider({range:true,value:24,min:0,max:24,values:[0,24],step:1,slide:function(i,b){$("#termvalue1").text(b.values[0]);editUnitEquals1(b.values[0],"#termunit1","month","months");$("#termvalue2").text(b.values[1]);editUnitEquals1(b.values[1],"#termunit2","month","months");a()},stop:function(i,b){$("#termvalue1").text(b.values[0]);
editUnitEquals1(b.values[0],"#termunit1","month","months");$("#termvalue2").text(b.values[1]);editUnitEquals1(b.values[1],"#termunit2","month","months");a()}});$("#termvalue1").text($("#term").slider("values",0));editUnitEquals1($("#term").slider("values",0),"#termunit1","month","months");$("#termvalue2").text($("#term").slider("values",1));editUnitEquals1($("#term").slider("values",1),"#termunit2","month","months");$("#sortFilter td[id^=sort]").unbind().click(function(){$("#sortFilter td[id^=sort]").removeClass("ui-state-default");
$(this).addClass("ui-state-default");a()});$("#sortOrder td[id^=sort]").unbind().click(function(){$("#sortOrder td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});var e,g,h,k,f,d=-1,l,m="";a();$("#toggleSortAndFilters").unbind().click(function(){$("#filterBar").slideToggle(execMilliSec)});$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=
$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());plan.info=$.trim(rowRef.children(".info").html());plan.cost=stripDollarSign($.trim(rowRef.children(".plan.cost").text()));plan.data={};plan.data.value={};plan.data.value.raw=$.trim(rowRef.children(".data").text());
plan.data.unit=plan.data.value.raw.substr(plan.data.value.raw.length-2).toUpperCase();switch(plan.data.unit){case "GB":plan.data.numberGB=parseFloat(plan.data.value.raw.substring(0,plan.data.value.raw.length-2));plan.data.number=plan.data.numberGB;break;case "MB":plan.data.numberGB=parseFloat(plan.data.value.raw.substring(0,plan.data.value.raw.length-2))/1024;plan.data.number=plan.data.numberGB*1024;break}plan.excess={};plan.excess.overageraw=$.trim(rowRef.children(".overage").text());plan.excess.overagecost=
parseFloat(stripDollarSign(plan.excess.overageraw.split("/")[0])).toFixed(2);plan.excess.overageunit=$.trim(plan.excess.overageraw.split("/")[1]).substr($.trim(plan.excess.overageraw.split("/")[1]).length-2).toUpperCase();plan.excess.overageunitnumber=$.trim(plan.excess.overageraw.split("/")[1]).substring(0,$.trim(plan.excess.overageraw.split("/")[1]).length-2);if(plan.excess.overageunitnumber==1)plan.excess.overageunitnumber="";overageActive=plan.excess.overageunit!=""?true:false;plan.term={};plan.term.raw=
$.trim(rowRef.children(".term").text());plan.term.value=plan.term.raw=="Prepaid"?"Prepaid":$.trim(plan.term.raw.replace(/months|month/gi,""));planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Pricing</h2><ul><li><b>Monthly cost:</b> $'+plan.cost+'</li></ul><br/><h2 class="greyHeaderBG">Data allowances and charges</h2><ul><li><b>Monthly data allocation:</b> '+
plan.data.number+plan.data.unit+"</li><li><b>Overage:</b> $"+plan.excess.overagecost+"/"+plan.excess.overageunitnumber+plan.excess.overageunit+'</li></ul><br/><h2 class="greyHeaderBG">Contract term</h2>';if(plan.term.value=="Prepaid")planInfoTable+="Prepaid";else{planInfoTable+=plan.term.value;planInfoTable+=plan.term.value=="1"?" month":" months"}planInfoTable+="</td>";if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+
plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+
plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';planInfoTable=planInfoTable+'<a href="'+plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+
plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+onnetInfo1+"<br/>"+noGuarantee1+"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})}
function loadFixedline(){setMenuBar("Fixed Line Telephone");$("#finderHidden").empty().load("Plan_Finder_-_Phone_-_Fixed_Line_Telephone #content #bodyContent",function(){function a(){if(h!=$("#sortFilter").find(".ui-state-default").attr("id")||k!=$("#sortOrder").find(".ui-state-default").attr("id")){var f=[],d=0;h=$("#sortFilter").find(".ui-state-default").attr("id");k=$("#sortOrder").find(".ui-state-default").attr("id");switch(h){case "sortProvider":$("#finderContent .planRow").each(function(){f[d]=
$.trim($(this).children(".provider").text())+"_"+zeroPad(d,3)+"_"+$(this).attr("rownumber");d++});break;case "sortPrice":$("#finderContent .planRow").each(function(){f[d]=zeroPad($(this).attr("fee"),7)+"_"+zeroPad(d,3)+"_"+$(this).attr("rownumber");d++});break}f.sort();k=="sortZA"&&f.reverse();$.each(f,function(l){$("#finderContent .planTable tr[rownumber="+this.substr(this.length-3)+"]").insertAfter("#finderContent .planTable tr:eq("+l+")")})}if(e!=$("#monthlyfee").slider("values",0)||g!=$("#monthlyfee").slider("values",
1)){e=$("#monthlyfee").slider("values",0);g=$("#monthlyfee").slider("values",1);$(".planRow").each(function(){parseFloat($(this).attr("fee"))<e||parseFloat($(this).attr("fee"))>g?$(this).hide():$(this).show()})}}checkAJAXLoaded("Fixed Line Telephone");if(document.location.hash!="#phone-fixedline")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button><span style="float: right;"><button id="toggleSortAndFilters">Sort/Filters</button></span><div id="filterBar" style="display: none; padding: 10px;"><div style="color: #888; font-size: 0.9em; text-align: center;">You can change the slider bar values by dragging the handles or by clicking the handles and using the arrow keys on your keyboard.</div><table style="width: 100%; background: none;"><tr><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+
filterSortHeadingPTag2+'Monthly fee:<br/>$<span id="monthlyfeevalue1"></span>&nbsp;-&nbsp;$<span id="monthlyfeevalue2"></span></p><div class="slider" id="monthlyfee"></div></td><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+filterSortHeadingPTag1+'Sort<br/>by</span></p><table id="sortFilter" class="ui-corner-all" style="background: #cccccc; width: 100%; border-collapse: collapse: border: 0; padding: 0; margin: 0; cursor: pointer;"><tr><td id="sortProvider" class="ui-corner-all ui-state-default" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Provider</td><td id="sortPrice" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Price</td></tr></table></td><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+
filterSortHeadingPTag1+"Sort<br/>order</span></p>"+sortOrderTableTag1+"</td></tr></table></div></div>"+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("Price","price")+tableHeading("Caller ID","cid")+tableHeading("Voicemail","vmail")+tableHeading("Wiring & Maintenance",
"wiring")+"</tr></table>");countNo=1;maxMonthlyFeeValue=0;minMonthlyFeeValue=undefined;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan={};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim($(this).children(".plan.name").text());plan.cost=parseFloat(stripDollarSign($.trim($(this).children(".plan.cost").text()))).toFixed(2);
if(zeroPad(plan.cost,6)>zeroPad(maxMonthlyFeeValue,6))maxMonthlyFeeValue=plan.cost;if(minMonthlyFeeValue==undefined||plan.cost<minMonthlyFeeValue)minMonthlyFeeValue=plan.cost;plan.cidcost=parseFloat(stripDollarSign($.trim($(this).children(".phone.caller-id").text()))).toFixed(2);plan.vmailcost=parseFloat(stripDollarSign($.trim($(this).children(".phone.voicemail").text()))).toFixed(2);plan.wiringcost=parseFloat(stripDollarSign($.trim($(this).children(".phone.wiring").text()))).toFixed(2);plan.wiringcost=
isNaN(plan.wiringcost)?"-":"$"+plan.wiringcost;plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="price">$'+plan.cost+'</td><td class="cid">$'+plan.cidcost+'</td><td class="vmail">$'+plan.vmailcost+'</td><td class="wiring">'+plan.wiringcost+"</td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'" fee="'+plan.cost+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});
$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+indicatorsDisclaimer1+"<br/><br/>"+noGuarantee1+"<br/><br/>"+returnTableInfo());$("#monthlyfee").slider({range:true,value:Math.ceil(maxMonthlyFeeValue),min:Math.floor(minMonthlyFeeValue),max:Math.ceil(maxMonthlyFeeValue),values:[Math.floor(minMonthlyFeeValue),Math.ceil(maxMonthlyFeeValue)],step:1,slide:function(f,d){$("#monthlyfeevalue1").text(d.values[0]);
$("#monthlyfeevalue2").text(d.values[1]);a()},stop:function(f,d){$("#monthlyfeevalue1").text(d.values[0]);$("#monthlyfeevalue2").text(d.values[1]);a()}});$("#monthlyfeevalue1").text($("#monthlyfee").slider("values",0));$("#monthlyfeevalue2").text($("#monthlyfee").slider("values",1));$("#sortFilter td[id^=sort]").unbind().click(function(){$("#sortFilter td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});$("#sortOrder td[id^=sort]").unbind().click(function(){$("#sortOrder td[id^=sort]").removeClass("ui-state-default");
$(this).addClass("ui-state-default");a()});var e,g=-1,h,k="";a();$("#toggleSortAndFilters").unbind().click(function(){$("#filterBar").slideToggle(execMilliSec)});$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==
undefined)plan.provider.link=plan.provider.name;plan.name=$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());plan.info=$.trim(rowRef.children(".info").html());plan.cost=parseFloat(stripDollarSign($.trim(rowRef.children(".plan.cost").text()))).toFixed(2);planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Pricing</h2><ul><li><b>Monthly cost:</b> $'+
plan.cost+"</li></ul></td>";if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+
'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';planInfoTable=planInfoTable+'<a href="'+
plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+noGuarantee1+
"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})}
function loadVoip(){setMenuBar("Voice over Internet Protocol");$("#finderHidden").empty().load("Plan_Finder_-_Phone_-_Voice_over_Internet_Protocol #content #bodyContent",function(){function a(){if(h!=$("#sortFilter").find(".ui-state-default").attr("id")||k!=$("#sortOrder").find(".ui-state-default").attr("id")){var f=[],d=0;h=$("#sortFilter").find(".ui-state-default").attr("id");k=$("#sortOrder").find(".ui-state-default").attr("id");switch(h){case "sortProvider":$("#finderContent .planRow").each(function(){f[d]=
$.trim($(this).children(".provider").text())+"_"+zeroPad(d,3)+"_"+$(this).attr("rownumber");d++});break;case "sortPrice":$("#finderContent .planRow").each(function(){f[d]=zeroPad($(this).attr("fee"),7)+"_"+zeroPad(d,3)+"_"+$(this).attr("rownumber");d++});break}f.sort();k=="sortZA"&&f.reverse();$.each(f,function(l){$("#finderContent .planTable tr[rownumber="+this.substr(this.length-3)+"]").insertAfter("#finderContent .planTable tr:eq("+l+")")})}if(e!=$("#monthlyfee").slider("values",0)||g!=$("#monthlyfee").slider("values",
1)){e=$("#monthlyfee").slider("values",0);g=$("#monthlyfee").slider("values",1);$(".planRow").each(function(){parseFloat($(this).attr("fee"))<e||parseFloat($(this).attr("fee"))>g?$(this).hide():$(this).show()})}}checkAJAXLoaded("Voice over Internet Protocol");if(document.location.hash!="#phone-voip")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button><span style="float: right;"><button id="toggleSortAndFilters">Sort/Filters</button></span><div id="filterBar" style="display: none; padding: 10px;"><div style="color: #888; font-size: 0.9em; text-align: center;">You can change the slider bar values by dragging the handles or by clicking the handles and using the arrow keys on your keyboard.</div><table style="width: 100%; background: none;"><tr><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+
filterSortHeadingPTag2+'Monthly fee:<br/>$<span id="monthlyfeevalue1"></span>&nbsp;-&nbsp;$<span id="monthlyfeevalue2"></span></p><div class="slider" id="monthlyfee"></div></td><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+filterSortHeadingPTag1+'Sort<br/>by</span></p><table id="sortFilter" class="ui-corner-all" style="background: #cccccc; width: 100%; border-collapse: collapse: border: 0; padding: 0; margin: 0; cursor: pointer;"><tr><td id="sortProvider" class="ui-corner-all ui-state-default" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Provider</td><td id="sortPrice" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Price</td></tr></table></td><td style="width: 33.3%; padding: 10px; vertical-align: top;">'+
filterSortHeadingPTag1+"Sort<br/>order</span></p>"+sortOrderTableTag1+"</td></tr></table></div></div>"+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("Price","price")+"</tr></table>");countNo=1;maxMonthlyFeeValue=0;minMonthlyFeeValue=undefined;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan=
{};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim($(this).children(".plan.name").text());plan.cost=parseFloat(stripDollarSign($.trim($(this).children(".plan.cost").text()))).toFixed(2);if(zeroPad(plan.cost,6)>zeroPad(maxMonthlyFeeValue,6))maxMonthlyFeeValue=plan.cost;if(minMonthlyFeeValue==
undefined||plan.cost<minMonthlyFeeValue)minMonthlyFeeValue=plan.cost;plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="price">$'+plan.cost+"</td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'" fee="'+plan.cost+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+
indicatorsDisclaimer1+"<br/><br/>"+noGuarantee1+"<br/><br/>"+returnTableInfo());$("#monthlyfee").slider({range:true,value:Math.ceil(maxMonthlyFeeValue),min:Math.floor(minMonthlyFeeValue),max:Math.ceil(maxMonthlyFeeValue),values:[Math.floor(minMonthlyFeeValue),Math.ceil(maxMonthlyFeeValue)],step:1,slide:function(f,d){$("#monthlyfeevalue1").text(d.values[0]);$("#monthlyfeevalue2").text(d.values[1]);a()},stop:function(f,d){$("#monthlyfeevalue1").text(d.values[0]);$("#monthlyfeevalue2").text(d.values[1]);
a()}});$("#monthlyfeevalue1").text($("#monthlyfee").slider("values",0));$("#monthlyfeevalue2").text($("#monthlyfee").slider("values",1));$("#sortFilter td[id^=sort]").unbind().click(function(){$("#sortFilter td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});$("#sortOrder td[id^=sort]").unbind().click(function(){$("#sortOrder td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});var e,g=-1,h,k="";a();$("#toggleSortAndFilters").unbind().click(function(){$("#filterBar").slideToggle(execMilliSec)});
$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());
plan.info=$.trim(rowRef.children(".info").html());plan.cost=parseFloat(stripDollarSign($.trim(rowRef.children(".plan.cost").text()))).toFixed(2);planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Pricing</h2><ul><li><b>Monthly cost:</b> $'+plan.cost+"</li></ul></td>";if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+
plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+
plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';planInfoTable=planInfoTable+'<a href="'+plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+
plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+noGuarantee1+"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})}
function loadMobileGateway(){setMenuBar("Mobile Gateway Telephony");$("#finderHidden").empty().load("Plan_Finder_-_Phone_-_Mobile_Gateway_Telephony #content #bodyContent",function(){checkAJAXLoaded("Mobile Gateway Telephony");if(document.location.hash!="#phone-mobilegateway")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button></div>'+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithoutSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+
tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("Price","price")+tableHeading("Caller ID","cid")+tableHeading("Voicemail","vmail")+"</tr></table>");countNo=1;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan={};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;
plan.name=$.trim($(this).children(".plan.name").text());plan.cost=parseFloat(stripDollarSign($.trim($(this).children(".plan.cost").text()))).toFixed(2);plan.cidcost=parseFloat(stripDollarSign($.trim($(this).children(".phone.caller-id").text()))).toFixed(2);plan.vmailcost=parseFloat(stripDollarSign($.trim($(this).children(".phone.voicemail").text()))).toFixed(2);plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="price">$'+
plan.cost+'</td><td class="cid">$'+plan.cidcost+'</td><td class="vmail">$'+plan.vmailcost+"</td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+onnetInfo1+"<br/>"+indicatorsDisclaimer1+"<br/><br/>"+noGuarantee1+
"<br/><br/>"+returnTableInfo());$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());
plan.info=$.trim(rowRef.children(".info").html());plan.cost=parseFloat(stripDollarSign($.trim(rowRef.children(".plan.cost").text()))).toFixed(2);plan.cidcost=parseFloat(stripDollarSign($.trim(rowRef.children(".phone.caller-id").text()))).toFixed(2);plan.vmailcost=parseFloat(stripDollarSign($.trim(rowRef.children(".phone.voicemail").text()))).toFixed(2);planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Pricing</h2><ul><li><b>Monthly cost:</b> $'+
plan.cost+'</li></ul><br/><h2 class="greyHeaderBG">Phone features</h2><ul><li><b>Caller ID:</b> $'+plan.cidcost+"/month</li><li><b>Voicemail:</b> $"+plan.vmailcost+"/month</li></ul></td>";if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';
if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';
planInfoTable=planInfoTable+'<a href="'+plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+
onnetInfo1+"<br/>"+noGuarantee1+"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})}
function loadPrepaidMobile(){setMenuBar("Prepaid Mobile");$("#finderHidden").empty().load("Plan_Finder_-_Phone_-_Prepaid_Mobile #content #bodyContent",function(){checkAJAXLoaded("Prepaid Mobile");if(document.location.hash!="#phone-prepaidmobile")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button></div>'+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithoutSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+
tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("NZ Texts","text")+tableHeading("NZ Landlines","landline")+tableHeading("On-net","on-net")+tableHeading("Off-net","off-net")+"</tr></table>");countNo=1;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan={};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==
undefined)plan.provider.link=plan.provider.name;plan.name=$.trim($(this).children(".plan.name").text());plan.rate={};plan.rate.text=parseFloat(stripDollarSign($.trim($(this).children(".rate.text").text()))).toFixed(2);plan.rate.nzlandline=parseFloat(stripDollarSign($.trim($(this).children(".rate.nzlandline").text()))).toFixed(2);plan.rate.onnet=parseFloat(stripDollarSign($.trim($(this).children(".rate.on-net").text()))).toFixed(2);plan.rate.offnet=parseFloat(stripDollarSign($.trim($(this).children(".rate.off-net").text()))).toFixed(2);
plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="text">$'+plan.rate.text+'/ea</td><td class="landline">$'+plan.rate.nzlandline+'/min</td><td class="on-net">$'+plan.rate.onnet+'/min</td><td class="off-net">$'+plan.rate.offnet+"/min</td></td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+
onnetInfo1+"<br/>"+indicatorsDisclaimer1+"<br/><br/>"+noGuarantee1+"<br/><br/>"+returnTableInfo());$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;plan.name=
$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());plan.info=$.trim(rowRef.children(".info").html());plan.rate={};plan.rate.text=parseFloat(stripDollarSign($.trim(rowRef.children(".rate.text").text()))).toFixed(2);plan.rate.nzlandline=parseFloat(stripDollarSign($.trim(rowRef.children(".rate.nzlandline").text()))).toFixed(2);plan.rate.onnet=parseFloat(stripDollarSign($.trim(rowRef.children(".rate.on-net").text()))).toFixed(2);plan.rate.offnet=parseFloat(stripDollarSign($.trim(rowRef.children(".rate.off-net").text()))).toFixed(2);
planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Calling rates</h2><ul><li><b>Calls to New Zealand landlines:</b> $'+plan.rate.nzlandline+"/min<br/><br/></li><li><b>Calls to On-net mobiles:</b> $"+plan.rate.onnet+"/min</li><li><b>Calls to Off-net mobiles:</b> $"+plan.rate.onnet+'/min</li></ul><br/><h2 class="greyHeaderBG">Texting rates</h2><ul><li><b>Texts to New Zealand mobiles:</b> $'+
plan.rate.text+'/ea</li></ul><br/><span style="color: #888; font-size: 0.9em; font-style: italic; line-height: 1.3em;">More information regarding On-net can be found near the bottom of this page.</span><br/></td>';if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';
planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';
planInfoTable=planInfoTable+'<a href="'+plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+
onnetInfo1+"<br/>"+noGuarantee1+"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})}
function loadPostpaidMobile(){setMenuBar("Postpaid Mobile");$("#finderHidden").empty().load("Plan_Finder_-_Phone_-_Postpaid_Mobile #content #bodyContent",function(){function a(){if(i!=$("#sortFilter").find(".ui-state-default").attr("id")||b!=$("#sortOrder").find(".ui-state-default").attr("id")){var j=[],c=0;i=$("#sortFilter").find(".ui-state-default").attr("id");b=$("#sortOrder").find(".ui-state-default").attr("id");switch(i){case "sortProvider":$("#finderContent .planRow").each(function(){j[c]=$.trim($(this).children(".provider").text())+
"_"+zeroPad(c,3)+"_"+$(this).attr("rownumber");c++});break;case "sortPrice":$("#finderContent .planRow").each(function(){j[c]=zeroPad($(this).attr("fee"),7)+"_"+zeroPad(c,3)+"_"+$(this).attr("rownumber");c++});break;case "sortMinutes":$("#finderContent .planRow").each(function(){j[c]=zeroPad($(this).attr("minutesWeighted"),6)+"_"+zeroPad(c,3)+"_"+$(this).attr("rownumber");c++});break;case "sortTexts":$("#finderContent .planRow").each(function(){j[c]=zeroPad($(this).attr("textsWeighted"),6)+"_"+zeroPad(c,
3)+"_"+$(this).attr("rownumber");c++});break;case "sortTerm":$("#finderContent .planRow").each(function(){j[c]=zeroPad($(this).attr("termmonths")+1,3)+"_"+zeroPad(c,3)+"_"+$(this).attr("rownumber");c++});break}j.sort();b=="sortZA"&&j.reverse();$.each(j,function(n){$("#finderContent .planTable tr[rownumber="+this.substr(this.length-3)+"]").insertAfter("#finderContent .planTable tr:eq("+n+")")})}if(e!=$("#monthlyfee").slider("values",0)||g!=$("#monthlyfee").slider("values",1)||h!=$("#minutes").slider("values",
0)||k!=$("#minutes").slider("values",1)||f!=$("#texts").slider("values",0)||d!=$("#texts").slider("values",1)||l!=$("#term").slider("values",0)||m!=$("#term").slider("values",1)){e=$("#monthlyfee").slider("values",0);g=$("#monthlyfee").slider("values",1);h=$("#minutes").slider("values",0);k=$("#minutes").slider("values",1);f=$("#texts").slider("values",0);d=$("#texts").slider("values",1);l=$("#term").slider("values",0);m=$("#term").slider("values",1);$(".planRow").each(function(){parseFloat($(this).attr("fee"))<
e||parseFloat($(this).attr("fee"))>g||parseFloat($(this).attr("minutesWeighted"))<h||parseFloat($(this).attr("minutesWeighted"))>k||parseFloat($(this).attr("textsWeighted"))<f||parseFloat($(this).attr("textsWeighted"))>d||parseFloat($(this).attr("termmonths"))<l||parseFloat($(this).attr("termmonths"))>m?$(this).hide():$(this).show()})}}checkAJAXLoaded("Postpaid Mobile");if(document.location.hash!="#phone-postpaidmobile")return false;$("#finderMenuBar").empty().html('<div id="menuBar"><button id="returnToHome">Return to Home</button><span style="float: right;"><button id="toggleSortAndFilters">Sort/Filters</button></span><div id="filterBar" style="display: none; padding: 10px;"><div style="color: #888; font-size: 0.9em; text-align: center;">You can change the slider bar values by dragging the handles or by clicking the handles and using the arrow keys on your keyboard.</div><table style="width: 100%; background: none;"><tr><td style="width: 25%; padding: 10px;">'+
filterSortHeadingPTag1+'Monthly fee:<br/>$<span id="monthlyfeevalue1"></span>&nbsp;-&nbsp;$<span id="monthlyfeevalue2"></span></p><div class="slider" id="monthlyfee"></div></td><td style="width: 25%; padding: 10px;">'+filterSortHeadingPTag1+'Weighted* minutes:<br/><span id="minutesvalue1"></span>&nbsp;<span id="minutesunit1"></span>&nbsp;-&nbsp;<span id="minutesvalue2"></span>&nbsp;<span id="minutesunit2"></span></p><div class="slider" id="minutes"></div></td><td style="width: 25%; padding: 10px;">'+
filterSortHeadingPTag1+'Weighted* texts:<br/><span id="textsvalue1"></span>&nbsp;<span id="textsunit1"></span>&nbsp;-&nbsp;<span id="textsvalue2"></span>&nbsp;<span id="textsunit2"></span></p><div class="slider" id="texts"></div></td><td style="width: 25%; padding: 10px;">'+filterSortHeadingPTag1+'Minimum contract term:<br/><span id="termvalue1"></span>&nbsp;<span id="termunit1"></span>&nbsp;-&nbsp;<span id="termvalue2"></span>&nbsp;<span id="termunit2"></span></p><div class="slider" id="term"></div></td></tr><tr><td colspan="3" style="padding: 10px;">'+
filterSortHeadingPTag1+'Sort<br/>by</span></p><table id="sortFilter" class="ui-corner-all" style="background: #cccccc; width: 100%; border-collapse: collapse: border: 0; padding: 0; margin: 0; cursor: pointer;"><tr><td id="sortProvider" class="ui-corner-all ui-state-default" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Provider</td><td id="sortPrice" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Price</td><td id="sortMinutes" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Minutes</td><td id="sortTexts" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Texts</td><td id="sortTerm" class="ui-corner-all" style="padding: 3px; text-align: center; margin: 1px; width: 20%;">Term</td></tr></table></td><td style="padding: 10px;">'+
filterSortHeadingPTag1+"Sort<br/>order</span></p>"+sortOrderTableTag1+"</td></tr></table></div></div>"+planInfoBarDivTag1);$("#finderContent").empty().append(innerContentWelcomeWithSortFilterDivTag1);$("#finderContent #innerContent").append('<table class="wikitable planTable" style="width: 100%;"><tr class="planHeadings">'+tableHeading("Provider","provider")+tableHeading("Plan","name")+tableHeading("Price","price")+tableHeading("Included Minutes","minutes")+tableHeading("Included Texts","texts")+
tableHeading("Minimum Term","term")+"</tr></table>");countNo=1;maxMonthlyFeeValue=0;minMonthlyFeeValue=undefined;maxMinuteValue=0;minMinuteValue=undefined;maxTextValue=0;minTextValue=undefined;$("#finderHidden #tableContent tr:not(':eq(0)')").each(function(){plan={};plan.provider={};plan.provider.name=$.trim($(this).children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim($(this).children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=
plan.provider.name;plan.name=$.trim($(this).children(".plan.name").text());plan.cost=parseFloat(stripDollarSign($.trim($(this).children(".plan.cost").text()))).toFixed(2);if(zeroPad(plan.cost,7)>zeroPad(maxMonthlyFeeValue,7))maxMonthlyFeeValue=plan.cost;if(minMonthlyFeeValue==undefined||plan.cost<minMonthlyFeeValue)minMonthlyFeeValue=plan.cost;plan.minutes={};plan.minutes.anytime=Math.round(parseFloat($.trim($(this).children(".minutes.anytime").text())));if(isNaN(plan.minutes.anytime))plan.minutes.anytime=
0;plan.minutes.offpeak=Math.round(parseFloat($.trim($(this).children(".minutes.off-peak").text())));if(isNaN(plan.minutes.offpeak))plan.minutes.offpeak=0;plan.minutes.onnet=Math.round(parseFloat($.trim($(this).children(".minutes.on-net").text())));if(isNaN(plan.minutes.onnet))plan.minutes.onnet=0;plan.minutes.total=plan.minutes.anytime+plan.minutes.offpeak+plan.minutes.onnet;plan.minutes.weighted=Math.round(plan.minutes.anytime+0.64*plan.minutes.offpeak+0.5*plan.minutes.onnet);plan.minutes.displayHTML=
plan.minutes.offpeak>0||plan.minutes.onnet>0?plan.minutes.anytime+" + "+(plan.minutes.offpeak+plan.minutes.onnet):plan.minutes.anytime;if(plan.minutes.weighted>maxMinuteValue)maxMinuteValue=plan.minutes.weighted;if(minMinuteValue==undefined||plan.minutes.weighted<minMinuteValue)minMinuteValue=plan.minutes.weighted;plan.text={};plan.text.national=Math.round(parseFloat($.trim($(this).children(".texts.national").text())));if(isNaN(plan.text.national))plan.text.national=0;plan.text.onnet=Math.round(parseFloat($.trim($(this).children(".texts.on-net").text())));
if(isNaN(plan.text.onnet))plan.text.onnet=0;plan.text.total=plan.text.national+plan.text.onnet;plan.text.weighted=Math.round(plan.text.national+0.5*plan.text.onnet);plan.text.displayHTML=plan.text.onnet>0?plan.text.national+" + "+plan.text.onnet:plan.text.national;if(plan.text.weighted>maxTextValue)maxTextValue=plan.text.weighted;if(minTextValue==undefined||plan.text.weighted<minTextValue)minTextValue=plan.text.weighted;plan.term={};plan.term.raw=$.trim($(this).children(".term").text());if(plan.term.raw==
"Prepaid"){plan.term.monthvalue="-1";plan.term.value="Prepaid"}else{plan.term.monthvalue=$.trim(plan.term.raw.replace(/months|month/gi,""));plan.term.value=plan.term.monthvalue}plan.rowHTML='<td class="provider"><a>'+plan.provider.name+'</a>&nbsp;</td><td class="name"><a>'+plan.name+'</a></td><td class="price">$'+plan.cost+'</td><td class="minutes">'+plan.minutes.displayHTML+'</td><td class="texts">'+plan.text.displayHTML+'</td><td class="term">';if(plan.term.value=="Prepaid")plan.rowHTML+="Prepaid";
else{plan.rowHTML+=plan.term.value;plan.rowHTML+=plan.term.value=="1"?" month":" months"}plan.rowHTML+="</td>";plan.rowHTML='<tr class="planRow" rownumber="'+zeroPad(countNo,3)+'" fee="'+plan.cost+'" minutesTotal="'+plan.minutes.total+'" minutesWeighted="'+plan.minutes.weighted+'" textsTotal="'+plan.text.total+'" textsWeighted="'+plan.text.weighted+'" termMonths="'+plan.term.monthvalue+'">'+plan.rowHTML+"</tr>";$("#finderContent .planTable").append(plan.rowHTML);countNo++});$(".planRow").each(function(){minuteValue=
parseFloat($(this).attr("minutesWeighted"));pcOverallMinutes=Math.round(minuteValue/maxMinuteValue*100);redValue=Math.round(170*(1-pcOverallMinutes*0.01));greenValue=Math.round(140*pcOverallMinutes*0.01);blueValue=0;$(this).children(".minutes").html('<div style="border: 1px solid #000; background-color: #000; position: relative;"><div style="background-color: rgb('+redValue+", "+greenValue+", "+blueValue+"); width: "+pcOverallMinutes+'%;">&nbsp;</div><div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center; color: #fff; font-weight: bold;">'+
$(this).children(".minutes").text()+"</div></div>");textValue=parseFloat($(this).attr("textsWeighted"));pcOverallTexts=Math.round(textValue/maxTextValue*100);redValue=Math.round(170*(1-pcOverallTexts*0.01));greenValue=Math.round(140*pcOverallTexts*0.01);blueValue=0;$(this).children(".texts").html('<div style="border: 1px solid #000; background-color: #000; position: relative;"><div style="background-color: rgb('+redValue+", "+greenValue+", "+blueValue+"); width: "+pcOverallTexts+'%;">&nbsp;</div><div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center; color: #fff; font-weight: bold;">'+
$(this).children(".texts").text()+"</div></div>")});$("#finderContent #innerContent").append('<div style="height: 1px; background: #ccc; margin: 10px 0;"></div><div style="font-style: italic; font-size: 0.9em; line-height: 1.3em;">'+onnetInfo1+"<br/>"+indicatorsDisclaimer1+"<br/><br/>Minutes are displayed in a single number if there are only anytime minutes present, or with two numbers, where the first number represents anytime minutes and the second number represents the total of off-peak and on-net minutes.<br/>Minutes are weighted for sorting, filtering and when rendering visual indicators, as per this list:<ul><li>1.00 x anytime minutes</li><li>0.64 x off-peak minutes</li><li>0.50 x on-net minutes</li></ul>Minutes displayed in the table and plan details are correct to plan information and are not weighted.<br/><br/>Texts are displayed in a single number if there are only national texts present, or with two numbers, where the first number represents national texts and the second number represents on-net texts.<br/>Texts are weighted for sorting, filtering and when rendering visual indicators, as per this list:<ul><li>1.00 x national texts</li><li>0.50 x on-net texts</li></ul>Texts displayed in the table and plan details are correct to plan information and are not weighted.<br/><br/>"+
noGuarantee1+"<br/><br/>"+returnTableInfo());$("#monthlyfee").slider({range:true,value:Math.ceil(maxMonthlyFeeValue),min:Math.floor(minMonthlyFeeValue),max:Math.ceil(maxMonthlyFeeValue),values:[Math.floor(minMonthlyFeeValue),Math.ceil(maxMonthlyFeeValue)],step:1,slide:function(j,c){$("#monthlyfeevalue1").text(c.values[0]);$("#monthlyfeevalue2").text(c.values[1]);a()},stop:function(j,c){$("#monthlyfeevalue1").text(c.values[0]);$("#monthlyfeevalue2").text(c.values[1]);a()}});$("#monthlyfeevalue1").text($("#monthlyfee").slider("values",
0));$("#monthlyfeevalue2").text($("#monthlyfee").slider("values",1));$("#minutes").slider({range:true,value:Math.floor(minMinuteValue),min:Math.floor(minMinuteValue),max:Math.ceil(maxMinuteValue),values:[Math.floor(minMinuteValue),Math.ceil(maxMinuteValue)],step:1,slide:function(j,c){$("#minutesvalue1").text(c.values[0]);c.values[0]==1?$("#minutesunit1").text("minute"):$("#minutesunit1").text("minutes");$("#minutesvalue2").text(c.values[1]);c.values[1]==1?$("#minutesunit2").text("minute"):$("#minutesunit2").text("minutes");
a()},stop:function(j,c){$("#minutesvalue1").text(c.values[0]);c.values[0]==1?$("#minutesunit1").text("minute"):$("#minutesunit1").text("minutes");$("#minutesvalue2").text(c.values[1]);c.values[1]==1?$("#minutesunit2").text("minute"):$("#minutesunit2").text("minutes");a()}});$("#minutesvalue1").text($("#minutes").slider("values",0));$("#minutes").slider("values",0)==1?$("#minutesunit1").text("minute"):$("#minutesunit1").text("minutes");$("#minutesvalue2").text($("#minutes").slider("values",1));$("#minutes").slider("values",
1)==1?$("#minutesunit2").text("minute"):$("#minutesunit2").text("minutes");$("#texts").slider({range:true,value:Math.floor(minTextValue),min:Math.floor(minTextValue),max:Math.ceil(maxTextValue),values:[Math.floor(minTextValue),Math.ceil(maxTextValue)],step:1,slide:function(j,c){$("#textsvalue1").text(c.values[0]);editUnitEquals1(c.values[0],"#textsunit2","text","texts");$("#textsvalue2").text(c.values[1]);editUnitEquals1(c.values[1],"#textsunit2","text","texts");a()},stop:function(j,c){$("#textsvalue1").text(c.values[0]);
editUnitEquals1(c.values[0],"#textsunit2","text","texts");$("#textsvalue2").text(c.values[1]);editUnitEquals1(c.values[1],"#textsunit2","text","texts");a()}});$("#textsvalue1").text($("#texts").slider("values",0));editUnitEquals1($("#texts").slider("values",0),"#textsunit1","text","texts");$("#textsvalue2").text($("#texts").slider("values",1));editUnitEquals1($("#texts").slider("values",1),"#textsunit2","text","texts");$("#term").slider({range:true,value:24,min:0,max:24,values:[0,24],step:1,slide:function(j,
c){$("#termvalue1").text(c.values[0]);editUnitEquals1(c.values[0],"#termunit1","month","months");$("#termvalue2").text(c.values[1]);editUnitEquals1(c.values[1],"#termunit2","month","months");a()},stop:function(j,c){$("#termvalue1").text(c.values[0]);editUnitEquals1(c.values[0],"#termunit1","month","months");$("#termvalue2").text(c.values[1]);editUnitEquals1(c.values[1],"#termunit2","month","months");a()}});$("#termvalue1").text($("#term").slider("values",0));editUnitEquals1($("#term").slider("values",
0),"#termunit1","month","months");$("#termvalue2").text($("#term").slider("values",1));editUnitEquals1($("#term").slider("values",1),"#termunit2","month","months");$("#sortFilter td[id^=sort]").unbind().click(function(){$("#sortFilter td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});$("#sortOrder td[id^=sort]").unbind().click(function(){$("#sortOrder td[id^=sort]").removeClass("ui-state-default");$(this).addClass("ui-state-default");a()});var e,g,h,k,f,d,l,
m=-1,i,b="";a();$("#toggleSortAndFilters").unbind().click(function(){$("#filterBar").slideToggle(execMilliSec)});$(".planRow").unbind().click(function(){rowNumber=$(this).attr("rownumber");rowRef=$("#finderHidden #tableContent tr:eq("+rowNumber+")");plan={};plan.provider={};plan.provider.name=$.trim(rowRef.children(".plan.provider").text()).split("/")[0];plan.provider.link=$.trim(rowRef.children(".plan.provider").text()).split("/")[1];if(plan.provider.link==undefined)plan.provider.link=plan.provider.name;
plan.name=$.trim(rowRef.children(".plan.name").text());plan.link=$.trim(rowRef.children(".plan.link").text());plan.info=$.trim(rowRef.children(".info").html());plan.cost=stripDollarSign($.trim(rowRef.children(".plan.cost").text()));plan.minutes={};plan.minutes.anytime=Math.round(parseFloat($.trim(rowRef.children(".minutes.anytime").text())));if(isNaN(plan.minutes.anytime))plan.minutes.anytime=0;plan.minutes.offpeak=Math.round(parseFloat($.trim(rowRef.children(".minutes.off-peak").text())));if(isNaN(plan.minutes.offpeak))plan.minutes.offpeak=
0;plan.minutes.onnet=Math.round(parseFloat($.trim(rowRef.children(".minutes.on-net").text())));if(isNaN(plan.minutes.onnet))plan.minutes.onnet=0;plan.text={};plan.text.national=Math.round(parseFloat($.trim(rowRef.children(".texts.national").text())));if(isNaN(plan.text.national))plan.text.national=0;plan.text.onnet=Math.round(parseFloat($.trim(rowRef.children(".texts.on-net").text())));if(isNaN(plan.text.onnet))plan.text.onnet=0;plan.term={};plan.term.raw=$.trim(rowRef.children(".term").text());plan.term.value=
plan.term.raw=="Prepaid"?"Prepaid":$.trim(plan.term.raw.replace(/months|month/gi,""));planInfoTable='<table style="width: 100%;"><tr><td colspan="3"><h1 style="margin-bottom: 10px;">'+plan.provider.name+" "+plan.name+'</h1></td></tr><tr><td style="padding-right: 8px; vertical-align: top;"><h2 class="greyHeaderBG">Pricing</h2><ul><li><b>Monthly cost:</b> $'+plan.cost+'</li></ul><br/><h2 class="greyHeaderBG">Included minutes</h2><ul><li><b>Anytime:</b> '+plan.minutes.anytime;planInfoTable+=plan.minutes.anytime==
1?" minute":" minutes";planInfoTable=planInfoTable+"</li><li><b>Off-peak:</b> "+plan.minutes.offpeak;planInfoTable+=plan.minutes.offpeak==1?" minute":" minutes";planInfoTable=planInfoTable+"</li><li><b>On-net:</b> "+plan.minutes.onnet;planInfoTable+=plan.minutes.onnet==1?" minute":" minutes";planInfoTable=planInfoTable+'</li></ul><br/><h2 class="greyHeaderBG">Included texts</h2><ul><li><b>National:</b> '+plan.text.national;planInfoTable+=plan.text.national==1?" text":" texts";planInfoTable=planInfoTable+
"</li><li><b>On-net:</b> "+plan.text.onnet;planInfoTable+=plan.text.onnet==1?" text":" texts";planInfoTable+='</li></ul><br/><span style="color: #888; font-size: 0.9em; font-style: italic; line-height: 1.3em;">More information regarding On-net can be found near the bottom of this page.</span><br/><br/><h2 class="greyHeaderBG">Contract term</h2>';if(plan.term.value=="Prepaid")planInfoTable+="Prepaid";else{planInfoTable+=plan.term.value;planInfoTable+=plan.term.value=="1"?" month":" months"}planInfoTable+=
"</td>";if(plan.info!="")planInfoTable=planInfoTable+'<td style="width: 38%; border-left: 1px solid #ccc; padding: 0 10px; vertical-align: top;"><h2 class="greyHeaderBG">Additional notes and info</h2>'+plan.info+"</td>";else planInfoTable+='<td style="width: 0; padding: 0; margin: 0; border: 0;"></td>';planInfoTable+='<td style="width: 24%; border-left: 1px solid #ccc; padding: 0 5px 0 10px; vertical-align: top;">';if(plan.link!="")planInfoTable=planInfoTable+'<a href="'+plan.link+'" style="text-decoration: none;" target="_blank"><div class="blueArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">View plan on '+
plan.provider.name+'\'s site<br/><span style="font-style: italic; font-size: 0.6em;">(external link)</span></div></a><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>';planInfoTable=planInfoTable+'<a href="'+plan.provider.link+'" style="text-decoration: none;"><div class="greyArrowRightBG" style="color: #fff; padding: 6px; font-size: 1.2em; font-weight: bold; -moz-box-shadow: 3px 3px #ddd; -webkit-box-shadow: 3px 3px #ddd; -o-box-shadow: 3px 3px #ddd; box-shadow: 3px 3px #ddd;">Find out more about '+
plan.provider.name+'</div></a></td></tr><tr><td colspan="3" style="font-style: italic; font-size: 0.9em; line-height: 1.3em;"><div style="height: 1px; background: #ccc; margin: 10px 0;"></div>'+onnetInfo1+"<br/>"+noGuarantee1+"</td></tr></table>";$("#planInfoContent").empty().append(planInfoTable);openPlanDetail()});bindClosePlanDetail()})};