function getItemRequest(n,t,i){var r,u=isCookieSet(),e="CookieNotSet",o,s,f;u&&(e="CookieSet");o=isCookieSet();o&&(s=$.cookie("id"),ga("set","&uid",s));f="<style type='text/css'> .select2-default { color: red !important;font-family: verdana; font-size: 14px; font-weight:normal} <\/style>";switch(t){case"grid":$("#search-list").select2("data",{id:"",text:""});r=n;i=u?"a":"r";break;case"link":r=n;i=u?"a":"r";break;case"list":if(r=$("#search-list").select2("val"),!r){$(f).appendTo("#search-list");return}i=u?"a":"r";SRL.logEventToGA(SRL.pageID,"CanYouRunIt-ListButton",e,!0);break;case"analysis":if(r=$("#search-list").select2("val"),SRL.logEventToGA(SRL.pageID,"Analysis-ListButton",r,!0),!r){$(f).appendTo("#search-list");return}i="a";break;default:r=0}$.cyriauto.itemid=r;$.cyriauto.mask=getItemMask(r);u?$.post(window.getRequirementsUrl,{itemId:r,p:i},function(n){var t=$.cyriauto.root+n.url;window.location=t.toLowerCase()}):runInstructionDialog()}function isCookieSet(){var n=!1;return $.cookie("id")!=null&&(n=!0),n}function OnListButtonClick(){getItemRequest("0","list","r")}function OnAnalysisButtonClick(){getItemRequest("0","analysis","a")}(function(n){typeof n.fn.each2=="undefined"&&n.fn.extend({each2:function(t){for(var i=n([0]),r=-1,u=this.length;++r<u&&(i.context=i[0]=this[r])&&t.call(i[0],r,i)!==!1;);return this}})})(jQuery),function(n,t){"use strict";function u(n,t){var i=0,u=t.length,r;if(typeof n=="undefined")return-1;if(n.constructor===String){for(;i<u;i=i+1)if(n.localeCompare(t[i])===0)return i}else for(;i<u;i=i+1)if(r=t[i],r.constructor===String){if(r.localeCompare(n)===0)return i}else if(r===n)return i;return-1}function e(n,i){return n===i?!0:n===t||i===t?!1:n===null||i===null?!1:n.constructor===String?n.localeCompare(i)===0:i.constructor===String?i.localeCompare(n)===0:!1}function y(t,i){var u,r,f;if(t===null||t.length<1)return[];for(u=t.split(i),r=0,f=u.length;r<f;r=r+1)u[r]=n.trim(u[r]);return u}function nt(n){return n.outerWidth()-n.width()}function tt(i){var r="keyup-change-value";i.bind("keydown",function(){n.data(i,r)===t&&n.data(i,r,i.val())});i.bind("keyup",function(){var u=n.data(i,r);u!==t&&i.val()!==u&&(n.removeData(i,r),i.trigger("keyup-change"))})}function it(i){i.bind("mousemove",function(i){var r=n.data(document,"select2-lastpos");(r===t||r.x!==i.pageX||r.y!==i.pageY)&&n(i.target).trigger("mousemove-filtered",i)})}function p(n,i,r){r=r||t;var u;return function(){var t=arguments;window.clearTimeout(u);u=window.setTimeout(function(){i.apply(r,t)},n)}}function rt(n){var t=!1,i;return function(){return t===!1&&(i=n(),t=!0),i}}function ut(n,t){var i=p(n,function(n){t.trigger("scroll-debounced",n)});t.bind("scroll",function(n){u(n.target,t.get())>=0&&i(n)})}function r(n){n.preventDefault();n.stopPropagation()}function ft(t){if(!f){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);f=n("<div><\/div>").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"});n("body").append(f)}return f.text(t.val()),f.width()}function w(n,t,i){var r=n.toUpperCase().indexOf(t.toUpperCase()),u=t.length;if(r<0){i.push(n);return}i.push(n.substring(0,r));i.push("<span class='select2-match'>");i.push(n.substring(r,r+u));i.push("<\/span>");i.push(n.substring(r+u,n.length))}function b(t){var u,i=0,r=null,f=t.quietMillis||100;return function(e){window.clearTimeout(u);u=window.setTimeout(function(){i+=1;var f=i,u=t.data,o=t.transport||n.ajax,s=t.traditional||!1,h=t.type||"GET";u=u.call(this,e.term,e.page,e.context);null!==r&&r.abort();r=o.call(null,{url:t.url,dataType:t.dataType,data:u,type:h,traditional:s,success:function(n){if(!(f<i)){var r=t.results(n,e.page);e.callback(r)}}})},f)}}function k(t){var i=t,u,r=function(n){return""+n.text};return n.isArray(i)||(r=i.text,n.isFunction(r)||(u=i.text,r=function(n){return n[u]}),i=i.results),function(t){var f=t.term,e={results:[]},u;if(f===""){t.callback({results:i});return}u=function(i,e){var o,s;if(i=i[0],i.children){o={};for(s in i)i.hasOwnProperty(s)&&(o[s]=i[s]);o.children=[];n(i.children).each2(function(n,t){u(t,o.children)});o.children.length&&e.push(o)}else t.matcher(f,r(i))&&e.push(i)};n(i).each2(function(n,t){u(t,e.results)});t.callback(e)}}function d(i){return n.isFunction(i)?i:function(r){var u=r.term,f={results:[]};n(i).each(function(){var n=this.text!==t,i=n?this.text:this;(u===""||r.matcher(u,i))&&f.results.push(n?this:{id:this,text:this})});r.callback(f)}}function s(t){if(n.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value");}function h(t){return n.isFunction(t)?t():t}function g(t){var i=0;return n.each(t,function(n,t){t.children?i+=g(t.children):i++}),i}function et(n,i,r,u){var a=n,c=!1,f,s,o,h,l;if(!u.createSearchChoice||!u.tokenSeparators||u.tokenSeparators.length<1)return t;for(;;){for(s=-1,o=0,h=u.tokenSeparators.length;o<h;o++)if(l=u.tokenSeparators[o],s=n.indexOf(l),s>=0)break;if(s<0)break;if(f=n.substring(0,s),n=n.substring(s+l.length),f.length>0&&(f=u.createSearchChoice(f,i),f!==t&&f!==null&&u.id(f)!==t&&u.id(f)!==null)){for(c=!1,o=0,h=i.length;o<h;o++)if(e(u.id(f),u.id(i[o]))){c=!0;break}c||r(f)}}if(a.localeCompare(n)!=0)return n}function a(t,i){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=n.extend(r.prototype,i),r}if(window.Select2===t){var i,o,c,l,v,f;i={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(n){n=n.which?n.which:n;switch(n){case i.LEFT:case i.RIGHT:case i.UP:case i.DOWN:return!0}return!1},isControl:function(n){var t=n.which;switch(t){case i.SHIFT:case i.CTRL:case i.ALT:return!0}return n.metaKey?!0:!1},isFunctionKey:function(n){return n=n.which?n.which:n,n>=112&&n<=123}};v=function(){var n=1;return function(){return n++}}();n(document).delegate("body","mousemove",function(t){n.data(document,"select2-lastpos",{x:t.pageX,y:t.pageY})});n(document).ready(function(){n(document).delegate("body","mousedown touchend",function(i){var r=n(i.target).closest("div.select2-container").get(0),u;r?n(document).find("div.select2-container-active").each(function(){this!==r&&n(this).data("select2").blur()}):(r=n(i.target).closest("div.select2-drop").get(0),n(document).find("div.select2-drop-active").each(function(){this!==r&&n(this).data("select2").blur()}));r=n(i.target);u=r.attr("for");"LABEL"===i.target.tagName&&u&&u.length>0&&(r=n("#"+u),r=r.data("select2"),r!==t&&(r.focus(),i.preventDefault()))})});o=a(Object,{bind:function(n){var t=this;return function(){n.apply(t,arguments)}},init:function(i){var u,f,e=".select2-results";this.opts=i=this.prepareOpts(i);this.id=i.id;i.element.data("select2")!==t&&i.element.data("select2")!==null&&this.destroy();this.enabled=!0;this.container=this.createContainer();this.containerId="s2id_"+(i.element.attr("id")||"autogen"+v());this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);this.body=rt(function(){return i.element.closest("body")});i.element.attr("class")!==t&&this.container.addClass(i.element.attr("class").replace(/validate\[[\S ]+] ?/,""));this.container.css(h(i.containerCss));this.container.addClass(h(i.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(h(i.dropdownCssClass));this.dropdown.data("select2",this);this.results=u=this.container.find(e);this.search=f=this.container.find("input.select2-input");f.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();it(this.results);this.dropdown.delegate(e,"mousemove-filtered",this.bind(this.highlightUnderEvent));ut(80,this.results);this.dropdown.delegate(e,"scroll-debounced",this.bind(this.loadMoreIfNeeded));n.fn.mousewheel&&u.mousewheel(function(n,t,i,f){var e=u.scrollTop();f>0&&e-f<=0?(u.scrollTop(0),r(n)):f<0&&u.get(0).scrollHeight-u.scrollTop()+f<=u.height()&&(u.scrollTop(u.get(0).scrollHeight-u.height()),r(n))});tt(f);f.bind("keyup-change",this.bind(this.updateResults));f.bind("focus",function(){f.addClass("select2-focused");f.val()===" "&&f.val("")});f.bind("blur",function(){f.removeClass("select2-focused")});this.dropdown.delegate(e,"mouseup",this.bind(function(t){n(t.target).closest(".select2-result-selectable:not(.select2-disabled)").length>0?(this.highlightUnderEvent(t),this.selectHighlighted(t)):this.focusSearch();r(t)}));this.dropdown.bind("click mouseup mousedown",function(n){n.stopPropagation()});n.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource());(i.element.is(":disabled")||i.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var n=this.opts.element.data("select2");n!==t&&(n.container.remove(),n.dropdown.remove(),n.opts.element.removeData("select2").unbind(".select2").show())},prepareOpts:function(i){var u,f,o,r;if(u=i.element,u.get(0).tagName.toLowerCase()==="select"&&(this.select=f=i.element),f&&n.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");}),i=n.extend({},{populateResults:function(r,u,f){var e,s=this.opts.id,o=this;e=function(r,u,h){for(var l,k,p,c,v,y,w,a=0,b=r.length;a<b;a=a+1)l=r[a],k=s(l)!==t,p=l.children&&l.children.length>0,c=n("<li><\/li>"),c.addClass("select2-results-dept-"+h),c.addClass("select2-result"),c.addClass(k?"select2-result-selectable":"select2-result-unselectable"),p&&c.addClass("select2-result-with-children"),c.addClass(o.opts.formatResultCssClass(l)),v=n("<div><\/div>"),v.addClass("select2-result-label"),w=i.formatResult(l,v,f),w!==t&&v.html(o.opts.escapeMarkup(w)),c.append(v),p&&(y=n("<ul><\/ul>"),y.addClass("select2-result-sub"),e(l.children,y,h+1),c.append(y)),c.data("select2-data",l),u.append(c)};e(u,r,0)}},n.fn.select2.defaults,i),typeof i.id!="function"&&(o=i.id,i.id=function(n){return n[o]}),f?(i.query=this.bind(function(i){var o={results:[],more:!1},s=i.term,r,f,e;e=function(n,t){var r;n.is("option")?i.matcher(s,n.text(),n)&&t.push({id:n.attr("value"),text:n.text(),element:n.get(),css:n.attr("class")}):n.is("optgroup")&&(r={text:n.attr("label"),children:[],element:n.get(),css:n.attr("class")},n.children().each2(function(n,t){e(t,r.children)}),r.children.length>0&&t.push(r))};r=u.children();this.getPlaceholder()!==t&&r.length>0&&(f=r[0],n(f).text()===""&&(r=r.not(f)));r.each2(function(n,t){e(t,o.results)});i.callback(o)}),i.id=function(n){return n.id},i.formatResultCssClass=function(n){return n.css}):"query"in i||("ajax"in i?(r=i.element.data("ajax-url"),r&&r.length>0&&(i.ajax.url=r),i.query=b(i.ajax)):"data"in i?i.query=k(i.data):"tags"in i&&(i.query=d(i.tags),i.createSearchChoice=function(n){return{id:n,text:n}},i.initSelection=function(t,r){var u=[];n(y(t.val(),i.separator)).each(function(){var r=this,f=this,t=i.tags;n.isFunction(t)&&(t=t());n(t).each(function(){if(e(this.id,r))return f=this.text,!1});u.push({id:r,text:f})});r(u)})),typeof i.query!="function")throw"query function not defined for Select2 "+i.element.attr("id");return i},monitorSource:function(){this.opts.element.bind("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()}))},triggerChange:function(t){t=t||{};t=n.extend({},t,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",!0);this.opts.element.trigger(t);this.opts.element.data("select2-change-triggered",!1);this.opts.element.click();this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){this.enabled||(this.enabled=!0,this.container.removeClass("select2-container-disabled"))},disable:function(){this.enabled&&(this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"))},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var i=this.container.offset(),l=this.container.outerHeight(),a=this.container.outerWidth(),u=this.dropdown.outerHeight(),v=n(window).scrollTop()+document.documentElement.clientHeight,r=i.top+l,e=i.left,o=r+u<=v,s=i.top-u>=this.body().scrollTop(),y=this.dropdown.hasClass("select2-drop-above"),f,t,c;this.body().css("position")!=="static"&&(f=this.body().offset(),r-=f.top,e-=f.left);y?(t=!0,!s&&o&&(t=!1)):(t=!1,!o&&s&&(t=!0));t?(r=i.top-u,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above"));c=n.extend({top:r,left:e,width:a},h(this.opts.dropdownCss));this.dropdown.css(c)},shouldOpen:function(){var t;return this.opened()?!1:(t=n.Event("open"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,i=this.containerSelector,r="scroll."+t,u="resize."+t;this.container.parents().each(function(){n(this).bind(r,function(){var t=n(i);t.length==0&&n(this).unbind(r);t.select2("close")})});n(window).bind(u,function(){var t=n(i);t.length==0&&n(window).unbind(u);t.select2("close")});this.clearDropdownAlignmentPreference();this.search.val()===" "&&this.search.val("");this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(!0);this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(this.opened()){var t=this;this.container.parents().each(function(){n(this).unbind("scroll."+t.containerId)});n(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(n.Event("close"))}},clearSearch:function(){},ensureHighlightVisible:function(){var t=this.results,e,i,r,u,o,s,f;if(i=this.highlight(),!(i<0)){if(i==0){t.scrollTop(0);return}e=t.find(".select2-result-selectable");r=n(e[i]);u=r.offset().top+r.outerHeight();i===e.length-1&&(f=t.find("li.select2-more-results"),f.length>0&&(u=f.offset().top+f.outerHeight()));o=t.offset().top+t.outerHeight();u>o&&t.scrollTop(t.scrollTop()+(u-o));s=r.offset().top-t.offset().top;s<0&&t.scrollTop(t.scrollTop()+s)}},moveHighlight:function(t){for(var u=this.results.find(".select2-result-selectable"),i=this.highlight(),r;i>-1&&i<u.length;)if(i+=t,r=n(u[i]),r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")){this.highlight(i);break}},highlight:function(t){var i=this.results.find(".select2-result-selectable").not(".select2-disabled");if(arguments.length===0)return u(i.filter(".select2-highlighted")[0],i.get());t>=i.length&&(t=i.length-1);t<0&&(t=0);i.removeClass("select2-highlighted");n(i[t]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length},highlightUnderEvent:function(t){var i=n(t.target).closest(".select2-result-selectable"),r;i.length>0&&!i.is(".select2-highlighted")?(r=this.results.find(".select2-result-selectable"),this.highlight(r.index(i))):i.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var t=this.results,i=t.find("li.select2-more-results"),u,r=this.resultsPage+1,n=this,f=this.search.val(),e=this.context;i.length!==0&&(u=i.offset().top-t.offset().top-t.height(),u<=0&&(i.addClass("select2-active"),this.opts.query({term:f,page:r,context:e,matcher:this.opts.matcher,callback:this.bind(function(u){n.opened()&&(n.opts.populateResults.call(this,t,u.results,{term:f,page:r,context:e}),u.more===!0?(i.detach().appendTo(t).text(n.opts.formatLoadMore(r+1)),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):i.remove(),n.positionDropdown(),n.resultsPage=r)})})))},tokenize:function(){},updateResults:function(i){function a(){o.scrollTop(0);u.removeClass("select2-active");f.positionDropdown()}function c(n){o.html(f.opts.escapeMarkup(n));a()}var u=this.search,o=this.results,r=this.opts,l,f=this,h;if(i===!0||this.showSearchInput!==!1&&this.opened()){if(u.addClass("select2-active"),r.maximumSelectionSize>=1&&(l=this.data(),n.isArray(l)&&l.length>=r.maximumSelectionSize&&s(r.formatSelectionTooBig,"formatSelectionTooBig"))){c("<li class='select2-selection-limit'>"+r.formatSelectionTooBig(r.maximumSelectionSize)+"<\/li>");return}if(u.val().length<r.minimumInputLength&&s(r.formatInputTooShort,"formatInputTooShort")){c("<li class='select2-no-results'>"+r.formatInputTooShort(u.val(),r.minimumInputLength)+"<\/li>");return}c("<li class='select2-searching'>"+r.formatSearching()+"<\/li>");h=this.tokenize();h!=t&&h!=null&&u.val(h);this.resultsPage=1;r.query({term:u.val(),page:this.resultsPage,context:null,matcher:r.matcher,callback:this.bind(function(h){var l;if(this.opened()){if(this.context=h.context===t?null:h.context,this.opts.createSearchChoice&&u.val()!==""&&(l=this.opts.createSearchChoice.call(null,u.val(),h.results),l!==t&&l!==null&&f.id(l)!==t&&f.id(l)!==null&&n(h.results).filter(function(){return e(f.id(this),f.id(l))}).length===0&&h.results.unshift(l)),h.results.length===0&&s(r.formatNoMatches,"formatNoMatches")){c("<li class='select2-no-results'>"+r.formatNoMatches(u.val())+"<\/li>");return}o.empty();f.opts.populateResults.call(this,o,h.results,{term:u.val(),page:this.resultsPage,context:null});h.more===!0&&s(r.formatLoadMore,"formatLoadMore")&&(o.append("<li class='select2-more-results'>"+f.opts.escapeMarkup(r.formatLoadMore(this.resultsPage))+"<\/li>"),window.setTimeout(function(){f.loadMoreIfNeeded()},10));this.postprocessResults(h,i);a()}})})}},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus();window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var i=this.highlight(),n=this.results.find(".select2-highlighted").not(".select2-disabled"),t=n.closest(".select2-result-selectable").data("select2-data");if(t){n.addClass("select2-disabled");this.highlight(i);this.onSelect(t)}},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function r(){var i,f,u,r,e;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth()===0?"auto":this.opts.element.outerWidth()+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){if(i=this.opts.element.attr("style"),i!==t)for(f=i.split(";"),r=0,e=f.length;r<e;r=r+1)if(u=f[r].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/),u!==null&&u.length>=1)return u[1];return this.opts.width==="resolve"?(i=this.opts.element.css("width"),i.indexOf("%")>0)?i:this.opts.element.outerWidth()===0?"auto":this.opts.element.outerWidth()+"px":null}return n.isFunction(this.opts.width)?this.opts.width():this.opts.width}var i=r.call(this);i!==null&&this.container.attr("style","width: "+i)}});c=a(o,{createContainer:function(){return n("<div><\/div>",{"class":"select2-container"}).html("    <a href='#' onclick='return false;' class='select2-choice'>   <span><\/span><abbr class='select2-search-choice-close' style='display:none;'><\/abbr>   <div><b><\/b><\/div><\/a>    <div class='select2-drop select2-offscreen'>   <div class='select2-search'>       <input type='text' autocomplete='off' class='select2-input'/>   <\/div>   <ul class='select2-results'>   <\/ul><\/div>")},opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show())},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()},initContainer:function(){var n,u=this.container,f=this.dropdown,t=!1;this.selection=n=u.find(".select2-choice");this.search.bind("keydown",this.bind(function(n){if(this.enabled){if(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN){r(n);return}if(this.opened())switch(n.which){case i.UP:case i.DOWN:this.moveHighlight(n.which===i.UP?-1:1);r(n);return;case i.TAB:case i.ENTER:this.selectHighlighted();r(n);return;case i.ESC:this.cancel(n);r(n);return}else{if(n.which===i.TAB||i.isControl(n)||i.isFunctionKey(n)||n.which===i.ESC)return;if(this.opts.openOnEnter===!1&&n.which===i.ENTER)return;if(this.open(),n.which===i.ENTER)return}}}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));n.bind("mousedown",this.bind(function(){t=!0;this.opened()?(this.close(),this.selection.focus()):this.enabled&&this.open();t=!1}));f.bind("mousedown",this.bind(function(){this.search.focus()}));n.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));n.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));n.bind("keydown",this.bind(function(n){if(this.enabled){if(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN){r(n);return}if(n.which!==i.TAB&&!i.isControl(n)&&!i.isFunctionKey(n)&&n.which!==i.ESC&&(this.opts.openOnEnter!==!1||n.which!==i.ENTER)){if(n.which==i.DELETE){this.opts.allowClear&&this.clear();return}if(this.open(),n.which===i.ENTER){r(n);return}if(n.which<48){r(n);return}var t=String.fromCharCode(n.which).toLowerCase();n.shiftKey&&(t=t.toUpperCase());this.search.focus();this.search.val(t);r(n)}}}));n.delegate("abbr","mousedown",this.bind(function(n){this.enabled&&(this.clear(),r(n),this.close(),this.triggerChange(),this.selection.focus())}));this.setPlaceholder();this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){var n;this.opts.element.val()===""?(this.close(),this.setPlaceholder()):(n=this,this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&i!==null&&(n.updateSelection(i),n.close(),n.setPlaceholder())}))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"&&(t.initSelection=function(t,i){var r=t.find(":selected");n.isFunction(i)&&i({id:r.attr("value"),text:r.text()})}),t},setPlaceholder:function(){var n=this.getPlaceholder();if(this.opts.element.val()===""&&n!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(n));this.selection.addClass("select2-default");this.selection.find("abbr").hide()}},postprocessResults:function(t,i){var u=0,f=this,r=!0;this.results.find(".select2-result-selectable").each2(function(n,t){if(e(f.id(t.data("select2-data")),f.opts.element.val()))return u=n,!1});this.highlight(u);i===!0&&(r=this.showSearchInput=g(t.results)>=this.opts.minimumResultsForSearch,this.dropdown.find(".select2-search")[r?"removeClass":"addClass"]("select2-search-hidden"),n(this.dropdown,this.container)[r?"addClass":"removeClass"]("select2-with-searchbox"))},onSelect:function(n){var t=this.opts.element.val();this.opts.element.val(this.id(n));this.updateSelection(n);this.close();this.selection.focus();e(t,this.id(n))||this.triggerChange()},updateSelection:function(n){var i=this.selection.find("span"),r;this.selection.data("select2-data",n);i.empty();r=this.opts.formatSelection(n,i);r!==t&&i.append(this.opts.escapeMarkup(r));this.selection.removeClass("select2-default");this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var n,r=null,i=this;if(arguments.length===0)return this.opts.element.val();if(n=arguments[0],this.select)this.select.val(n).find(":selected").each2(function(n,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!n){this.clear();return}this.opts.element.val(n);this.opts.initSelection(this.opts.element,function(n){i.opts.element.val(n?i.id(n):"");i.updateSelection(n);i.setPlaceholder()})}},clearSearch:function(){this.search.val("")},data:function(n){var i;if(arguments.length===0)return i=this.selection.data("select2-data"),i==t&&(i=null),i;n&&n!==""?(this.opts.element.val(n?this.id(n):""),this.updateSelection(n)):this.clear()}});l=a(o,{createContainer:function(){return n("<div><\/div>",{"class":"select2-container select2-container-multi"}).html("    <ul class='select2-choices'>  <li class='select2-search-field'>    <input type='text' autocomplete='off' class='select2-input'>  <\/li><\/ul><div class='select2-drop select2-drop-multi' style='display:none;'>   <ul class='select2-results'>   <\/ul><\/div>")},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"&&(t.initSelection=function(t,i){var r=[];t.find(":selected").each2(function(n,t){r.push({id:t.attr("value"),text:t.text()})});n.isFunction(i)&&i(r)}),t},initContainer:function(){var u=".select2-choices",t;this.searchContainer=this.container.find(".select2-search-field");this.selection=t=this.container.find(u);this.search.bind("keydown",this.bind(function(n){if(this.enabled){if(n.which===i.BACKSPACE&&this.search.val()===""){this.close();var u,f=t.find(".select2-search-choice-focus");if(f.length>0){this.unselect(f.first());this.search.width(10);r(n);return}u=t.find(".select2-search-choice");u.length>0&&u.last().addClass("select2-search-choice-focus")}else t.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(n.which){case i.UP:case i.DOWN:this.moveHighlight(n.which===i.UP?-1:1);r(n);return;case i.ENTER:case i.TAB:this.selectHighlighted();r(n);return;case i.ESC:this.cancel(n);r(n);return}n.which===i.TAB||i.isControl(n)||i.isFunctionKey(n)||n.which===i.BACKSPACE||n.which===i.ESC||(this.opts.openOnEnter!==!1||n.which!==i.ENTER)&&(this.open(),(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN)&&r(n))}}));this.search.bind("keyup",this.bind(this.resizeSearch));this.search.bind("blur",this.bind(function(n){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.clearSearch();n.stopImmediatePropagation()}));this.container.delegate(u,"mousedown",this.bind(function(t){this.enabled&&(n(t.target).closest(".select2-search-choice").length>0||(this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()))}));this.container.delegate(u,"focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())}));this.clearSearch()},enable:function(){this.enabled||(this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled"))},disable:function(){this.enabled&&(this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0))},initSelection:function(){var n;this.opts.element.val()===""&&(this.updateSelection([]),this.close(),this.clearSearch());(this.select||this.opts.element.val()!=="")&&(n=this,this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&i!==null&&(n.updateSelection(i),n.close(),n.clearSearch())}))},clearSearch:function(){var n=this.getPlaceholder();n!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(n).addClass("select2-default"),this.resizeSearch()):this.search.val(" ").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")?this.search.val("").removeClass("select2-default"):this.search.val()===" "&&this.search.val("")},opening:function(){this.parent.opening.apply(this,arguments);this.clearPlaceholder();this.resizeSearch();this.focusSearch()},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var r=[],f=[],i=this;n(t).each(function(){u(i.id(this),r)<0&&(r.push(i.id(this)),f.push(this))});t=f;this.selection.find(".select2-search-choice").remove();n(t).each(function(){i.addSelectedChoice(this)});i.postprocessResults()},tokenize:function(){var n=this.search.val();n=this.opts.tokenizer(n,this.data(),this.bind(this.onSelect),this.opts);n!=null&&n!=t&&(this.search.val(n),n.length>0&&this.open())},onSelect:function(n){this.addSelectedChoice(n);this.select&&this.postprocessResults();this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.positionDropdown()):this.close();this.triggerChange({added:n});this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(t){var i=n("<li class='select2-search-choice'>    <div><\/div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'><\/a><\/li>"),e=this.id(t),u=this.getVal(),f;f=this.opts.formatSelection(t,i);i.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"<\/div>");i.find(".select2-search-choice-close").bind("mousedown",r).bind("click dblclick",this.bind(function(t){this.enabled&&(n(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(n(t.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue(),r(t))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));i.data("select2-data",t);i.insertBefore(this.searchContainer);u.push(e);this.setVal(u)},unselect:function(n){var t=this.getVal(),i,r;if(n=n.closest(".select2-search-choice"),n.length===0)throw"Invalid argument: "+n+". Must be .select2-search-choice";i=n.data("select2-data");r=u(this.id(i),t);r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults());n.remove();this.triggerChange({removed:i})},postprocessResults:function(){var i=this.getVal(),n=this.results.find(".select2-result-selectable"),r=this.results.find(".select2-result-with-children"),t=this;n.each2(function(n,r){var f=t.id(r.data("select2-data"));u(f,i)>=0?r.addClass("select2-disabled").removeClass("select2-result-selectable"):r.removeClass("select2-disabled").addClass("select2-result-selectable")});r.each2(function(n,t){t.find(".select2-result-selectable").length==0?t.addClass("select2-disabled"):t.removeClass("select2-disabled")});n.each2(function(n,i){if(!i.hasClass("select2-disabled")&&i.hasClass("select2-result-selectable"))return t.highlight(0),!1})},resizeSearch:function(){var r,u,t,f,n,i=nt(this.search);r=ft(this.search)+10;u=this.search.offset().left;t=this.selection.width();f=this.selection.offset().left;n=t-(u-f)-i;n<r&&(n=t-i);n<40&&(n=t-i);this.search.width(n)},getVal:function(){var n;return this.select?(n=this.select.val(),n===null?[]:n):(n=this.opts.element.val(),y(n,this.opts.separator))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],n(t).each(function(){u(this,i)<0&&i.push(this)}),this.opts.element.val(i.length===0?"":i.join(this.opts.separator)))},val:function(){var r,u=[],i=this;if(arguments.length===0)return this.getVal();if(r=arguments[0],!r){this.opts.element.val("");this.updateSelection([]);this.clearSearch();return}if(this.setVal(r),this.select)this.select.find(":selected").each(function(){u.push({id:n(this).attr("value"),text:n(this).text()})}),this.updateSelection(u);else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var r=n(t).map(i.id);i.setVal(r);i.updateSelection(t);i.clearSearch()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(n(this).data("select2-data")))});this.setVal(t);this.triggerChange()},data:function(t){var r=this,i;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return n(this).data("select2-data")}).get();t||(t=[]);i=n.map(t,function(n){return r.opts.id(n)});this.setVal(i);this.updateSelection(t);this.clearSearch()}});n.fn.select2=function(){var i=Array.prototype.slice.call(arguments,0),r,f,e,o,s=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(i.length===0||typeof i[0]=="object")r=i.length===0?{}:n.extend({},i[0]),r.element=n(this),r.element.get(0).tagName.toLowerCase()==="select"?o=r.element.attr("multiple"):(o=r.multiple||!1,"tags"in r&&(r.multiple=o=!0)),f=o?new l:new c,f.init(r);else if(typeof i[0]=="string"){if(u(i[0],s)<0)throw"Unknown method: "+i[0];if(e=t,f=n(this).data("select2"),f===t)return;if(e=i[0]==="container"?f.container:f[i[0]].apply(f,i.slice(1)),e!==t)return!1}else throw"Invalid arguments to select2 plugin: "+i;}),e===t?this:e};n.fn.select2.defaults={width:"copy",closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(n,t,i){var r=[];return w(n.text,i.term,r),r.join("")},formatSelection:function(n){return n?n.text:t},formatResultCssClass:function(){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(n,t){return"Please enter "+(t-n.length)+" more characters"},formatSelectionTooBig:function(n){return"You can only select "+n+" item"+(n==1?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(n){return n.id},matcher:function(n,t){return t.toUpperCase().indexOf(n.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:et,escapeMarkup:function(n){return n&&typeof n=="string"?n.replace(/&/g,"&amp;"):n},blurOnChange:!1};window.Select2={query:{ajax:b,local:k,tags:d},util:{debounce:p,markMatch:w},"class":{abstract:o,single:c,multi:l}}}}(jQuery);var getRequirementsUrl=$.cyriauto.root+"cyri/requirementsurl",getIntroPage=$.cyriauto.root+"cyri/requirements/",getWebApi=$.cyriauto.root+"cyri/api/canyourunit/item/"