function popUpCompareProductResultsGlossary(a){$popUp(a,"Glossary")}function popUpGlossaryTermTitle(a){$popUp(a,"_new")}function popUpWeeklyAd(a,b,c){b=$get(b);RegExp(/([a-zA-Z][0-9][a-zA-Z]\s*-*\s*[0-9][a-zA-Z][0-9])|(\d{5}(\s*-*\s*\d{4})?)/).test(b.value)&&popUpWeeklyAdForPostalCode(a,b.value.replace("-",""),c)}function popUpStoreDetails(a){$popUp(a,"_new",{width:1E3,height:600,scrollbars:true,resizable:true})}
function popUpHelpDetails(a){$popUp(a,"_new",{width:610,height:600,scrollbars:true,resizable:true})}function popUpPrintablePage(a){$popUp(a,"_new")}function popUpWeeklyAdForPostalCode(a,b,c){a=a+"?C="+b;b="EN";switch(c){case "fr-CA":b="FR";break}a=a+"&L="+b+"&T=ALL";$popUp(a,"_blank",{width:940,height:620,scrollbars:true,resizable:true});theForm.action=""}
function OpenContactUsConfirmationPopUp(a){if(a!=null&&a.length>0)window.location=a;$popUp("/CompanyInfo/ContactUs/SubmitContactUsPopUp.aspx",null,{resizable:true})}function OpenCustomerFeedbackConfirmationPopUp(a){if(a!=null&&a.length>0)window.location=a;$popUp("SubmitFeedbackPopup.aspx",null,{width:500,height:280,resizable:true})}function OpenCustomerReviewRatingPopUp(a){$popUp(a,"RateProduct",{width:730,height:600,scrollbars:true,resizable:true})}
function OpenEmailFriendConfirmationPopUp(a,b){window.location=a;$popUp("SubmitEmailPopUp.aspx?ET="+encodeURIComponent(b),null,{height:150,scrollbars:false})}function OpenPrivacyInquiryConfirmationPopUp(){$popUp("SubmitPrivacyFormPopUp.aspx",null)}function OpenQuestionConfirmationPopUp(){$popUp("/ResearchCentre/SubmitQuestionPopUp.aspx",null)}var popWinAdv;
function openWindowAdv(a,b,c,d,e,g,h,f,k){d=d?"yes":"no";popWinAdv!=null&&!popWinAdv.closed&&popWinAdv.close();popWinAdv=window.open(a,"PopUp","width="+b+",height="+c+",dependent=yes,resizable,scrollbars="+d+",titlebar="+e+",resizable="+g+",status="+h+",menubar="+f+",toolbar="+k)}function CountLeft(a,b,c){if(a.value.length>c)a.value=a.value.substring(0,c);b.value=a.value.length}
function GetValue(a,b){secondoryElementDiv=$get("ContactUsSubCategoryTxt");if(MultiArray[a.selectedIndex].length>1){if(secondoryElementDiv!=null&&secondoryElementDiv!=undefined)secondoryElementDiv.style.display=""}else if(secondoryElementDiv!=null&&secondoryElementDiv!=undefined)secondoryElementDiv.style.display="none";if(b.length>0)for(j=0;j<b.length;j++){b.remove(j);j--}for(i=1;i<MultiArray[a.selectedIndex].length;i++){opt=document.createElement("option");opt.text=MultiArray[a.selectedIndex][i];
b.options.add(opt)}}
function RefreshTabCustomerReviewOnSort(a,b,c,d,e,g){var h,f=a.attributes.SortBy.value,k=getQueryVariable("SortBy");h=getQueryVariable("SortOrder");if(a.id==c||a.id==d){g=f==k?h==e?g:e:k==null?e:g;b=window.location.pathname+"?category="+b+"&TabName=Tab_custReview&SortBy="+f+"&SortOrder="+g}else{a=a.attributes.PageNumber.value;g=h?h:g;b=window.location.pathname+"?category="+b+"&TabName=Tab_custReview&SortBy="+f+"&SortOrder="+g+"&PageNumber="+a}window.location.replace(b);return false}
function getQueryVariable(a){for(var b=window.location.search.substring(1).split("&"),c=0;c<b.length;c++){var d=b[c].split("=");if(d[0]==a)return d[1]}}function ExpandStore(a,b){var c=$get(a),d=$get(b);if(c.style.display=="inline"){c.style.display="none";if(d!=null)d.src="/images/plus.jpg"}else{c.style.display="inline";if(d!=null)d.src="/images/common/pictures/minus.jpg"}}function SetHiddenVariable(){if(CheckBoxPrice.value==true)hndCheckBox.value="1"}
function SavePollResults(a){a=GetPollID("QuestionPanel",a);if(a!=null&&a.length>0){var b=GetPollClientIDs(a);if(b!=null&&b.length>0){var c=GetSelectedPollOption(a,b[2]),d=document.getElementById(b[3]);BestBuy.Mccp.Commerce.Channel.Presenter.SpecialFeatures.Polls.Services.PollWebService.SavePollResults(a,c,b[0],b[1],d.value,b[4],SucceededCallback,FailedCallback)}}}
function GetPollID(a,b){for(var c="",d=b.parentNode,e=1;e<20;){if(d.getAttribute("id")!=null&&d.getAttribute("id").endsWith(a))break;else d=d.parentNode;e++}if(d!=null){d=d.getElementsByTagName("a");if(d!=null)for(e=0;e<d.length;e++){c=d[e].getAttribute("PollID");if(c!=null&&c.length>0)break}}return c}
function GetPollClientIDs(a){var b=null;if(document.pollClientIDArray!=null)for(var c=0;c<document.pollClientIDArray.length;c++){var d=document.pollClientIDArray[c].split(";");if(d!=null&&d.length>0)if(d[0]==a){b=d[1].split("#");break}}return b}
function ShowPollResults(a){a=GetPollID("QuestionPanel",a);if(a!=null&&a.length>0){var b=GetPollClientIDs(a);if(b!=null&&b.length>0){GetSelectedPollOption(a,b[2]);var c=document.getElementById(b[3]);BestBuy.Mccp.Commerce.Channel.Presenter.SpecialFeatures.Polls.Services.PollWebService.ShowPollResults(a,b[0],b[1],c.value,b[4],SucceededCallback,FailedCallback)}}}
function GetSelectedPollOption(a,b){var c="",d=document.getElementById(b);if(d!=null){d=document.getElementsByName(d.value+"_"+a);if(d!=null&&d.length>0)for(i=0;i<d.length;i++)if(d[i].checked==true)c=d[i].value}return c}function HTMLEntityDecode(a){var b=a.match(/&#\d+;?/g);if(b!=null)for(var c=0;c<b.length;c++){var d=String.fromCharCode(b[c].replace(/\D/g,""));a=a.replace(/&#\d+;?/,d)}return a}
function ParseAndReplacePollResults(a,b,c){var d=[],e=[],g=0;if(a!=null){var h=a.split("##");if(h!=null&&h.length>1){g=h[0];for(f=1;f<h.length;f++){a=h[f].split("|");d[HTMLEntityDecode(a[0])]=a[1]}}}c=document.getElementById(c);if(c!=null){a=c.value.split("##");if(a!=null&&a.length>1)for(f=0;f<a.length;f++){c=a[f].split("|");e[c[0]]=c[1]}}b=document.getElementById(b);if(b!=null){c=b.innerHTML;for(var f in d){for(var k in e)if(f.toString()==k.toString()&&f.toString()!=""){var l=RegExp(e[k]);l=c.replace(l,
d[f]).replace(l,d[f]);break}c=l}d=c.replace("TotalPollCount",g);b.innerHTML=d}}
function SucceededCallback(a){var b=new BestBuy.Mccp.Commerce.Channel.Presenter.SpecialFeatures.Polls.Services.PollResults;b=a;if(b.errorCode==0&&b!=null){var c=document.getElementById(a.clientIDForDivPollQuestionPanel),d=document.getElementById(a.clientIDForDivPollAnswerPanel);if(d!=null){var e=0;if(b.pollData!=null){var g=b.pollData.split("##");if(g!=null&&g.length>1)e=g[0]}if(e==0){if(b.pollId!=null){a=GetPollClientIDs(b.pollId);if(a!=null){if(a[6]!=null)document.getElementById(a[6]).style.display=
"none";if(a[0]!=null)document.getElementById(a[0]).style.display="none";if(a[5]!=null)document.getElementById(a[5]).style.display="block"}}}else{ParseAndReplacePollResults(b.pollData,a.clientIDForDivPollAnswerPanel,a.clientIDForHiddenPollQuestionsAndCounts);d.style.display="block"}c.style.display="none"}}}function FailedCallback(a){if(a!==null)document.getElementById(document.clientIDForlblErrorMessage).innerHTML="An error occurred: "+a.get_message()}typeof Sys!=="undefined"&&Sys.Application.notifyScriptLoaded();
function ShowQuestionPanel(a){a=GetPollID("QuestionPanel",a);if(a!=null&&a.length>0){a=GetPollClientIDs(a);if(a!=null){if(a[5]!=null)document.getElementById(a[5]).style.display="none";if(a[6]!=null)document.getElementById(a[6]).style.display="block";if(a[0]!=null)document.getElementById(a[0]).style.display="block"}}};
