},f=function(a){a.length=0;varc=a.getAttribute("data-default-option"),e=c?c:b,f=a.getAttribute("data-default-value"),j=a.getAttribute("data-value"),k=0;a.options[0]=newOption(e,"");for(varl=0;l<d.length;l++){varm="2-char"===j?d[l][1]:d[l][0];a.options[a.length]=newOption(d[l][0],m),null!=f&&f===m&&(k=l+1)}a.selectedIndex=k;varn=a.getAttribute("data-region-id");if(n){varo=document.getElementById(n);if(o){if(g(o),a.onchange=function(){i(a,o)},null!==f){i(a,o);varp=o.getAttribute("data-default-value");if(null!==p){varq=d[a.selectedIndex-1][2].split("|");h(o,q,p)}}}elseconsole.error("Region dropdown DOM node with ID "+n+" not found.")}},g=function(a){varb=a.getAttribute("data-blank-option"),c=b?b:"-";a.length=0,a.options[0]=newOption(c,""),a.selectedIndex=0},h=function(a,b,c){for(vard=0;d<b.length;d++)if(b[d]===c){a.selectedIndex=d+1;break}},i=function(a,b){vare=a.selectedIndex-1,f=b.getAttribute("data-default-option"),h=f?f:c;if(""===a.value)g(b);else{b.length=0,b.options[0]=newOption(h,"");for(vari=d[e][2].split("|"),j=0;j<i.length;j++)b.options[b.length]=newOption(i[j],i[j]);b.selectedIndex=0}},j=function(a,b){varc=!1,d=!0,e=a.document,f=e.documentElement,g=e.addEventListener?"addEventListener":"attachEvent",h=e.addEventListener?"removeEventListener":"detachEvent",i=e.addEventListener?"":"on",j=function(d){("readystatechange"!=d.type||"complete"==e.readyState)&&(("load"==d.type?a:e)[h](i+d.type,j,!1),!c&&(c=!0)&&b.call(a,d.type||d))},k=function(){try{f.doScroll("left")}catch(a){returnvoidsetTimeout(k,50)}j("poll")};if("complete"==e.readyState)b.call(a,"lazy");else{if(e.createEventObject&&f.doScroll){try{d=!a.frameElement}catch(l){}d&&k()}e[g](i+"DOMContentLoaded",j,!1),e[g](i+"readystatechange",j,!1),a[g](i+"load",j,!1)}};j(window,e)}();