function IsRTL(){var n=!1;return $("body").hasClass("rtl")&&(n=!0),n}function CheckWindowLoadEventAndRunFunction(n){window.addEventListener?window.addEventListener("load",n,!1):$(window).load(n)}$(function(){$.easing.easeInExpoPhone=function(n){return Math.pow(n,12/10)},$.easing.easeOutExpoPhone=function(n){return Math.pow(n,10/12)}}),String.prototype.endsWith=function(n){return n?this.indexOf(n,this.length-n.length)!==-1:!1},$.fn.textToggle=function(n,t){var e=IsRTL(),i=$(this).attr("id"),o=$("#"+i+" > :nth-child(1) > :nth-child(1)"),u,r,f;o.css({float:e?"right":"left"}),u=o.height(),r=$("#"+i+" > :nth-child(1)"),r.css({float:e?"right":"left",overflow:"hidden",width:"100%"}),f=r.height(),u>f?$("#"+i+" .expand").show():$("#"+i+" .expand").remove(),$("#"+i+" .expand").click(function(e){e.preventDefault();var o=$("#"+i+" > a"),s=u,h="collapse",c=t;o.hasClass("expand")||(s=f,h="expand",c=n),r.animate({"max-height":s+"px"},500,function(){o.attr("class",h+" inline"),o.text(c)})})},$.fn.rotator=function(n,t,i){$(this).each(function(){function o(){if(!e){var n=IsRTL();n?(r.eq(u).css({right:t+"px",top:"0px"}),r.eq(u).animate({opacity:"toggle",right:"0px"},{duration:i*1e3})):(r.eq(u).css({left:t+"px",top:"0px"}),r.eq(u).animate({opacity:"toggle",left:"0px"},{duration:i*1e3})),r.eq(f).animate({opacity:"toggle"},{duration:i*1e3}),f++,u++,f>=r.length&&(f=0),u>=r.length&&(u=0)}}var f=0,u=1,e=!1,r=$(this).children("li"),s;r.hide(),r.eq(f).show(),r.bind("mouseover",function(){e=!0}),r.bind("mouseout",function(){e=!1}),r.length>1&&(s=setInterval(o,n*1e3))})},function(n){n.fn.bingMap=function(t){var i=n.extend({showCircle:!0},t);return this.each(function(){function s(n,e){var p=6371,c=e.latitude*Math.PI/180,w=e.longitude*Math.PI/180,b=e.accuracy/1e3,l=parseFloat(b)/p,v=[],s,a,y;for(x=0;x<=360;x++)s=new Microsoft.Maps.Location(0,0),brng=x*Math.PI/180,s.latitude=Math.asin(Math.sin(c)*Math.cos(l)+Math.cos(c)*Math.sin(l)*Math.cos(brng)),s.longitude=(w+Math.atan2(Math.sin(brng)*Math.sin(l)*Math.cos(c),Math.cos(l)-Math.sin(c)*Math.sin(s.latitude)))*180/Math.PI,s.latitude=s.latitude*180/Math.PI,v.push(s);i.showCircle&&(a=new Microsoft.Maps.Color.fromHex("#"+i.accent),y=a.clone(),a.a=51,y.a=255,h(),t=new Microsoft.Maps.Polygon(v,{fillColor:a,strokeColor:y,strokeThickness:2}),u.entities.push(t)),r=new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(e.latitude,e.longitude),{icon:"/Images/me_poi.png",anchor:new Microsoft.Maps.Point(13,13)}),u.entities.push(r),f=Microsoft.Maps.LocationRect.fromLocations(v),o()}function o(){f&&u.setView({bounds:f})}function h(){f=null,t&&(u.entities.remove(t),t=null),r&&(u.entities.remove(r),r=null)}var e=n(this),t=null,r=null,f=null,u=new Microsoft.Maps.Map(this,{credentials:i.key,mapTypeId:Microsoft.Maps.MapTypeId.road,showCopyright:!1,showLogo:!1,showScalebar:!1,disableKeyboardInput:!0,showDashboard:i.showDashBoard==null?!0:i.showDashBoard});e.bind("updateLocation",s),e.bind("center",o)})}}(jQuery),function(n){n.fn.placeholder=function(t){function r(t){var i=t;n.trim(i.val())===""&&(i.addClass("placeholder").val(i.data("placeholderText")),i.data("locked",!0))}var i;if(t)i=t,n(this).data("placeholderText",i);else if(n(this).data("placeholderText")!=null)i=n(this).data("placeholderText");else return n(this);return n(this).val(i),n(this).addClass("placeholder"),n(this).data("locked",!0),this.focus(function(){n.trim(n(this).val())===n(this).data("placeholderText")&&n(this).data("locked")&&(n(this).removeClass("placeholder").val(""),n(this).data("locked",!1))}).blur(function(){r(n(this))}).keydown(function(t){switch(t.which){case 27:t.preventDefault(),r(),n(this).blur();break;default:return}})}}(jQuery),function(n){n.modalDialog=function(t){function c(){f=n(document).scrollLeft(),e=n(document).scrollTop(),n(window).bind("resize",u),n(document).bind("focusin",h),n(document).bind("keydown",s),l(),n(t).parent().show(),t.show(),u(),n(':input:enabled[type!="hidden"]',t).first().focus(),i!=null&&i.call(this)}function o(){a(),n(t).parent().hide(),t.hide(),n(document).unbind("keydown",s),n(document).unbind("focusin",h),n(window).unbind("resize",u),n(document).scrollLeft(f),n(document).scrollTop(e),r!=null&&r.call(this)}function u(){var i=(n(window).height()-t.height())/2,r=(n(window).width()-t.width())/2;t.css("top",i+"px"),t.css("left",r+"px")}function l(){t.after('<div class="background"/>')}function a(){t.next(".background").remove()}function s(n){n.which==27&&o()}function h(i){n(i.target).parents(".modal").length||(i.preventDefault(),i.shiftKey?n(':input:enabled[type!="hidden"], a',t).last().focus():n(':input:enabled[type!="hidden"], a',t).first().focus())}var f,e,i,r;t.css("position","fixed"),t.css("z-index","203"),t.bind("show",c),t.bind("hide",o),t.wrap('<div class="modal"/>'),n(".closePopup",t).click(function(t){t.preventDefault(),n(t.target).parents(".popup").trigger("hide")})},n.fn.modalDialog=function(){return this.each(function(){new n.modalDialog(n(this))})}}(jQuery),function(n){n.toggleSlider=function(t,i,r){function o(){var i=parseInt(n(".handle",t).css("left").replace("px",""));n(".inner.left",t).css("left",i-32+"px"),n(".inner.right",t).css("left",i+12+"px")}function f(r){i=r,i?(t.removeClass("off"),t.addClass("on"),n(".offStatus",t).hide(),n(".onStatus",t).show()):(t.removeClass("on"),t.addClass("off"),n(".onStatus",t).hide(),n(".offStatus",t).show())}function h(){t.removeClass("disabled"),n(".handle",t).draggable({disabled:!1})}function c(){t.addClass("disabled"),n(".handle",t).draggable({disabled:!0})}function s(){f(!i),i?e?n(".inner, .handle",t).animate({right:"+=34px"},250):n(".inner, .handle",t).animate({left:"+=34px"},250):e?n(".inner, .handle",t).animate({right:"-=34px"},250):n(".inner, .handle",t).animate({left:"-=34px"},250)}function l(){i||s()}function a(){i&&s()}function u(n){r!=null&&r(n,i)}var r=r,e=IsRTL(),i;f(i),n(".handle",t).draggable({axis:"x",containment:"parent",stop:function(){var s=parseInt(n(this).css("left").replace("px",""));s<14?(n(this).css("left","-4px"),o(),i&&(f(!i),u(t))):(n(this).css("left","30px"),o(),i||(f(!i),u(t)))},drag:function(){o()}}),n(t).bind("on",l),n(t).bind("off",a),n(t).bind("flip",s),n(t).bind("enable",h),n(t).bind("disable",c),n(".outer",t).click(function(r){r.preventDefault(),t.hasClass("disabled")||(f(!i),i?e?n(".inner, .handle",t).animate({right:"+=34px"},250,u(t)):n(".inner, .handle",t).animate({left:"+=34px"},250,u(t)):e?n(".inner, .handle",t).animate({right:"-=34px"},250,u(t)):n(".inner, .handle",t).animate({left:"-=34px"},250,u(t)))})},n.fn.toggleSlider=function(t,i){return this.each(function(){new n.toggleSlider(n(this),t,i)})}}(jQuery),function(n){n.dateFormatter=function(n,t,i){var f=i.am,r,u,e;return t.getHours()>11&&(f=i.pm),r=t.getHours(),r<10&&(r="0"+r),u=t.getMinutes(),u<10&&(u="0"+u),e=n.replace("{0}",t.getMonth()+1).replace("{1}",t.getDate()).replace("{2}",t.getFullYear()).replace("{3}",r).replace("{4}",u).replace("{5}",f)}}(jQuery),function(n){var t={set:function(n,t,i){var u="",r;i.expiresInDays!=null&&i.expiresInDays!=undefined&&(r=new Date,r.setDate(r.getDate()+i.expiresInDays),u="; expires="+r.toUTCString()),document.cookie=n+"="+escape(t)+u+"; path=/"},get:function(n){for(var i=document.cookie.split("; "),r,t=0;t<i.length;t++)if(r=i[t].split("=")[0],r==n)return i[t].split("=")[1];return null}};n.cookie=function(i,r,u){if(u=n.extend({},u),r==null||r==undefined)return t.get(i);t.set(i,r,u)}}(jQuery),function(n){n.checkbox=function(t,i){var i=i;n(t).change(function(){i!=null&&i(t,n(t).is(":checked"))})},n.fn.checkbox=function(t){return this.each(function(){new n.checkbox(n(this),t)})}}(jQuery),function(n){n.fn.hoverPeek=function(t){var t=n.extend({height:0,duration:500,delay:500},t);return this.each(function(){var i=n(this);i.hover(function(){i.addClass("hovered");var n=setTimeout(function(){i.peek({distance:t.height,duration:t.duration,easing:"easeOutQuart"})},t.delay);i.data("timeoutId",n)},function(){clearTimeout(i.data("timeoutId")),i.removeClass("hovered"),i.peek({distance:0,duration:t.duration,delay:t.delay,easing:"easeOutQuart"})})})}}(jQuery),function(n){n.fn.peek=function(t){var t=n.extend({duration:500,distance:0,easing:"easeOutQuart",delay:0,completed:function(){}},t);return this.each(function(){var i=n(this);setTimeout(function(){i.animate({top:t.distance+"px"},t.duration,t.easing,t.completed)},t.delay)})}}(jQuery);var rtl=$("html").attr("dir")=="rtl",isIpad=navigator.platform.indexOf("iPad")!=-1;$(function(){Modernizr.video.h264||Modernizr.video.ogg?$(".fillVideoContainer").show():($(".watchVideo").hide(),$(".videoPlayButton").hide(),$(".fillVideoFallback").show()),$(".commerceSignOut").each(function(){$(this).click(function(){$.get("/auth/commerce-signout")})}),$("div.fillVideoButtonContainer").hover(function(){isIpad||($(this).children(".videoPlayHoverButton").show(),$(this).children(".videoPlayButton").hide())},function(){isIpad||($(this).children(".videoPlayHoverButton").hide(),$(this).children(".videoPlayButton").show())}),$("a.hoverButton").hover(function(){isIpad||($(this).find("img.hover").css("display","inline-block"),$(this).find("img.normal").css("display","none"))},function(){isIpad||($(this).find("img.normal").css("display","inline-block"),$(this).find("img.hover").css("display","none"))})}),$(function(){$('#deviceFilter input[type="radio"]').change(function(){var t=$("#deviceFilter").attr("action");t=t.indexOf("?")>=0?t+"&":t+"?",window.location.href=t+"wpv="+$("#deviceFilter input:checked").val()}),$('#searchButton[type="image"]').click(function(n){n.preventDefault(),$('#searchInput[type="text"]').data("locked")||$(this).parents("form").submit()}),$('#searchInput[type="text"]').blur(function(){$.trim($(this).val())===""&&$(this).placeholder(GlobalSettings.SearchPlaceHolder)}).keydown(function(n){switch(n.which){case 13:n.preventDefault(),$.trim($(this).val())===""||$('#searchInput[type="text"]').data("locked")||$(this).parents("form").submit();break;default:return}})}),$(function(){function u(t){$target=$(t.target),$target.parents(".#userArea .dropmenu").length==0&&n.trigger("hide")}function f(r){var u=!1;switch(r.which){case 27:r.preventDefault(),n.trigger("hide");return;case 9:r.shiftKey?t--:t++,u=!0;break;case 38:t--;break;case 40:t++;break;default:return}if(u&&(t<0||t>=i.length)){n.trigger("hide");return}t<0?t=0:t>=i.length&&(t=i.length-1),r.preventDefault(),i[t].focus()}var n=$("#userArea .dropmenu"),i=$("a",n),t=0,r=!1;n.length!=0&&($("li.menuitem.activatable",n).bind("focusin mouseenter",function(){$("li.menuitem.active",n).removeClass("active"),$(this).addClass("active")}),$("li.activatable",n).click(function(n){$(n.target).is("a")||(n.preventDefault(),document.location=$("a",$(this)).attr("href"))}),n.bind("show",function(){n.hasClass("visible")||(t=0,$("li.menuitem.active",n).removeClass("active"),$(document).bind("keydown",f),$(document).bind("click",u),n.addClass("visible"))}),n.bind("hide",function(){n.hasClass("visible")&&($(document).unbind("keydown",f),$(document).unbind("click",u),n.removeClass("visible"),r=!1)}),n.bind("focusin mouseenter",function(t){n.hasClass("visible")||(t.preventDefault(),n.trigger("show"))}),n.bind("mouseup",function(){r=!0}),n.bind("blur mouseleave",function(t){r||(t.preventDefault(),n.trigger("hide"))}))}),$(function(){$("ul.newsticker").rotator(10,150,.5)}),$(function(){function r(){$(document).unbind("keydown",u),$(".videoPlayerPopup").hide(),$(".videoPlayer").hide()}function u(n){n.which==27&&r()}var t,i,n,f;$("iframe[data-videoUrl]").each(function(){function t(){$(n).css("visibility","visible"),$(n).siblings(".inlineVideoImage").fadeOut()}function i(){$(n).css("visibility")=="visible"&&$(n).hide()}if(!Modernizr.video.h264&&!Modernizr.video.ogg||isIpad)return!1;var n=this;$(this).load(function(){setTimeout(t,300)}),$(this).attr("src",$(this).attr("data-videoUrl")),window.onbeforeunload=i}),$("a.fillVideoCloseButton").click(function(){var n,i,r,t;if(!Modernizr.video.h264&&!Modernizr.video.ogg)return!1;n=$(this).siblings("iframe"),i=document.getElementById($(n).attr("id")),i.contentWindow.postMessage("video.pause",$(n).attr("src").split("/",3).join("/")),$(n).fadeOut(),r=$(this).closest("div.fillVideoPlayerContainer"),$(r).fadeOut(),$(n).parent().css("position","absolute"),$(n).closest(".fillVideoPlayerContainer").css("position","absolute"),$(n).closest(".content").css("position","relative"),t=$(n).closest(".group"),t.css("position","relative"),t.find(".innerContent").css("visibility","visible"),t.find(".panelBackgroundImage").css("visibility","visible")}),$("a.fillVideoPlayButton").click(function(){var r,t,n,u,i;if(!Modernizr.video.h264&&!Modernizr.video.ogg||!navigator.onLine)return!1;if($("body").attr("data-mobileBrowser")=="true"||isIpad)return location.href=$(this).attr("data-videoMobileUrl"),!1;r=$(this).attr("data-videoMode"),t=$(this).closest(".panel"),r=="FillGroup"&&(t=$(this).closest(".group")),n=$(t).children("div.fillVideoPlayerContainer").find("div.fillVideoPlayerGroup"),$(n).width($(this).attr("data-videoWidth")),$(n).height($(this).attr("data-videoHeight")),$(n).css("margin-top","-"+$(this).attr("data-videoHeight")/2+"px"),$(n).css("margin-left","-"+$(this).attr("data-videoWidth")/2+"px"),$(n).find(".fillVideoIframe").remove(),u='<iframe data-videoAtlasId="'+$(this).attr("data-videoAtlasId")+'" width="'+$(this).attr("data-videoWidth")+'" height="'+$(this).attr("data-videoHeight")+'" id="fillVideo_'+$(this).attr("data-videoId")+'" style="visibility:hidden; z-index:81" class="fillVideoIframe fillVideoGroup" frameborder="0" scrolling="no" allowTransparency="true" src="'+$(this).attr("data-videoSource")+'"></iframe>',$(n).append(u),i=$(this).closest("div.panel").css("background-color"),i=="transparent"&&(i="#fff"),$(n).parent().height($(t).outerHeight()).css("background-color",i),$(n).parent().fadeIn(),$(n).fadeIn(),iframe=$(n).find("iframe");function f(){$(iframe).css("visibility","visible")}$(iframe).load(function(){setTimeout(f,300),$(t).find(".innerContent").css("visibility","hidden"),$(t).find(".panelBackgroundImage").css("visibility","hidden")}),$(iframe).hover(function(){$(this).siblings("a.fillVideoCloseButton").show()},function(){$(this).siblings("a.fillVideoCloseButton").hide()}),$(iframe).parent().find("a.fillVideoCloseButton").mouseover(function(){$(this).siblings("iframe").trigger("mouseover")}),$(iframe).parent().find("a.fillVideoCloseButton").mouseout(function(){$(this).siblings("iframe").trigger("mouseout")}),$(iframe).parent().find("a.fillVideoCloseButton").mousemove(function(){$(this).siblings("iframe").trigger("mousemove")});function e(){$(iframe).css("visibility")=="visible"&&$(iframe).hide()}window.onbeforeunload=e}),$(".watchVideo a[data-videoPlayerUrl]").click(function(){$(".videoPlayerPopup").length==0?$('<div class="videoPlayerPopup"><div>').appendTo("body"):$(".videoPlayerPopup").show();var n=$(this).data("iframe");n==null&&(n=$('<iframe class="videoPlayer" frameborder="0" scrolling="no" allowTransparency="true" src='+$(this).attr("data-videoPlayerUrl")+"></iframe>").appendTo("body"),$(this).data("iframe",n)),n.show(),$(document).bind("keydown",u)}),window.location.hash&&(t="#play-",window.location.hash.slice(0,t.length)==t&&(i=window.location.hash.slice(t.length),$("a[data-videoId='"+i+"']").length>0&&$("a[data-videoId='"+i+"']").trigger("click"))),n=0,$(window).bind("message",function(t){var e;if(t.originalEvent.origin.endsWith(GlobalSettings.CdnBase)){var o=t.originalEvent.data.split("."),u=o[o.length-1],i,f=!1;if($("iframe#fillVideo_"+u).length>0?(i=$("iframe#fillVideo_"+u),f=!0):i=$("iframe#inlineVideo_"+u),f||!(i.attr("src").toLowerCase().indexOf("as=1")>=0))if(t.originalEvent.data.indexOf("video.close")>=0)r();else if(t.originalEvent.data.indexOf("video.start")>=0)WpsTracking.omnitureCustomTrack(WpsTracking.properties.videoStart,u),e=$(i).attr("data-videoAtlasId"),e&&e!=""&&WpsTracking.atlasTrack(e);else if(t.originalEvent.data.indexOf("video.end")>=0){if(WpsTracking.omnitureCustomTrack(WpsTracking.properties.videoEnd,u),f){function s(){$(i).siblings("a.fillVideoCloseButton").trigger("click")}setTimeout(s,10)}}else if(t.originalEvent.data.indexOf("video.progress.25")>=0)WpsTracking.omnitureCustomTrack(WpsTracking.properties["video25%"],u);else if(t.originalEvent.data.indexOf("video.progress.50")>=0)WpsTracking.omnitureCustomTrack(WpsTracking.properties["video50%"],u);else if(t.originalEvent.data.indexOf("video.progress.75")>=0)WpsTracking.omnitureCustomTrack(WpsTracking.properties["video75%"],u);else if(t.originalEvent.data.indexOf("video.error")>=0){if(WpsTracking.omnitureCustomTrack(WpsTracking.properties.videoError,u),f){function s(){$(i).siblings("a.fillVideoCloseButton").trigger("click")}setTimeout(s,10)}}else t.originalEvent.data.indexOf("video.fullscreen-on")>=0?f?(n=$(document).scrollTop(),$(i).addClass("fillVideoIframeFull"),$("body").css("overflow","hidden"),$(document).scrollTop(0),$(i).parent().css("position","static"),$(i).closest(".content").css("position","static"),$(i).closest(".fillVideoPlayerContainer").css("position","static"),$(i).closest(".panel").css("position","static"),$(i).closest(".group").css("position","static"),$(i).height("100%"),$(i).width("100%")):(n=$(document).scrollTop(),$(i).addClass("inlineVideoPlayerFull"),$(i).parent().css("position","static"),$(i).closest(".content").css("position","static"),$(i).closest(".innerContent").css("position","static"),$(i).closest(".panel").css("position","static"),$(i).closest(".group").css("position","static"),$("body").css("overflow","hidden"),$(document).scrollTop(0)):t.originalEvent.data.indexOf("video.fullscreen-off")>=0&&(f?($(i).removeClass("fillVideoIframeFull"),$("body").css("overflow","auto"),$(document).scrollTop(n),$(i).parent().css("position","absolute"),$(i).closest(".fillVideoPlayerContainer").css("position","absolute"),$(i).closest(".content").css("position","relative"),$(i).closest(".panel").css("position","relative"),$(i).closest(".group").css("position","relative")):($("iframe#inlineVideo_"+u).removeClass("inlineVideoPlayerFull"),$(i).parent().css("position","relative"),$(i).closest(".innerContent").css("position","relative"),$(i).closest(".content").css("position","relative"),$(i).closest(".panel").css("position","relative"),$(i).closest(".group").css("position","relative"),$("body").css("overflow","auto"),$(document).scrollTop(n)))}},!0)}),$(function(){$acceptTermsOfServiceCheckbox=$(".manageTermsOfService #acceptTermsOfServiceCheckbox"),$acceptTermsOfServiceButton=$(".manageTermsOfService #acceptTermsOfService input#accept"),$acceptTermsOfServiceCheckbox.change(function(){$("#acceptTermsOfService input#accept").attr("disabled",!$acceptTermsOfServiceCheckbox.attr("checked"))}),$acceptTermsOfServiceButton.attr("disabled",!0)}),$(function(){$videoTitleLinks=$(".videoTitle > a"),$videoTitleLinks.mouseover(function(){$(this).parent().parent().find(".hoverButton").trigger("mouseover")}),$videoTitleLinks.mouseout(function(){$(this).parent().parent().find(".hoverButton").trigger("mouseout")})}),$(function(){$("body.support.topicPage").length&&((Modernizr.video.h264||Modernizr.video.ogg)&&$("video[data-videoPlayerUrl]").each(function(){var n=$(this).attr("data-videoPlayerUrl"),t=$(this).attr("data-videoPlayerHeight"),i=$(this).attr("data-videoPlayerWidth"),r="inlineVideo_"+$(this).attr("data-videoId");$(this).parent().prepend('<iframe id="'+r+'" class="inlineVideoPlayer" height="'+t+'px" width="'+i+'px" frameborder="0" scrolling="no" allowTransparency="true" src='+n+"></iframe>"),$(this).remove()}),$("#toc a").each(function(n,t){var i=$(t).attr("href").toLowerCase();i==location.pathname.toLowerCase()&&$(t).addClass("active")}),$("ul.faqList > li > div.answer").hide(),$("ul.faqList > li > div.question > a > span.arrow").html("►"),$("ul.faqList > li > div.question > a").click(function(n){n.preventDefault();var r=$(this).parent().parent(),t=r.find("div.answer"),i=$(this).find("span.arrow");t.is(":visible")?(i.html("►"),t.hide()):($("ul.faqList > li > div.answer").hide(),$("ul.faqList > li > div.question > a > span.arrow").html("►"),i.html("▼"),t.show())}),$("ul.faqList > li > div.question > a").first().click(),$("#feedbackRating a").click(function(n){n.preventDefault(),$("#feedbackComment").append("<iframe src='"+$(this).attr("data-iframeUrl")+"' />"),$("#feedbackComment").show(),$("#feedbackRating").hide()}))}),$(function(){$("input[type=checkbox]").each(function(){$(this).after('<input type="button" class="checkbox" />'),$(this).hide(),$(this).syncControlStates(),$(this).next("input[type=button]").click(function(n){$(this).toggleClass("checked"),$(this).prev("input[type=checkbox]").attr("checked",$(this).hasClass("checked")),$(this).prev("input[type=checkbox]").change(),$("input[type=checkbox]").syncControlStates(),n.stopPropagation()})}),$("input[type=radio]").each(function(){$(this).after('<input type="button" class="radiobutton" />'),$(this).hide(),$(this).syncControlStates(),$(this).next("input[type=button]").click(function(n){$(this).hasClass("checked")||($(this).toggleClass("checked"),$(this).prev("input[type=radio]").attr("checked",!0),$(this).prev("input[type=radio]").change(),$("input[type=radio]").syncControlStates()),n.stopPropagation()})}),$("input[type=checkbox]").change(function(){$("input[type=checkbox]").syncControlStates()}),$("input[type=radio]").change(function(){$("input[type=radio]").syncControlStates()})}),$.fn.syncControlStates=function(){$(this).each(function(){$(this).is(":checked")?$(this).next("input[type=button]").addClass("checked"):$(this).next("input[type=button]").removeClass("checked"),$(this).attr("disabled")?$(this).next("input[type=button]").attr("disabled","disabled"):$(this).next("input[type=button]").attr("disabled","")})},$(function(){$("#switchMobileView").click(function(){$.cookie("wpView","mobile"),document.location.reload()})}),function(n){var r=0,t=-1,i=[];n.searchSuggestions=function(u,f,e){function w(t){if(!(t.length<2)){var r=i[t];r==null?n.ajax({type:"GET",dataType:"html",url:f+"?q="+encodeURIComponent(t),success:function(n){i[t]=n,a(n)}}):a(r)}}function a(t){var u=n("ul:eq(0)",o),r,i,f;if(u.html(""),r=n.parseJSON(t),r.length==0)s();else{for(i=0;i<r.length;i++)f=r[i],u.append(k(f.Title)),n("li:eq("+i+") a",u).text(f.Title);v()}}function v(){if(!c){if(u.val().length<2||n("ul:eq(0) li").length==0)return;t=-1,n(document).bind("click",y),n(document).bind("keydown",p),c=!0,h=!1,o.show()}}function s(){n(document).unbind("click",y),n(document).unbind("keydown",p),c=!1,o.hide()}function y(t){$target=n(t.target),$target.parents(".searchSuggestions").length==0&&s()}function p(i){var r=!1,f;switch(i.which){case 9:u.context==i.target?s():h&&(i.preventDefault(),s(),u.next().focus());return;case 27:i.preventDefault(),s(),u.focus();return;case 38:t--,r=!0;break;case 40:t++,r=!0}r&&(i.preventDefault(),h=!0,t<0?(t=-1,u.focus()):(f=n("li a",o),t>=f.length&&(t=f.length-1),n("li a",o).eq(t).focus()))}function b(){var f=u.position().left+"px",e=u.position().top+u.outerHeight()+"px",t="searchSuggestions"+r++,c='<div id="'+t+'" class="searchSuggestions" style="left: '+f+"; top: "+e+';"><ul></ul></div>',i;u.parents("form").append(c),o=n("#"+t),i=u.outerWidth()-parseInt(o.css("border-left-width"))-parseInt(o.css("border-right-width")),o.width(i),o.focusin(function(){h=!0}),o.focusout(function(t){h&&n(t.target).parents(".searchSuggestions").length==0&&s()})}function k(n){return'<li><a data-os="combinedSearch" data-ov="'+encodeURIComponent(n)+'" href="'+e+"?q="+encodeURIComponent(n)+'"></a></li>'}var o,h=!1,c=!1,l=null;b(),i[""]="[]",u.keyup(function(n){if(n.which==27){n.preventDefault();return}v(),clearTimeout(l),l=setTimeout(function(){w(u.val())},250)})},n.fn.searchSuggestions=function(t,i){return this.each(function(){new n.searchSuggestions(n(this),t,i)})}}(jQuery)