(function(a){a.arrayDiff=function(a,b){var f=[];a.forEach(function(a){-1===b.indexOf(a)&&f.push(a)});b.forEach(function(b){-1===a.indexOf(b)&&f.push(b)});return f};a.arrayPartialDiff=function(a,b){var f=[];a.forEach(function(a){-1===b.indexOf(a)&&f.push(a)});return f};a.arrayIntersection=function(a,b){var f=[];a.forEach(function(a){-1!==b.indexOf(a)&&f.push(a)});return f};a.arrayUnique=function(a){var b=[];a.forEach(function(a){-1===b.indexOf(a)&&b.push(a)});return b};a.arrayDupes=function(a){var b=
[],f=[];a.forEach(function(a){-1===b.indexOf(a)?b.push(a):f.push(a)});return f};a.cloneObject=function(c){var b,f,h={};for(b in c)c.hasOwnProperty(b)&&(f=c[b],h[b]=Array.isArray(f)?f.slice(0):f&&"object"===typeof f?a.cloneObject(f):f);return h};a.toQueryString=function(a){var b,f=[];for(b in a)a.hasOwnProperty(b)&&(a[b]||0===a[b])&&f.push([b+"="+a[b]]);return f.length?"?"+f.join("&"):""};a.getFileExtension=function(){var a=/.([\w_\-\+~#]+)$/;return function(b){b=(b||"").toLowerCase();return a.test(b)?
b.match(a)[1]:""}}();a.pluck=function(a,b){return a.map(function(a){return a[b]})};a.fn.pluck=function(c){return a.map(this,function(a){return a.getAttribute(c)})};if(!"".capitalize)String.prototype.capitalize=function(){return this.replace(/\b[a-z]/g,function(a){return a.toLocaleUpperCase()})};RegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};var i=this.TaskManager=function(){var a={};return{getTask:function(b){return a[b]},taskExists:function(b){return!!a[b]},register:function(b){i.taskExists(b.name)&&
i.remove(b.name);a[b.name]=b},run:function(b,f){var h=a[b];if(h)return h.callback_fn.call(h,h.data||f)},runAll:function(b,f){Object.keys(a).forEach(function(h){if((h=a[h])&&(!b||h.namespace===b))h.callback_fn&&h.callback_fn.call(h,h.data||f)})},remove:function(b){var f=a[b];if(f&&(delete a[b],f.cleanup_fn))return f.cleanup_fn.call(f,f.data)},killAll:function(b){Object.keys(a).forEach(function(f){var h=a[f];if(h&&(!b||h.namespace===b))delete a[f],h.cleanup_fn&&h.cleanup_fn.call(h,h.data)})}}}(),j=
function(a,b){this.period=b||15E3;this.options=a;var f=a.cleanup_fn||function(){};this.options.cleanup_fn=function(a){this.instance.stop();f(a)};a.instance=this;i.taskExists(this.options.name)&&i.remove(this.options.name);this.schedule()};a.extend(j.prototype,{schedule:function(c){if(c)this.period=c;this.stop();this.timer_id=setTimeout(a.proxy(this.run,this),this.period);i.taskExists(this.options.name)||i.register(this.options)},stop:function(){if(this.timer_id)clearTimeout(this.timer_id),this.timer_id=
null},run:function(){this.stop();i.run(this.options.name);this.options.auto_reschedule&&this.schedule()},destroy:function(){this.stop();i.remove(this.options.name)}});a.extend(i,{schedule:function(a,b){return new j(a,b)},reschedule:function(a,b){if(i.taskExists(a)){var f=i.getTask(a);f.instance instanceof j&&f.instance.schedule(b)}},taskIsScheduled:function(a){if(i.taskExists(a))return a=i.getTask(a),a.instance instanceof j&&!a.timer_id},pause:function(a){i.taskExists(a)&&(a=i.getTask(a),a.instance instanceof
j&&a.instance.stop())}});(function(){var c={},b,f=this.HistoryManager={onRouteChange:null,init:function(){a.history?(f.size=window.location.hash?-1:0,a.history.init(f.handleHash,{unescape:",/&=?"})):a.history={load:function(a){window.location.href=a}}},addRoute:function(a,d){c[a]=d},setDefault:function(a){b=a},handleHash:function(a){var d,l={};a&&(a=a.split("?"),d=a[0],1<a.length&&a[1].split("&").forEach(function(a){a=a.split("=");l[a[0]]=a[1]}));f.onRouteChange&&f.onRouteChange();if(c[d])c[d](l,
d);else b&&b(l,d);f.size++},back:function(){0>=f.size?b&&b():(f.size--,history.back())},load:function(){a.history.load.apply(this,arguments)}}})();this.PropertyBag=function(){var c={};this.add=function(b,f){c[b]?a.extend(c[b],f):c[b]=f};this.remove=function(a){c[a]&&delete c[a]};this.length=function(){return Object.keys(c).length};this.removeProperty=function(a,f){c[a]&&void 0!==c[a][f]&&(delete c[a][f],Object.keys(c[a]).length||delete c[a])};this.get=function(a){return c[a]};this.getAll=function(){return c};
this.empty=function(){c={}}}})(jQuery);
(function(a){var i=this.GlobalResources?GlobalResources.constants:{};a.fn.toggler=function(d){var l=a(this).hide(),e=l.is(":checked"),g=a("<div/>",{"class":"toggler "+(e?"on":"off"),role:"checkbox",tabindex:0,"aria-checked":e?"true":"false"}),b=a("<div/>",{"class":"greything"}).appendTo(g);e&&b.css({left:32});g.bind({click:function(){l[0].checked=e=!l[0].checked;b.animate({left:e?32:0},100,function(){d.onChange&&d.onChange.call(g,e)});g.toggleClass("on off").attr({"aria-checked":e?"true":"false"})},
keydown:function(e){(13===e.keyCode||32===e.keyCode)&&a(this).trigger("click")}});l.replaceWith(g).appendTo(g);return l};a.fn.overlayText=function(){return a(this).not('[data-overlay-text-enabled="true"]').each(function(d,l){var e=a(this),g=this.getAttribute("data-overlay-text"),b=(g?a("<label/>",{text:g}):a('label[for="'+this.getAttribute("id")+'"]')).addClass("overlay_text"),c=e.val(),k=parseInt(e.css("padding-top"),10),g=parseInt(e.css("padding-bottom"),10),f=parseInt(e.css("padding-left"),10),
h=function(){return!/[^\s]+/.test(e.val())},i={hide:function(){b.hide();h()||e.trigger("valuechange::content")},show:function(a){a=a||{};c="";e.val("").addClass("empty").trigger("valuechange::empty");a.focus?e.focus():(a=e.position(),b.css({left:a.left+f,top:a.top+k}),b.show());return e},check:function(){var a=e.val();c!==a&&(c=a,h()?e.addClass("empty").trigger("valuechange::empty"):e.removeClass("empty").trigger("valuechange::content"))}};this.setAttribute("data-overlay-text-enabled","true");b.insertBefore(e).css({lineHeight:"textarea"===
l.tagName.toLowerCase()?null:e.outerHeight()-k-g+"px",maxWidth:e.innerWidth(),maxHeight:Math.max(e.innerHeight(),parseInt(e.css("line-height"),10)),overflow:"hidden"}).click(function(){e.focus()});e.bind({"focus keydown":i.hide,"keypress keyup click change":i.check,drop:function(){i.hide();i.check()},blur:function(){h()&&i.show()}});e.data({reset:i.show,val:function(a){e.val(a);h()?(b.show(),e.addClass("empty")):(b.hide(),e.removeClass("empty"))}});i[h()?"show":"hide"]()})};a.fn.autoGrow=function(){return a(this).each(function(){var d=
a(this),b=d.height(),e;d.data("orig_height",b).css({minHeight:b}).addClass("autogrow").bind("keydown keypress keyup change blur",function(){var a=d.height();null==e&&(e=d.innerHeight()==d[0].scrollHeight||d.innerHeight()==d[0].scrollHeight+1?d[0].scrollHeight-d.height():0);d.height("auto").height(d[0].scrollHeight-e);d.height()!==a&&d.trigger("autogrow::resize")})})};a.fn.limitLength=function(){var d=function(a){var e=parseInt(this.getAttribute("maxlength"),10)||256;if(this.value.length>e)this.value=
this.value.substring(0,e),a.preventDefault()};return a(this).bind({keypress:d,keyup:d,blur:d,keydown:function(a){this.value.length===(parseInt(this.getAttribute("maxlength"),10)||256)&&32<a.which&&a.preventDefault()}})};a.fn.autoselect=function(){return a(this).bind("focus click mouseup",function(a){this.select();a.preventDefault();a.stopPropagation()})};var j=this.Tooltip=function(){var d,b,e,g={init:function(){d=document.getElementById("jq-ads-tooltip")?a(document.getElementById("jq-ads-tooltip")):
g.createElement();b=d.find(".jq-ads-tooltip-content")},createElement:function(){var e=a("<div/>",{"class":"tooltip",id:"jq-ads-tooltip"}).html('<span class="pointer"></span><div class="jq-ads-tooltip-content"></div>').appendTo(document.body);e.bind({"mouseenter.interactive":function(){e.data("interactive-timer")&&(clearTimeout(e.data("interactive-timer")),e.removeData("interactive-timer"))},"mouseleave.interactive":function(){j.forceHide()},click:function(a){a.stopPropagation()}});return e},onHide:function(){var a=
d.data("options");a&&a.onHide&&a.onHide.call(d.data("relative"),d.find(".jq-ads-tooltip-content").children());d.removeData("options")},reposition:function(a){d.position({my:a+" top",at:a+" bottom",of:this,offset:"0 5",collision:"none"})},setTimer:function(a){e&&clearTimeout(e);e=setTimeout(a,750)},killTimer:function(){e&&(clearTimeout(e),e=null)}};a(document.body).bind("click.tooltip",function(){j.forceHide()});a(document).bind("keydown.tooltip",function(a){27===a.keyCode&&j.forceHide()});return{captureTargets:function(e,
c){e=e.not(".has_tooltip");e.length&&(c=a.extend({},{position:"left",interactive:!1},c),e.each(function(){var e=a(this),m=this.getAttribute("data-tooltip-contents")?a(this.getAttribute("data-tooltip-contents")):this.getAttribute("data-tooltip")||this.getAttribute("title"),f=this.getAttribute("data-tooltip-position")||c.position;null==m||0===m.length||"string"===typeof m&&!/[^\s]+/.test(m)||(this.removeAttribute("title"),m instanceof jQuery?m.data("parent",m.parent()):this.getAttribute("data-tooltip")&&
(m=null),e.addClass("has_tooltip").bind({mouseenter:function(){g.setTimer(function(){if(e.is(":visible")&&!e.hasClass("ui-custom-active")){g.init();var a=b.children();a.length&&a.data("parent")&&a.appendTo(a.data("parent"));b.empty().append(m||e.attr("data-tooltip"));c.beforeShow&&c.beforeShow.call(e,m||b);d.stop(!0,!0).removeClass("left right").addClass(f).fadeIn(120,function(){c.onShow&&c.onShow()});d.data("relative",e);d.data("options",c);g.reposition.call(e,f)}})},mouseleave:function(){g.init();
g.killTimer();c.interactive?d.data("interactive-timer",setTimeout(function(){d.stop(!0,!0).fadeOut(120,g.onHide)},50)):d.stop(!0,!0).fadeOut(120,g.onHide)}}))}))},forceHide:function(a){g.init();a&&g.killTimer();d.stop(!0,!0).fadeOut(0,g.onHide)},reposition:function(){d&&d.is(":visible")&&g.reposition.call(d.data("relative"),d.hasClass("left")?"left":"right")}}}();this.PopupMessage={create:function(d,b){var b=a.extend({},{position:"left",closeButton:!0},b),e=b.targets||a(d.attr("data-targets"));if(e.length){var g=
b.type||d.attr("data-type"),c=b.title||d.attr("data-title"),f=b.position||d.attr("data-message-position"),k=a("<div/>",{"class":"jq-ads-popup-message"+(c?" with_title":"")+(g?" "+g:"")}).html('<span class="pointer"></span><div class="jq-ads-message-content"><div class="body"></div></div>'),h=k.find(".jq-ads-message-content"),i=function(){k.stop(!0,!0).fadeOut(100,function(){b.onHide&&b.onHide()})};c&&(h.prepend(a("<header>"+c+"</header>")),k.addClass("with_title"));b.closeButton&&(h.append(a('<span class="close"></span>')),
h.find(".close").bind("click",i));e.each(function(){var e=a(this);if(!(void 0===d||0===d.length||"string"===typeof d&&!/[^\s]+/.test(d))){"string"!==typeof d&&d.data("parent",d.parent());var g={"popup::open":function(a,g){g&&d.attr("id")!=g||(b.beforeShow&&b.beforeShow(),k.appendTo(b.attach_global?document.body:e.offsetParent()),h.find(".body").append(d),k.stop(!0,!0).removeClass("left right").addClass(f).fadeIn(100,function(){b.onShow&&b.onShow(d,e)}),k.position({my:f+" top",at:f+" bottom",of:e,
collision:"none",offset:"0 12"}),a.stopPropagation())}};b.eventOpen&&(g[b.eventOpen]=g["popup::open"]);g["popup::close"]=function(a){i();a.stopPropagation()};b.eventClose&&(g[b.eventClose]=g["popup::close"]);e.bind(g);("true"===(d.attr("data-autoshow")||"").toLowerCase()||b.autoshow)&&e.trigger("popup::open",[d.attr("id")])}})}}};this.TimeUtils=function(){var a=!0,b={toReadableTime:function(e){var b=a&&11<e.getHours(),c=a?e.getHours()%12||12:e.getHours(),e=e.getMinutes()+"";return c+":"+(1===e.length?
"0":"")+e+(a?" "+(b?i.post_meridiem:i.ante_meridiem):"")}};return{set12HourClock:function(e){a=e},relativize:function(a){var d=new Date,c=d.getTime(),f=d.getFullYear(),k=(new Date(f,d.getMonth(),d.getDate())).getTime(),h=k-864E5,q=i.months_short.split(",");a.each(function(a,e){var d=new Date(parseInt(e.getAttribute("datetime"),10)),g=e.getAttribute("data-exact"),j=d.getTime(),n=c-j,w=d.getFullYear(),x=w===f,p="";for(g||j<h?p=Mustache.to_html(x?i.datetime_format:i.datetime_format_with_year,{time:b.toReadableTime(d),
month:q[d.getMonth()],day:d.getDate(),year:w}):12E4>=n?p=i.moments_ago:3E6>=n?p=Mustache.to_html(i.minutes_ago,{minutes:Math.ceil(n/6E4)}):54E5>=n?p=i.about_an_hour_ago:j>=k?p=Mustache.to_html(i.hours_ago,{hours:Math.ceil(n/36E5)}):j>=h&&(p=Mustache.to_html(i.yesterday_at,{time:b.toReadableTime(d)}));e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(p))})}}}();var c=this.FlashMessage=function(d){this.options=d||{};var b=this,e,g,c={reposition:function(){e.css({top:-e.outerHeight(),
marginLeft:-e.outerWidth()/2})},init:function(d){e=a("#flash_message").length?a("#flash_message"):a("<div/>",{id:"flash_message"}).appendTo(document.body);e.data("flash")&&e.data("flash").detach();e.data("flash",b);e.html(d||b.options.text).shorten();b.options.type&&e.addClass(b.options.type);b.options.icon&&b.options.icon.parent()!=e&&b.options.icon.prependTo(e);b.options.off_button&&(a("<div/>",{id:"off_button_div"}).appendTo(e),a("#off_button_div").on("click",function(){b.hide()}));c.reposition()},
detach:function(){c.clearTimer();b.options.icon&&b.options.icon.detach();b.options.type&&e.removeClass(b.options.type);e.empty();e.removeData("flash")},clearTimer:function(){g&&(clearTimeout(g),g=null)}};this.toElement=function(){return e};this.show=function(a){c.init(a);if(this.options.onShow)this.options.onShow();e.stop(!0).animate({top:-3},1);this.options.autohide&&(c.clearTimer(),g=setTimeout(this.hide,d.hideTime||6E3))};this.hide=function(){if(b.options.onHide)b.options.onHide();c.clearTimer();
e.stop(!0).animate({top:-e.outerHeight()},133,c.detach)};this.detach=c.detach};this.GlobalSpinner=function(){var a,f,e,g={init:function(){a=new b({yoffset:-16});f=new c({text:i.spinner_loading,icon:a.toElement(),type:"global_spinner",onShow:a.start,onHide:a.stop})}};return{show:function(a){f||g.init();if(!f.toElement()||!f.toElement().data("flash"))e=!0,f.show(a)},hide:function(){f&&f.toElement().hasClass("global_spinner")&&e&&f.hide();e=!1}}}();this.Fling=function(d){var b,e=null,g=0,c=1,f={piece_size:40,
pixel_speed:150,interval:20,yoffset:0,autorun:!1,onComplete:function(){}},d=d||{},k;for(k in f)f.hasOwnProperty(k)&&(d[k]=d[k]||f[k]);c=d.pixel_speed/(1E3/d.interval);b=d.element;g=b.width()+d.piece_size;b.css({backgroundPosition:g+" "+d.yoffset+"px",width:d.size,height:d.size}).addClass(d.spinner_class);var h=function(){g-=c;g<=-d.piece_size&&(this.stop(),d.onComplete.call(this,d));b.css({backgroundPosition:g+"px "+d.yoffset+"px"})};this.start=function(c){e||(g=(c||b.width())+d.piece_size,e=setInterval(a.proxy(h,
this),d.interval));return e};this.stop=function(){e&&(clearInterval(e),e=null)};this.toElement=function(){return b};this.toString=function(){return e};d.autorun&&this.start()};var b=this.Spinner=function(d){var b=null,e=null,g=0,c={frames:12,size:16,yoffset:0,interval:60,autorun:!1,parent:document.body,element:null,spinner_class:"spinner"},d=d||{},f;for(f in c)c.hasOwnProperty(f)&&(d[f]=d[f]||c[f]);b=d.element?a(d.element):a("<div/>").appendTo(d.parent);b.css({backgroundPosition:"0 "+d.yoffset+"px",
width:d.size,height:d.size}).addClass(d.spinner_class);var k=function(){g=(g+1)%d.frames;b.css({backgroundPosition:"-"+g*d.size+"px "+d.yoffset+"px"})};this.start=function(){e||(e=setInterval(k,d.interval));return e};this.stop=function(){e&&(clearInterval(e),e=null)};this.toElement=function(){return b};this.toString=function(){return e};d.autorun&&this.start()};a.fn.spinner=function(d){var d=d||{},c=a(this),e,g,f;"string"===typeof d?c.each(function(b,c){e=a(c);if((g=e.data("spinner"))&&"restore"===
d)f=e.data("spinner_options"),g.stop(),f.text?(e.removeClass("spinned"),g.toElement().parent().remove()):(e.removeClass("with_spinner"),g.toElement().remove()),e.removeData("spinner_options"),e.removeData("spinner")}):c.each(function(c,f){e=a(f);g=new b(d);d.text=d.text||e.attr("data-loading-text");e.data({spinner_options:d,spinner:g});d.text?(g.toElement().prependTo(a("<div/>",{"class":"spinner_container",text:d.text,click:!1}).insertBefore(e)),e.addClass("spinned")):(g.toElement().prependTo(e),
e.addClass("with_spinner"));g.start()});return this};var f=this.ClosableElements=function(){var d=[];a(document).bind("keydown",function(a){27===a.keyCode&&f.close()});return{add:function(b,e,c){b=a.makeArray(b);0===d.length&&b.length&&a(document).click(f.close);b.length&&b.forEach(function(b){-1===d.indexOf(b)&&d.push(b);e&&a(b).bind("closable::close",e);c&&a(b).bind({click:function(a){a&&a.stopPropagation()},contextmenu:function(a){a&&a.preventDefault()}})})},close:function(){return a(d.join(",")).filter(".open").trigger("closable::close").removeClass("open")}}}();
this.ErrorBucket=function(d){var b=new PropertyBag,e=d.find(".error_message");this.getError=function(a){b.get(a)};this.hasErrors=function(){return 0<b.length()};this.addError=function(a,e,d){var c={};c[e]=d;b.add(a,c);this.render()};this.render=function(){var d={},c=b.getAll(),f;for(f in c)c.hasOwnProperty(f)&&a.extend(d,c[f]);var k=[],c=Object.keys(d),h=0;c.length?(c.forEach(function(a){""!==d[a]&&(k[h]=d[a],h++)}),e.html(Mustache.to_html("{{#errorSummary}}<li>{{.}}</li>{{/errorSummary}}",{errorSummary:k})),
e.addClass("visible")):(e.empty(),e.removeClass("visible"))};this.remove=function(a){b.remove(a);this.render()};this.removeError=function(a,e){b.removeProperty(a,e);this.render()};this.empty=function(){b.empty();this.render()}};a.fn.drop_down=function(){var b=this[0],c=b.selectedIndex,e=b.options,g=a(b),h,i,k=a("<span/>",{"class":"selected_element",tabindex:0,role:"button",text:e[c].text,keydown:function(a){if(-1!==[13,32,35,36,38,40].indexOf(a.keyCode)){a.preventDefault();var c=b.selectedIndex,g=
c;switch(a.keyCode){case 35:g=e.length-1;break;case 36:g=0;break;case 38:0<g&&g--;break;case 40:g+1<e.length&&g++;break;case 13:k.trigger("click")}(c!==g||32===a.keyCode)&&i.data("setValue")(b[g].value).trigger("dropdown::change",[b[g].value])}}}).button({icons:{secondary:"ui-icon-menu"}}),j=a("<div/>",{"class":"drop_down click_to_open "+g.attr("class"),role:"listbox",id:"jqdd-"+(new Date).getTime(),click:function(a){a&&a.stopPropagation();j.toggleClass("open").hasClass("open")?(j.attr({"aria-expanded":!0}).trigger("closable::open"),
k.addClass("ui-custom-active")):(j.attr({"aria-expanded":!1}).trigger("closable::close"),k.removeClass("ui-custom-active"))}}).bind("closable::close",function(){k.hasClass("ui-custom-active")&&(j.attr({"aria-expanded":!1}),k.removeClass("ui-custom-active"))}).data({value:e[c].id,setValue:function(a,e){b.value=a;j.data("value",a).find(".selected").removeClass("selected ascending").end().find("li:eq("+b.selectedIndex+")").addClass("selected"+(e?" ascending":""));k.find("span").text(b.options[b.selectedIndex].text);
return j}}).removeClass("convert_to_dropdown").append(k);1<e.length?(h=document.createElement("ul"),i=a(h),i.addClass("popup_menu flat_menu").delegate("li","click",function(){var a=this.getAttribute("data-value");a&&(j.data("setValue")(a),j.trigger("dropdown::change",[a]))}),g.find("option").each(function(e,b){var d=document.createElement("li"),g=document.createElement("span"),f=document.createTextNode(b.text);d.setAttribute("role","option");d.setAttribute("data-value",b.value);g.appendChild(f);d.appendChild(g);
e===c&&a(d).addClass("selected");h.appendChild(d)}),"true"===(b.getAttribute("data-sort-ascending")||"").toLowerCase()&&a(h).find(".selected").addClass("ascending"),j.append(h)):j.addClass("single");j.insertAfter(b);h&&k.css({width:a(h).width()+8});f.add("#"+j.attr("id"));g.hide();return j};a.fn.multiple_drop_down=function(b){var c=this[0],e=c.selectedIndex,g=a(c),h=g.find("option"),i=!1;b?i=!0:(b=a("<span/>",{"class":"selected_element",tabindex:0,role:"button",text:h[e].text,keydown:function(a){if(-1!==
[13,32,35,36,38,40].indexOf(a.keyCode)){a.preventDefault();var e=c.selectedIndex,g=e;switch(a.keyCode){case 35:g=h.length-1;break;case 36:g=0;break;case 38:0<g&&g--;break;case 40:g+1<h.length&&g++;break;case 13:b.trigger("click")}(e!==g||32===a.keyCode)&&(void 0).data("setValue")(c[g].value).trigger("dropdown::change",[c[g].value])}}}).button({icons:{secondary:"ui-icon-menu"}}),b.append('<div style="clear:both;"></div>'));var k=a("<div/>",{"class":"multiple_drop_down click_to_open "+g.attr("class"),
role:"listbox",id:"jqdd-"+(new Date).getTime(),click:function(a){a&&a.stopPropagation();k.toggleClass("open").hasClass("open")?(k.attr({"aria-expanded":!0}).trigger("closable::open"),b.addClass("ui-custom-active")):(k.attr({"aria-expanded":!1}).trigger("closable::close"),b.removeClass("ui-custom-active"))}}).bind("closable::close",function(){b.hasClass("ui-custom-active")&&(k.attr({"aria-expanded":!1}),b.removeClass("ui-custom-active"))}).data({value:h[e].id,setValue:function(a,e){c.value=a;k.data("value",
a).find(".selected").removeClass("selected ascending").end().find("li:eq("+c.selectedIndex+")").addClass("selected"+(e?" ascending":""));i||b.find("span").text(c.options[c.selectedIndex].text);return k}}).removeClass("convert_to_multiple_dropdown").append(b),j=document.createElement("div");$drop_down_container=a(j);$drop_down_container.addClass("columns-container");var q=Math.ceil(h.length/2),s,r,t=document.createElement("ul"),u=document.createElement("ul"),v=a(t),n=a(u);v.add(n).addClass("popup_menu flat_menu").delegate("li",
"click",function(){var a=this.getAttribute("data-value");a&&(k.data("setValue")(a),k.trigger("dropdown::change",[a]))});7<h.length?(s=a(h).slice(0,q),r=a(h).slice(q)):s=a(h);s.each(function(b,d){var c=document.createElement("li"),g=document.createElement("span"),f=document.createTextNode(d.text);c.setAttribute("role","option");c.setAttribute("data-value",d.value);g.appendChild(f);c.appendChild(g);b===e&&a(c).addClass("selected");t.appendChild(c)});$drop_down_container.append(t);7<h.length&&(r.each(function(b,
d){var c=document.createElement("li"),g=document.createElement("span"),f=document.createTextNode(d.text);c.setAttribute("role","option");c.setAttribute("data-value",d.value);g.appendChild(f);c.appendChild(g);b+s.length===e&&a(c).addClass("selected");u.appendChild(c)}),$drop_down_container.append(u));k.append(j);k.insertAfter(c);j=0<v.width()&&0<n.width()?20:10;$drop_down_container.css({width:v.width()+n.width()+j});f.add("#"+k.attr("id"));g.hide();return k};var h=this.Floater={register:function(b){b=
a.extend({},{event:"click",position:"right",toggle_fn:h.toggle,hide_fn:h.hide},b);b.attachHandlers&&b.attachHandlers(b);a(b.listener).delegate(b.toggler,b.event,function(c){b.toggle_fn.call(this,c,b);a(b.element).data("floater-options",b);"contextmenu"===b.event&&c.preventDefault()});a(b.element).data("floater-attached")||(f.add(b.element,null,b.semi_modal),a(b.element).bind({"mousedown.draggable":function(a){a.stopPropagation()},"closable::close":function(){var b=a(this).data("floater-options");
b&&b.hide_fn(b)}}).data("floater-attached",!0))},reposition:function(a,b,e){var c=b instanceof jQuery&&b.is("button")?"none":"fit",e=e||{};switch(e.position){case "left":a.position({my:"left top",at:"left bottom",of:b,collision:c});break;case "cursor-x":e.event.pageY=b.offset().top+b.outerHeight();a.position({my:"left top",at:"left bottom",of:e.event,collision:"fit"});break;case "cursor-xy":a.position({my:"left top",at:"left top",of:e.event,collision:"fit"});break;default:a.position({my:"right top",
at:"right bottom",of:b,collision:c})}},toggle:function(b,c){var e=a(b.currentTarget),g=a(c.element),i=!g.parent().hasClass("templates"),o=i&&g.data("relative")&&0===e.not(g.data("relative")).length;b&&(b.stopPropagation(),j.forceHide(!0),f.close());if(i&&(c.hide_fn(c),o))return!1;e.addClass("ui-custom-active").closest(c.idOwner).addClass("modal");g.addClass("open").data("relative",e).appendTo(e.offsetParent());h.reposition(g,e,{position:c.position,event:b});return g.trigger("closable::open",[b,c])},
hide:function(b){a(b.element).is(":visible")&&(a(b.listener).find(b.toggler).removeClass("ui-custom-active").closest(b.idOwner).removeClass("modal"),a(b.element).find(".hover").removeClass("hover").end().removeData("relative").appendTo(b.templateContainer))}};a.downloadAsync=function(b){var c=a("#downloadAsync_iframe");0==c.length?c=a("<iframe />",{id:"downloadAsync_iframe",style:"display:none;"}):c.remove();c.attr("src",b);c.appendTo(a(document.body))}}).call(window,jQuery);
(function(a){a.confirmationPopup=function(i){var j,i=a.extend({},{buttons:[{label:"OK",default_btn:!0}],loadingText:""},i);j=a(Mustache.to_html('<div id="confirmationPopup" class="overlay_window{{#css_classes}} {{.}}{{/css_classes}}">  <header><h1>{{title}}</h1></header>  <div class="body_container"><div class="body">    <span class="message">{{{message}}}</span>  </div></div>  <div class="controls highlighted">    {{#buttons}}<button type="button" class="{{css_classes}}" data-type="{{label}}">{{label}}</button>{{/buttons}}  </div></div>',
i));j.find("button").button();i.buttons.forEach(function(c){var b=j.find('button[data-type="'+c.label+'"]').button();c.default_btn&&b.addClass("default").focus();c.disabled_btn&&b.attr("disabled","disabled");b.bind("click",function(f){f.preventDefault();if(!c.ignore||!c.ignore())c.callback?(c.default_btn&&i.loadingText&&(j.find("button").not(b).hide(),b.spinner({text:i.loadingText})),c.callback.call(b,function(){b.spinner("restore").hide();a.fancybox.close()})):a.fancybox.close()})});a("#fancybox-content").is(":visible")?
a("#fancybox-content").empty().append(j):(a(document.body).append(j),a.fancybox({width:"auto",height:"auto",scrolling:"no",padding:1,type:"inline",hideOnOverlayClick:!1,content:"#confirmationPopup",onCleanup:function(){j.remove()},onComplete:function(a){i.onComplete&&i.onComplete(a)}}))}}).call(this,jQuery);
(function(){var a=this.ADSK=this.ADSK||{};a.Analytics=function(){return{init:function(){window._gaq&&$.cookie("accounts_guid")&&window._gaq.push(["_setCustomVar",1,"user_id",$.cookie("accounts_guid"),1])},track:function(){if(window._gaq){var i=Array.prototype.slice.apply(arguments),j=jQuery.isArray(i[0])?i.shift():[];j.length&&a.Analytics.setFile.apply(a.Analytics,j);i.unshift("_trackEvent");window._gaq.push(i);j.length&&a.Analytics.setFile.apply(a.Analytics,["",""])}},setFile:function(a,j){a instanceof
jQuery&&(j=a.attr("data-name"),a=a.attr("data-id"));window._gaq.push(["_setCustomVar",2,"item_id",a,3]);window._gaq.push(["_setCustomVar",3,"file_type",$.getFileExtension(j),3])}}}()}).call(window);var OXYGEN_OPTIONS={viewmode:"iframe",viewmode_options:{width:350,height:356},provider:"autodesk",providers_endpoint:{autodesk:"https://accounts-staging.autodesk.com/SignIn"},openid_response:"oxygen_openid_response.html",refresh_response:"oxygen_refresh_response.html"};
(function(){var a=function(b,c){for(var d in c)c.hasOwnProperty(d)&&b.hasOwnProperty(d)?"object"===typeof b[d]&&"object"===typeof c[d]?b[d]=a(b[d],c[d]):b.hasOwnProperty(d)||(b[d]=c[d]):c.hasOwnProperty(d)&&!b.hasOwnProperty(d)&&(b[d]=c[d]);return b},i=function(a){var a=(/\?/.test(a)?a.split("?")[1]:a).split("&"),b={},c,d,f;for(d=0,f=a.length;d<f;d++)c=a[d].split("="),b[c[0]]=decodeURIComponent(c[1]);return b},j=Object.create||function(a){function b(){}b.prototype=a;return new b},c=function(b){for(var b=
a(a({},b),{zIndex:6E4,width:350,height:356,onCreate:function(){},onOpen:function(){},onClose:function(){},overlay:{color:"#000",opacity:0.4},container:{shadow:"0 2px 8px rgba(0,0,0,0.5)",backgroundColor:"#fff",padding:10},close_button:{size:24,image:'url("resources/close_24.png")'}}),c={setStyles:function(){jQuery(f).css({position:"absolute",left:0,top:0,width:"100%",zIndex:b.zIndex,backgroundColor:b.overlay.color,opacity:0});jQuery(k).css({position:"absolute",top:0,left:0,zIndex:b.zIndex+6,padding:b.container.padding,
backgroundColor:b.container.backgroundColor,mozBoxShadow:b.container.shadow,webkitBoxShadow:b.container.shadow,boxShadow:b.container.shadow,opacity:0});jQuery(h).css({position:"absolute",top:-b.close_button.size/2.75,right:-b.close_button.size/2.75,width:b.close_button.size,height:b.close_button.size,zIndex:b.zIndex+8,backgroundImage:b.close_button.image,cursor:"pointer"})},resizeOverlay:function(){f.style.height=0;f.style.height=Math.max(jQuery(k).height()+42,jQuery(document).height())+"px"},resizeTo:function(a,
d){a?(b.width=a.width,b.height=a.height):a={width:b.width,height:b.height};var f=d&&a&&(b.width!=a.width||b.height!=a.height),h,j;"auto"===a.width?(k.style.display="block",k.style.width="auto",i.style.width="auto",h=jQuery(i).width(),d=f=!1):h=a.width;"auto"===a.height?(k.style.display="block",k.style.height="auto",i.style.height="auto",j=jQuery(i).height(),d=f=!1):j=a.height;if(f)i.style.display="none";d&&jQuery([k,i]).stop(!0,!0);!1!==a.autoscale&&!l.MOBILE_FRIENDLY&&(j=Math.min(j,jQuery(window).height()-
42));jQuery(k)[d?"animate":"css"]({left:"50%",top:"50%",width:h,height:j,marginTop:Math.max(-j/2-b.container.padding,(-jQuery(window).height()+24)/2)+jQuery(window).scrollTop(),marginLeft:Math.max(-h/2-b.container.padding,(-jQuery(window).width()+24)/2)},{duration:300,complete:c.resizeOverlay});jQuery(i)[d?"animate":"css"]({width:h,height:j},{duration:300,complete:function(){i.style.display=""}});c.resizeOverlay();setTimeout(c.resizeOverlay,50)},keydown:function(a){27===a.keyCode&&this.close()},show:function(){jQuery(f).stop(!0,
!0).fadeTo(300,b.overlay.opacity,function(){b.onOpen();jQuery(document).trigger("oxygen::open")});jQuery(k).fadeTo(300,1)},hide:function(){jQuery(f).stop(!0,!0).fadeTo(300,0,function(){jQuery(this).hide();b.onClose();jQuery(document).trigger("oxygen::close")});jQuery(k).stop(!0,!0).fadeTo(300,0,function(){jQuery(this).hide()})}},d=!1,f=document.getElementById("oxygen-overlay")||document.createElement("div"),k=document.getElementById("oxygen-container")||document.createElement("div"),h=document.getElementById("oxygen-closebtn")||
document.createElement("div"),i=b.content,j=0,r=k.children.length;j<r;j++)k.removeChild(k.children[0]);k.appendChild(h);i&&k.appendChild(i);this.open=function(a,j){var l=this;a&&(i&&i.parentNode&&k.removeChild(i),i=a,k.appendChild(i));document.getElementById("oxygen-overlay")?jQuery(k).is(":visible")||c.setStyles():(f.setAttribute("id","oxygen-overlay"),k.setAttribute("id","oxygen-container"),k.setAttribute("role","dialog"),k.setAttribute("tabindex","-1"),h.setAttribute("id","oxygen-closebtn"),h.setAttribute("role",
"button"),c.setStyles(),d||(jQuery(h).bind("click",function(){l.close.call(l)}),jQuery(k).bind("mousewheel",function(a){a.stopPropagation();a.preventDefault()}),d=!0),document.body.appendChild(f),document.body.appendChild(k));jQuery(window).unbind("resize.oxygen");jQuery(document).unbind("keydown.oxygen");jQuery(f).unbind("click.oxygen");jQuery(window).bind("resize.oxygen",function(){c.resizeTo.call(l,b)});jQuery(document).bind("keydown.oxygen",function(a){c.keydown.call(l,a)});b.hideOnOverlayClick&&
jQuery(f).bind("click.oxygen",function(){l.close.call(l)});c.resizeTo(j||b,!!j,!1);try{k.focus()}catch(n){}b.onCreate();jQuery(document).trigger("oxygen::create");c.show();return this};this.close=function(){c.hide()};this.resizeTo=function(a,b){c.resizeTo(a,b)};this.toString=function(){return"OxygenOverlay"}},b=function(b){b=a(b||{},OXYGEN_OPTIONS.viewmode_options);if(b.href)this.iframe=d(b.href,b.onLoadComplete);b.content=b.content||this.iframe;var f=b.onClose,h=this;b.onClose=function(){f&&f.call(h,
arguments);if(h.iframe)h.iframe.parentNode.removeChild(h.iframe),h.iframe=null};c.call(this,b);var i=this.open;this.open=function(a,c){this.iframe?(this.setURL(a),i.call(h,void 0,c)):(this.iframe=d(a,b.onLoadComplete),i.call(this,this.iframe,c))};this.setURL=function(a){this.iframe.setAttribute("src",a)};this.toString=function(){return"OxygenOverlayIframe"}};b.prototype=j(c.prototype);var f=function(a){var b=this,d=document.createElement("div");c.call(this,a);var f=this.open;this.open=function(a,
c){d.innerHTML="";d.appendChild(a.cloneNode(!0));f.call(b,d,c)};this.toString=function(){return"OxygenOverlayInline"}};f.prototype=j(c.prototype);var h=function(b){var c,b=a(b||{},{width:350,height:356});this.open=function(a){try{c.location.href=a}catch(d){c=window.open(a,"OxygenPopup","width="+b.width+",height="+b.height),jQuery(c).bind("load",b.onLoadComplete)}};this.close=function(){c.close();c=null};this.resizeTo=function(a){try{c&&c.resizeTo(a.width,a.height)}catch(b){}};this.toString=function(){return"OxygenPopup"}},
d=function(a,b){var c=document.createElement("iframe");c.setAttribute("frameBorder","0");c.setAttribute("hspace","0");c.setAttribute("scrolling","no");c.setAttribute("src",a);c.setAttribute("allowtransparency","true");b&&jQuery(c).bind("load",b);c.style.border="none";return c},l=this.Oxygen=function(){var c,g=OXYGEN_OPTIONS,j=window.location.href.split("/").slice(0,-1).join("/")+"/",o={init:function(d){if(!c)switch(d=d||{},g.viewmode){case "iframe":c=new b(a(d,g.viewmode_options));break;case "popup":c=
new h(a({},g.viewmode_options));break;case "inline":c=new f(a({},g.viewmode_options))}},setOptions:function(b){c&&b.hasOwnProperty("viewmode")&&b.viewmode!==g.viewmode&&(c.close(),c=null);g=a(b,g);return this},getBaseOpenIDProviderURL:function(a,b){var c=g.providers_endpoint[a]+"?openid.ns="+encodeURIComponent("http://specs.openid.net/auth/2.0")+"&openid.claimed_id="+encodeURIComponent("http://specs.openid.net/auth/2.0/identifier_select")+"&openid.identity="+encodeURIComponent("http://specs.openid.net/auth/2.0/identifier_select")+
"&openid.return_to="+encodeURIComponent(j+g.openid_response)+"&openid.realm="+encodeURIComponent(j+g.openid_response)+"&openid.ns.ax="+encodeURIComponent("http://openid.net/srv/ax/1.0")+"&openid.ax.required=name&openid.ax.mode=fetch_request&openid.ax.type.name="+encodeURIComponent("http://axschema.org/namePerson")+"&openid.ax.count.name=1";return c=b?c+"&openid.mode=checkid_immediate":c+("&openid.mode=checkid_setup&openid.ns.alias5="+encodeURIComponent("http://specs.openid.net/extensions/ui/1.0")+
"&openid.alias5.mode="+encodeURIComponent(g.viewmode)+"&openid.alias5.iframe_refresh_url="+encodeURIComponent(j+g.refresh_response))},receiveMessage:function(a){/(autodesk\.com)$/.test(a.origin)&&/^iframe\-resize::(\d+),(\d+)/.test(a.data)&&(a=a.data.match(/^iframe\-resize::(\d+),(\d+)/))&&l.resizeTo({width:a[1],height:a[2]},!1)}};window.addEventListener&&window.addEventListener("message",o.receiveMessage,!1);return{setOptions:o.setOptions,show:function(a,b,d){if(b&&b!==g.viewmode)c=null,g.viewmode=
b;o.init(a&&{href:a});g.viewmode_options.onLoadStart&&g.viewmode_options.onLoadStart();c.open(a||o.getBaseOpenIDProviderURL(g.provider,!1),d)},hide:function(){c&&c.close()},resizeTo:function(a,b){c&&c.resizeTo(a,b)},checkImmediate:function(){g.onCheckImmediate&&g.onCheckImmediate();var a=d(o.getBaseOpenIDProviderURL(g.provider,!0));a.style.display="none";document.body.appendChild(a)},processOpenIDResponse:function(a){g.onOpenIDResponse&&g.onOpenIDResponse(i(a));c&&c.close()},processOpenIDRefreshResponse:function(a){a=
i(a);a.page?l.show(a.page,void 0,{width:a.width,height:a.height}):l.resizeTo({width:a.width,height:a.height},!0)},toString:function(){return"Oxygen"}}}();if(window.Modernizr&&Modernizr.mq&&(Modernizr.mq("handheld")||Modernizr.mq("screen and (max-device-width: 480px)")||Modernizr.mq("only screen and (-webkit-min-device-pixel-ratio: 2)")||Modernizr.mq("only screen and (max-device-width: 1024px)")))l.MOBILE_FRIENDLY=!0}).call(this);
(function(a){Oxygen.setOptions({viewmode_options:{close_button:{image:'url("/content/images/buttons/close_24.png")'}},onOpenIDResponse:function(a){window.location.href=a||"/"}});this.NitrousLogin={handleIframeReturn:function(a){Oxygen.hide();window.location.href=a||"/"},handleIframeRefresh:Oxygen.processOpenIDRefreshResponse};a(document.body).delegate(".signin_link",{click:function(){Oxygen.show(a(this).attr("data-href"),"iframe",{width:350,height:356})},keydown:function(i){(13===i.keyCode||32===
i.keyCode)&&a(this).trigger("click")}})}).call(window,window.jQuery);
(function(){this.Appstore=this.Appstore||function(){$(document).ajaxError(function(a,b,f,h){var d;f.url.match(/(.+?)\?.*/);switch(b.status){case 0:"timeout"==h&&(new FlashMessage({autohide:!0,hideTime:8E3,type:"error",text:GlobalResources.constants.internalServerErrorDescription})).show();break;case 403:window.location.reload();break;default:try{d=JSON.parse(b.responseText),"Modal"!==d.Show&&"Flash"===d.Show&&(new FlashMessage({autohide:!0,hideTime:8E3,type:"error",text:d.Description})).show()}catch(i){switch(b.status){case 503:j.showMaintenancePage(b.responseText)}}}});
var a={setMainHeight:function(a){var b=!a?0:!a.data?0:a.data.counter_measure;$("#header, #neck, #footer").each(function(){b+=$(this).outerHeight()});a=$(window).height()-b;-1!=navigator.userAgent.indexOf("Firefox")&&(a+=80);$("#main").css("min-height",a)},changeLogoUrl:function(){$(document).ready(function(){var a=$("a#first-neck").attr("href");$(".branding").attr("href",a)})},setMaxlength:function(){$(document).ready(function(){$(".length_32").attr("maxlength",32);$(".length_50").attr("maxlength",
50);$(".length_200").attr("maxlength",200);$(".length_1000").attr("maxlength",1E3);$(".length_2000").attr("maxlength",2E3);$(".length_4000").attr("maxlength",4E3)})},badge2html:function(){$(".badge-popup-certification-content-div").each(function(){$(this).children("p").html($(this).children("p").text())})},dataLinkActive:function(a){window.location=a},extendPrototype:function(){Array.prototype.distinct=function(){var a=this.concat();this.concat().sort().sort(function(b,f){b==f&&a.splice(a.indexOf(b),
1)});return a}},initializeGeoFrames:function(){0<$(".ga-image-sliders").length&&setInterval(function(){$(".ga-image-sliders ul").each(function(){var a=$(this),b=a.css("margin-left").replace("px",""),f=a.width(),h=$("li",a).width(),b=b-h;0>=b+f&&(a.css("margin-left","0px"),b=0-h);a.animate({marginLeft:b+"px"},500)})},4E3)},initSearchboxWidth:function(){var a=$(".search-box-store-selector"),b=a.siblings(".nav-search-facade"),f=b.css("width"),h=a.find("option:selected");h.val();h=h.text();b.html(h+"<span class='caret'></span>");
b=b.css("width");f=parseFloat(f)-parseFloat(b);a=a.closest(".search-form-content").children(".nav-fill");b=a.css("width");h=a.css("margin-right");a.css("width",parseFloat(b)+f+"px");a.css("margin-right",parseFloat(h)-f+"px")},initSearchbox:function(){var c=$("#search").css("width");$(".search-suggestions-box-ul").css("width",parseFloat(c)-22+"px");a.initSearchboxWidth();$(".search-box-store-selector").on("change",a.initSearchboxWidth);$(".search-wrapper .search-form-content").focusin(function(){$(this).toggleClass("active")}).focusout(function(){$(this).toggleClass("active")})},
initWidgetCarouselControl:function(){$("#carousel-slider").carousel("cycle");$(".apps-carousel .carousel-slider-widget").on("slide.bs.carousel",function(){$(this).children(".carousel-inner").css("overflow","hidden");$(this).children(".carousel-inner .item").css("overflow","hidden");$(this).closest(".carousel-slider-widget-sub-layout").css({"border-left":"1px solid lightgrey","border-right":"1px solid lightgrey",background:"linear-gradient(to right, rgba(204,204,204,0.3) 1%, transparent 1%, transparent 99%, rgba(204,204,204,0.3) 99%)"})});
$(".apps-carousel .carousel-slider-widget").on("slid.bs.carousel",function(){$(this).children(".carousel-inner").css("overflow","visible");$(this).children(".carousel-inner .item").css("overflow","visible");$(this).closest(".carousel-slider-widget-sub-layout").css({"border-left":"none","border-right":"none",background:"transparent"});$(this).carousel("pause")})},initWidgetAppsLayout:function(){},bindSearchWrapper:function(){$("#search-box-store-selector").change(function(){var a=$("#search-form").attr("action"),
a=a.substr(1),a=a.substr(a.indexOf("/")),a="/"+$(this).val()+a;$("#search-form").attr("action",a)})},initGAPublicCheck:function(){$(".btn-group .first-a").click(function(){window._gaq&&window._gaq.push(["_trackEvent","StoreSelector","StoreClick",$(this).attr("ga-storeid")])});$(".btn-group .popover-menu .sub-a").click(function(){window._gaq&&window._gaq.push(["_trackEvent","StoreSelector","CategoryClick",$(this).attr("ga-categoryid")])});$(".widget-element-app-link").click(function(){window._gaq&&
window._gaq.push(["_trackEvent","GroupWidget","AppClick",$(this).attr("ga-appname")])});$(".carousel-inner .custom-link-item a").click(function(){window._gaq&&window._gaq.push(["_trackEvent","Carousel","ImageClick",$(this).attr("ga-imagedata")])});$(".sort-ga-click").click(function(){window._gaq&&window._gaq.push(["_trackEvent","Filter","Sorting",$(this).attr("ga-label")])});$(".btn-ga-click").click(function(){window._gaq&&window._gaq.push(["_trackEvent",$(this).attr("ga-category")?$(this).attr("ga-category"):
"",$(this).attr("ga-action")?$(this).attr("ga-action"):"",$(this).attr("ga-label")?$(this).attr("ga-label"):"",isNaN(parseInt($(this).attr("ga-value")))?0:parseInt($(this).attr("ga-value"))])})},initLanguageSelector:function(){$(".language-changer .lang-selectable").click(function(){var a=window.location.href,b=$(this),f=b.data("language"),b=b.siblings(".hover").data("language");if(void 0!=b&&1<b.length){var h=a.indexOf("List/Search?");-1<h&&(a=a.substr(0,h+12),(h=$("#query-term").attr("data-query"))&&
(a=a+"query="+h),(h=$("input[name='isAppSearch']").val())&&(a=a+"&isAppSearch="+h));window.location=-1<a.indexOf("/"+b)?a.replace("/"+b,"/"+f):"/"+f+window.location.pathname+window.location.search}})},initMenuAim:function(){var a=$(".dropdown-menu.dropdown-menu-store, .navigation-a");a.menuAim({activate:function(b){var b=$(b),f=b.data("submenuId"),f=$("#"+f),h=f.children().outerHeight(),d=a.outerWidth();f.css({display:"block",top:-1,left:d-3,height:h-4});b.find("a").addClass("maintainHover")},deactivate:function(a){var a=
$(a),c=a.data("submenuId");$("#"+c).css("display","none");a.find("a").removeClass("maintainHover")}});$(document).click(function(){$(".popover").css("display","none");$("a.maintainHover").removeClass("maintainHover")})}},i={about:function(){$.fancybox({href:GlobalResources.partialviewactions.about.url,type:"ajax",width:500,height:325,scrolling:"no",hideOnOverlayClick:!1,autoDimensions:!1,autoScale:!1,onStart:function(){$("#fancybox-outer, #fancybox-content").addClass("no_border");$("#fancybox-close").addClass("about_close")},
onClosed:function(){$("#fancybox-outer, #fancybox-content").removeClass("no_border");$("#fancybox-close").removeClass("about_close")}})},featuredActive:function(){a.dataLinkActive($(this).attr("data-link"))},bestSellerActive:function(){a.dataLinkActive($(this).attr("data-link"))},goTop:function(){$(window).scroll(function(){var a=0.4*$(window).height();$(document).scrollTop()>a?$("#goTop").fadeIn(500):$("#goTop").fadeOut(500)});$("#goTop").on("click",function(){$(document.documentElement).animate({scrollTop:0},
200);$(document.body).animate({scrollTop:0},200)})},intializeUserDropdown:function(){$(".user-panel .drop_down ul").click(function(){this.setAttribute("style","visibility: hidden");var a=this;setTimeout(function(){a.removeAttribute("style")},100)})}},j={showMaintenancePage:function(a){var b=$("#maintenance_partial"),f=a&&a.length?a:$("#maintenance_partial").html();if(b.length||a&&a.length)$("#container").empty().append(f),$("body").addClass("landing-view")}};return{init:function(){j.showMaintenancePage();
$(window).bind("resize",a.setMainHeight);a.setMainHeight();var c=function(a){a.filter("a").each(function(){var a=encodeURIComponent((this.getAttribute("data-url-redir")||"")+window.location.href);this.setAttribute("href",(this.getAttribute("data-url-root")||"")+a)})},b=$("#header .user-panel .drop_down a.account_settings_link, #footer li.change_language a.account_settings_link");b.bind({mouseenter:function(){c($(this))},click:function(){$.cookie("profilePicCacheBuster",(1E5*Math.random()).toPrecision(5));
return!0}});c(b);$("#query-term").overlayText();$(".user-panel").find('.signin_link[data-autostart="true"]').trigger("click");var b=$("#flash-message-notification").attr("data-flashMessage"),f=$("#flash-message-notification").attr("data-messageType");b&&(new FlashMessage({autohide:!0,hideTime:8E3,type:f,text:b})).show();$(".show_all").attr("data-href",$("#search-form").attr("action"));$(".show_all").click(function(){window.location=$(this).attr("data-href")});$("#footer").find("li.about").bind("click",
i.about);$(".badge-popup-div").bind("click",function(a){a.stopPropagation()});a.changeLogoUrl();a.initializeGeoFrames();a.setMaxlength();$(".language-selector").hide();b=$("#os-selector").val();$("#"+b).show();a.badge2html();$("#featured-products .product-content-container").on("click",i.featuredActive);$("#bestsellers .container").on("click",i.bestSellerActive);a.extendPrototype();i.goTop();i.intializeUserDropdown();a.initSearchbox();a.initWidgetCarouselControl();a.initWidgetAppsLayout();a.initLanguageSelector();
a.initGAPublicCheck()},setCookie:function(a,b,f){var h=new Date;h.setDate(h.getDate()+f);document.cookie=a+"="+escape(b)+";path=/"+(null==f?"":";expires="+h.toGMTString())},queryStringToJSON:function(){var a={};location.search.slice(1).split("&").forEach(function(b){b=b.split("=");a[b[0]]=decodeURIComponent(b[1]||"")});return JSON.parse(JSON.stringify(a))},isObjEmpty:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},getOwnPropertyNames:function(a){var b=[],f;for(f in a)a.hasOwnProperty(f)&&
b.push(f);return b},badge2html:function(){a.badge2html()},htmlEncode:function(a){return void 0==a||""==a?a:$("<div/>").text(a).html()},htmlDecode:function(a){return void 0==a||""==a?a:$("<div/>").html(a).text()},initHeaderToolBar:function(){a.bindSearchWrapper();a.initMenuAim()},busy:function(){$.fancybox({width:"0",height:"0",scrolling:"no",type:"html",hideOnOverlayClick:!1,showCloseButton:!1,modal:!0,speedIn:0});$.fancybox.showActivity()}}}()}).call(window,jQuery);
(function(){var a=this.Appstore=this.Appstore||function(){};a.Landing=function(){return{init:function(){a.init();a.initHeaderToolBar();$(".search-type-area").css("display","table")}}}()}).call(window,jQuery);
(function(a){function i(){var b=a("#search-form #language").val();return b=void 0==b?GlobalResources.language:"/"+b}function j(a){var c=a.val(),h=a.get(0);void 0!=h&&(h.setSelectionRange?(a.focus(),h.setSelectionRange(c.length,c.length)):h.createTextRange&&(a=h.createTextRange(),a.collapse(!0),a.moveEnd("character",c.length),a.moveStart("character",c.length),a.select()))}function c(){"True"==a("#isfancy").val()&&a(".search-type-area").css("display","none");"False"==a("input[name='isAppSearch']").val()&&
(a(".nav-search-scope").css("display","none"),a(".show-all-wrapper").css("display","none"),a(".view-selection").css("display","none"),a(".list-display-option-right").css("margin-right","5px"),a("#query-term").attr({placeholder:a("#search-publishers-placeholder-hint").text()}));a("#search-apps").on("click",function(){a(".nav-search-scope").css("display","inline-block");a(".show-all-wrapper").css("display","inline-block");a(".view-selection").css("display","inline-block");a(".list-display-option-right").css("margin-right",
"0");a("#search-publishers").removeClass("search-type-hightlighted");a("#search-apps").removeClass("search-type-unhightlighted");a("#search-apps").addClass("search-type-hightlighted");a("#query-term").attr({placeholder:a("#search-apps-placeholder-hint").text()});a("#query-term").val("");a("#query-term").focus();a("input[name='isAppSearch']").val("True")});a("#search-publishers").on("click",function(){a(".nav-search-scope").css("display","none");a(".show-all-wrapper").css("display","none");a(".view-selection").css("display",
"none");a(".list-display-option-right").css("margin-right","5px");a("#search-apps").removeClass("search-type-hightlighted");a("#search-publishers").removeClass("search-type-unhightlighted");a("#search-publishers").addClass("search-type-hightlighted");a("#query-term").attr({placeholder:a("#search-publishers-placeholder-hint").text()});a("#query-term").val("");a("#query-term").focus();a("input[name='isAppSearch']").val("False")})}a(document).ready(function(){function b(b){a.ajax({type:"get",data:{query:b},
url:"/List/GetSuggestions",success:function(b){if(null!=b&&null!=b.Suggestions&&a.trim(a("#query-term").val())==b.Query){var d=a("#search-suggestions-box");if(null!=b.Suggestions&&0!=b.Suggestions.length){d.empty();for(var c=0;c<b.Suggestions.length;c++)d.append(" <li>"+b.Suggestions[c].Suggestion+"</li>");d.show()}else d.empty(),d.hide()}},error:function(){a("#search-suggestions-box").hide();a("#search-suggestions-box").empty();console.log("AJAX GET SUGGESTIONS ERROR!")}})}var f,h=a("#query-term");
h&&(j(h),a("#for-cache-search-str").val(h.val()));c();a(document).on("keydown","#query-term",function(b){9==b.keyCode&&(a("#search-suggestions-box").empty(),a("#search-suggestions-box").hide());if(38==b.keyCode||40==b.keyCode)b.cancelBubble=!0,b.returnValue=!1,b.stopPropagation&&(b.stopPropagation(),b.preventDefault())});a("#query-term").keyup(function(d){if(!a("#search-publishers").hasClass("search-type-hightlighted"))if(38==d.keyCode||40==d.keyCode||13==d.keyCode){if(!(0>=a("ul#search-suggestions-box li").length)){var c=
a("#for-cache-search-str"),e=a("#query-term"),g=a(".search-suggestions-box-ul > .selected");g.removeClass("selected");38==d.keyCode&&(0==g.length?(c.val(e.val()),a(".search-suggestions-box-ul li").last().addClass("selected")):0==g.prev().length?e.val(c.val()):g.prev().addClass("selected"));40==d.keyCode&&(0==g.length?(c.val(e.val()),a(".search-suggestions-box-ul li:eq(0)").addClass("selected")):0==g.next().length?e.val(c.val()):g.next().addClass("selected"));13==d.keyCode&&(a("#search-suggestions-box").empty(),
a("#search-suggestions-box").hide());d=a(".search-suggestions-box-ul > .selected");0!=d.length&&e.val(d.html())}}else e=a("#search-suggestions-box"),27==d.keyCode?(e.empty(),e.hide()):(d=a.trim(a("#query-term").val()),""==d?(e.empty(),e.hide(),a("#for-cache-search-str").val("")):d!=a("#for-cache-search-str").val()&&(a("#for-cache-search-str").val(d),f&&clearTimeout(f),f=setTimeout(b,200,d)))});a(document).click(function(){var b=a("#search-suggestions-box");b&&(b.empty(),b.hide())});a("#search-suggestions-box").on("click",
"li",function(){a("#query-term").val(a(this).html());var b;b=a(".dropdown-menu.dropdown-menu-store").attr("currentstore");void 0==b&&(b=a("#search-form #productline").val());b||(b=a("#search-form select").val());var c=a("#search-form"),e;e=void 0;if(!e)e=window.location.href;e=/[\?&]thumbnail=([^&#]*)/.exec(e);(e=!e?null:e[1])&&c.append(a("<input type='hidden' name='thumbnail' value='"+e+"' />"));c.attr("action","/"+b+i()+GlobalResources.partialviewactions.search.url);c.submit()})})})(jQuery);
