(function(){DF.namespace("DF.Twc");DF.Twc.FaqSurvey=function(a,b,d,h,g){this.formId=a;this.submitId=d;this.ratingFieldId=g;this.commentsId=b;this.pollWindow=null;this.noCommentOk=this.isSubmitted=false;this.starWidget=new DF.Twc.StarSurvey(null,h,g);DF.evt.AddLoadEvent(this.init.createDelegate(this))};DF.Twc.FaqSurvey.errorMessages={additionalComments:"Any additional comments you could provide regarding possible improvements to this FAQ would be appreciated.",rateFaq:"Please rate this FAQ."};DF.Twc.FaqSurvey.checkOutCookie=
function(){DF.Twc.Cookie.Session.GetSessionCookie("ShowFaqChat")===null&&DF.Twc.Cookie.Session.AddSessionCookie("ShowFaqChat",true)};DF.Twc.FaqSurvey.shrinkBreadCrums=function(){var a=$("#faq_breadcrums_wrp").width(),b=$("#faq_breadcrums").get()[0],d=b.childNodes.length;for($("#faq_breadcrums").width()>a&&d>1&&b.removeChild(b.childNodes[d-1]);$("#faq_breadcrums").width()>a&&d>1;)b.removeChild(b.childNodes[0]);$("#faq_breadcrums span:last-child").css({display:"none"});$("#faq_breadcrums_wrp span").css({visibility:"visible"})};
DF.Twc.FaqSurvey.prototype={onSurveySubmit:function(a){DF.evt.CancelEvent(a);if(!this.isSubmitted){a=document.getElementById("starvalue").value;var b=DF.$(this.commentsId).value,d,h=function(){DF.Twc.OverlayController.hideOverlay(d)},g=function(){var e=document.getElementById("faqFeedbackChatLink").href;window.open(e,"TWC_Support_Chat");DF.Twc.OverlayController.hideOverlay(d);return false},c=function(){$("#FaqSupportFeedbackOverlayContent .Overlay_CloseButton").click(h);$("#FaqSupportFeedbackOverlayContent .FaqFeedbackChat_button").click(g)},
f=function(){return d=new DF.Twc.Overlay2("/"+DF.PageInfo.Level.ShortName+"/faqs/faqvotehandler.ashx",{standardLayout:true,dynamic:true,overlayShowCb:c,postData:"ShowFaqChat="+DF.Twc.Cookie.Session.GetSessionCookie("ShowFaqChat")+"&FaqId="+DF.$("FaqId").value+"&VersionId="+DF.$("VersionId").value+"&MarketInfoNumber="+DF.$("MarketInfoNumber").value+"&MarketInfoId="+DF.$("MarketInfoId").value+"&rank="+DF.$("starvalue").value+"&Comments="+b})};if(a!==null&&a!==""){f=f();a<3&&b===""&&!this.noCommentOk&&
DF.Twc.Cookie.Session.AddSessionCookie("ShowFaqChat",false);this.starWidget.onSubmit();DF.Twc.OverlayController.showOverlay(f);this.isSubmitted=this.noCommentOk=true}else alert(DF.Twc.FaqSurvey.errorMessages.rateFaq)}},init:function(){this.pollWindow=DF.$(this.formId).target;DF.Twc.FaqSurvey.checkOutCookie();DF.evt.Event.addListener(DF.$(this.submitId),"click",this.onSurveySubmit.createDelegate(this));DF.Twc.FaqSurvey.shrinkBreadCrums()}}})();
(function(){DF.namespace("DF.Twc");DF.Twc.StarSurvey=function(a,b,d){this.form=a;this.starList=b;this.ratingField=d;this.listClasses=["","twc_starSurvey_onestar","twc_starSurvey_twostar","twc_starSurvey_threestar","twc_starSurvey_fourstar","twc_starSurvey_fivestar"];DF.evt.AddLoadEvent(this.init.createDelegate(this))};DF.Twc.StarSurvey.prototype={ratingChangedEvent:new DF.evt.CustomEvent("ratingChanged"),_storeStarValue:function(a){this.ratingField.value=a;this.starList.className="twc_starSurvey_rating";
if(a>=1&&a<this.listClasses.length)this.starList.className+=" "+this.listClasses[a]},_onStarClick:function(a){if(!a)a=window.event;var b=a.target?a.target:a.srcElement;if(b.nodeType===3)b=b.parentNode;this._storeStarValue(parseInt(b.firstChild.nodeValue,10));this.ratingChangedEvent.fire();return DF.evt.PreventDefault(a)},onSubmit:function(){switch(this.ratingField.value){case "1":case "2":case "3":DF.Twc.OmnitureHelper.setEvent("event45");break;case "4":case "5":DF.Twc.OmnitureHelper.setEvent("event44");
break}DF.Twc.OmnitureHelper.submit()},rating:function(){return this.ratingField.value},init:function(){this.starList=DF.$(this.starList);this.ratingField=DF.$(this.ratingField);if(this.starList)for(var a=this.starList.getElementsByTagName("a"),b=0;b<a.length;b++)DF.evt.Event.addListener(a[b],"click",this._onStarClick.createDelegate(this));if(this.form){this.form=DF.$(this.form);DF.evt.Event.addListener(this.form,"submit",this.onSubmit.createDelegate(this))}}}})();
(function(){DF.namespace("DF.Twc.SearchBox");var a=DF.Twc.SearchBox=function(){var b={TWC:{col:"TimeWarnerCable_QA",pg:"",page:0,num:5,sendLvl:true},TWCBC:{col:"TwcBc",pg:"",page:0,num:5,sendLvl:false},FAQ:{col:"TimeWarnerCable_FAQ_QA",pg:"",page:0,num:2,sendLvl:false}},d=function(c){var f=$(c).attr("id"),e=b[f.substring(7)];f=$("#queryBox").val();var n=e.col,m="";if(e.sendLvl)m=DF.PageInfo.Level.string();$.ajax({type:"GET",url:"/Services/search.asmx/Search",data:{q:f,col:n,pos:e.page,lvl:m,pg:e.pg,
num:e.num},success:function(i){var j=$(c).find(".search_result-innerResult").get(0);$(c).find(".search_result-results").append(i);$(j).fadeOut(600).remove();i=$(c).find(".search_result-innerResult");j=i.height();$(c).children(".search_result-results").animate({height:j},600,"swing");i.stop().animate({left:0},400,"swing");$(c).find(".search_navRight").click(function(k){var l=$(this).parents(".gbl_question_box").get(0);k.preventDefault();e.page+=1;d(l)});$(c).find(".search_navLeft").click(function(k){var l=
$(this).parents(".gbl_question_box").get(0);k.preventDefault();e.page-=1;d(l)})},context:c,dataType:"html"})},h=function(){var c=$("#queryBox")[0];if(c.value===c.title||c.value===""){alert(DF.Twc.Search.errorMessages.searchInput);c.focus();return false}if($("#searchRadioDiv").hasClass("Search_SearchWeb")){DF.Twc.OmnitureHelper.trackLink(this,"e","google search");window.open("http://search.rr.com/search?qs="+c.value+"&clientId=aol-twc","RoadRunnerSearchWindow");return false}},g=function(){$("#Search_SiteRadio").click(function(){$("#searchRadioDiv").removeClass("Search_SearchWeb")});
$("#Search_GoogleRadio").click(function(){$("#searchRadioDiv").addClass("Search_SearchWeb")});$("#SearchForm").submit(h);$("#queryBox").hintInput()};return{init:function(){g()}}}();DF.evt.AddDomLoadEvent(a.init)})();
