var angellist=angellist||{};angellist.company_selector={version:"1.2",labels:{remove:"Delete",no_results:"No results found.",search:"Add a company:",search_placeholder:"Start typing..."},company_ids:[],create_company_list:function(){var a=jQuery("#angellist-company-selector-results");if(a.length===0){return}a.html("");angellist.company_selector.company_list=jQuery("
    ").attr("id","angellist-company-selector-companies");a.append(angellist.company_selector.company_list);angellist.company_selector.enable_editable_company_list()},add_company:function(c){if(!jQuery.isPlainObject(c)||c.value===undefined||c.value===""||c.label===undefined||jQuery.inArray(c.value,angellist.company_selector.company_ids)>-1){return}if(angellist.company_selector.company_list===undefined||angellist.company_selector.company_list.length===0){angellist.company_selector.create_company_list()}var b=angellist.company_selector.company_ids.length;var a=jQuery("
  1. ").text(c.label);a.append(jQuery("").attr({type:"hidden",name:"angellist-company["+b+"][id]"}).addClass("angellist-company-id").val(c.value));a.append(jQuery("").attr({type:"hidden",name:"angellist-company["+b+"][name]"}).val(c.label));a.append(angellist.company_selector.company_delete_button());a.mouseenter(angellist.company_selector.company_mouseenter).mouseleave(angellist.company_selector.company_mouseleave);angellist.company_selector.company_list.append(a);angellist.company_selector.company_ids.push(c.value);if(angellist.company_selector.company_ids.length==2){angellist.company_selector.enable_editable_company_list()}},company_delete_button:function(){return jQuery("