var NWTel={};if(typeof(Shadowbox)!="undefined"){Shadowbox.loadSkin("nwtel","/scripts/shadowbox_skins");}jQuery().ready(function(){$("ul.expandable").toggle();$("ul.expandable").each(function(){var j=this.id;if(expandable_matches(j)){var i="expander_"+j.substring(11);$("#"+j).toggle();$("#"+i).addClass("expanded");}});$("a.expander").click(function(j){j.preventDefault();var l=this.id.substring(9);var k="#expandable_"+l;$(k).toggle();var i=$(k).css("display");if(i=="block"){$("#"+this.id).addClass("expanded");}else{$("#"+this.id).removeClass("expanded");}this.blur();});var h=window.location.pathname;var b=(h.match(/^\/(business|personal)\/(tv\/|internet\/|wireless\/|solutions\/|voice\/)/)||h.match(/^\/(tv\/|internet\/|wireless\/|solutions\/|voice\/)/));var a={alwaysOpen:false,header:"a.menu_title",clearStyle:true,autoheight:false,active:".current"};if(!b){var c=h.substring(1);var g=c.substring(0,c.indexOf("/"));var f=g.replace("-","_");var d="#right_menu #menu_"+f;if(g!=""&&h.match(g)){$(d).addClass("current");}}$("#right_menu").accordion(a);$("#right_menu a.menu_title").mouseover(function(){$(this).addClass("selected");});$("#right_menu a.menu_title").mouseout(function(){var j="#"+this.id.substring(5)+"_info";var i=$(j).css("display");if(i=="none"){$(this).removeClass("selected");}});$("#right_menu .menu_content").css({height:"auto"});if($("#category_detail_menu")&&$("#category_detail_menu UL").length>0){if(b){if(h.match(/^\/(business|personal)\/(tv\/|internet\/|wireless\/|solutions\/|voice\/)/)){var c=h.substring(10);}else{if(h.match(/^\/(tv\/|internet\/|wireless\/|solutions\/|voice\/)/)){var c=h.substring(1);}}var e=c.substring(0,c.indexOf("/"));if(e!=""){$("#category_detail_menu #menu_"+e).addClass("current");$("#category_detail_menu #menu_"+e).addClass("selected");$("#category_detail_menu #"+e+"_info").addClass("current");}}$("#category_detail_menu .menu_content").toggle();$("#category_detail_menu .menu_content.current").toggle();}Shadowbox.init();$("#shadowbox_container").css("display","none");$("#shadowbox_overlay, #shadowbox_nav_close").click(function(){$("#shadowbox_container").css("display","none");});$(".shadowbox_link").click(function(){$("#shadowbox_container").css("display","block");});$(".location_selector").click(function(i){i.preventDefault();$("#shadowbox_container").css("display","block");Shadowbox.open({content:"/profile_chooser.cfm?",player:"iframe",width:750,height:500});});$("#mini_map").click(function(i){i.preventDefault();$("#shadowbox_container").css("display","block");Shadowbox.open({content:"/profile_chooser.cfm?",player:"iframe",width:750,height:500});});$(".location_selector_bundle").click(function(i){i.preventDefault();$("#shadowbox_container").css("display","block");Shadowbox.open({content:"http://northwestel.lyrishq.net/profile_chooser.cfm?",player:"iframe",width:750,height:500});});$("#mini_map_bundle").click(function(i){i.preventDefault();$("#shadowbox_container").css("display","block");Shadowbox.open({content:"http://northwestel.lyrishq.net/profile_chooser.cfm?",player:"iframe",width:750,height:500});});});function expandable_matches(b){var e=false;var d="toplevel_"+b.substring(11);var a=top.location.pathname;if($("#"+d).length>0){var c=$("#"+d).attr("href");if(a.match(c)){return true;}}$("#"+b+" li a").each(function(){var f=$(this).attr("href");if(a.match(f)){e=true;}});return e;}if(typeof(NWTel)=="undefined"){var NWTel={};}NWTel.location_chooser_popup=function(a){a.preventDefault();$("#shadowbox_container").css("display","block");Shadowbox.open({content:"/profile_chooser.cfm?",player:"iframe",width:750,height:500});};NWTel.availability=function(a){this.init(a);};NWTel.availability.prototype={init:function(a){this.set_location_id(a);if(this.location_id!=null){this.hide_controlled_products();this.show_available_products();this.filter_locales();}else{$("body").addClass("show-not-profiled");}$(document).trigger("NWTel.availability-init",[this]);},set_location_id:function(a){this.location_id=null;if(a!==null&&a!==undefined&&availability_data[a]){this.location_id=a;}},hide_controlled_products:function(){$("body").addClass("hide-controlled");},show_available_products:function(){$.each(this.products(),this.show_product);},show_product:function(a,b){$(".product-"+b).removeClass("controlled");$(".noneof.product-"+b).addClass("found");},filter_locales:function(){$(".locale-"+this.location_id).removeClass("controlled");},show_message_if_none:function(c,f){if(typeof c=="number"){c=[c];}if(this.location_id==null){var e='<p class="no-avail"><strong>NOTICE:</strong> ';if(c.length>1){e+="Some of these products/services are only available in certain locations.";}else{e+="This product/service is is only available in certain locations.";}e+=' Please <a href="#" class="location_selector" id="notice-location_selector" title="Choose your area of residence">choose your location</a> to find out what products are available in your area.</p>';$("#column_middle h1").next().prepend(e);$("#notice-location_selector").click(NWTel.location_chooser_popup);}else{var a=this.products();var d=false;jQuery.each(c,function(h,i){if(jQuery.inArray(i,a)>-1){d=true;return false;}});if(!d){var g=top.location.pathname.split("/");var b="/"+g[1]+"/"+g[2];var e='<p class="no-avail"><strong>NOTICE:</strong> This product/service is not available in your selected region.';if(!f){e+='<br /><a href="'+b+'">See all products for your region.</a>';}e+="</p>";$("#column_middle h1").next().prepend(e);}}},products:function(){if(availability_data[this.location_id]){return availability_data[this.location_id];}else{return[];}}};NWTel.availability.locations_with_product=function(a){location_ids=[];jQuery.each(availability_data,function(b,c){if(jQuery.inArray(a,c)>-1){location_ids.push(b);}});return location_ids;};
