(function(e){e.fn.extend({autocomplete:function(a,b){var v=typeof a=="string";b=e.extend({},e.Autocompleter.defaults,{url:v?a:null,data:v?null:a,delay:v?e.Autocompleter.defaults.delay:10,max:b&&!b.scroll?10:150},b);b.highlight=b.highlight||function(p){return p};b.formatMatch=b.formatMatch||b.formatItem;return this.each(function(){new e.Autocompleter(this,b)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")}, setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}});e.Autocompleter=function(a,b){function v(){var c=q.selected();if(!c)return false;var f=c.result;u=f;if(b.multiple){var w=A(k.val());if(w.length>1)f=w.slice(0,w.length-1).join(b.multipleSeparator)+b.multipleSeparator+f;f+=b.multipleSeparator}k.val(f);o();k.trigger("result",[c.data,c.value]);return true}function p(c,f){if(j==n.DEL)q.hide();else{c=k.val();if(!(!f&&c==u)){u= c;c=r(c);if(c.length>=b.minChars){k.addClass(b.loadingClass);b.matchCase||(c=c.toLowerCase());s(c,t,o)}else{h();q.hide()}}}}function A(c){if(!c)return[""];c=c.split(b.multipleSeparator);var f=[];e.each(c,function(w,l){if(e.trim(l))f[w]=e.trim(l)});return f}function r(c){if(!b.multiple)return c;c=A(c);return c[c.length-1]}function x(c,f){if(b.autoFill&&r(k.val()).toLowerCase()==c.toLowerCase()&&j!=n.BACKSPACE){k.val(k.val()+f.substring(r(u).length));e.Autocompleter.Selection(a,u.length,u.length+f.length)}} function i(){clearTimeout(z);z=setTimeout(o,200)}function o(){var c=q.visible();q.hide();clearTimeout(z);h();b.mustMatch&&k.search(function(f){if(!f)if(b.multiple){f=A(k.val()).slice(0,-1);k.val(f.join(b.multipleSeparator)+(f.length?b.multipleSeparator:""))}else k.val("")});c&&e.Autocompleter.Selection(a,a.value.length,a.value.length)}function t(c,f){if(f&&f.length&&d){h();q.display(f,c);x(c,f[0].value);q.show()}else o()}function s(c,f,w){b.matchCase||(c=c.toLowerCase());var l=m.load(c);if(l&&l.length)f(c, l);else if(typeof b.url=="string"&&b.url.length>0){var B={timestamp:+new Date};e.each(b.extraParams,function(y,D){B[y]=typeof D=="function"?D():D});e.ajax({mode:"abort",port:"autocomplete"+a.name,dataType:b.dataType,url:b.url,data:e.extend({q:r(c),limit:b.max},B),success:function(y){y=b.parse&&b.parse(y)||g(y);m.add(c,y);f(c,y)}})}else{q.emptyList();w(c)}}function g(c){var f=[];c=c.split("\n");for(var w=0;w<c.length;w++){var l=e.trim(c[w]);if(l){l=l.split("|");f[f.length]={data:l,value:l[0],result:b.formatResult&& b.formatResult(l,l[0])||l[0]}}}return f}function h(){k.removeClass(b.loadingClass)}var n={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8},k=e(a).attr("autocomplete","off").addClass(b.inputClass),z,u="",m=e.Autocompleter.Cache(b),d=0,j,C={mouseDownOnSelect:false},q=e.Autocompleter.Select(b,a,v,C),E;e.browser.opera&&e(a.form).bind("submit.autocomplete",function(){if(E)return E=false});k.bind((e.browser.opera?"keypress":"keydown")+".autocomplete",function(c){j= c.keyCode;switch(c.keyCode){case n.UP:c.preventDefault();q.visible()?q.prev():p(0,true);break;case n.DOWN:c.preventDefault();q.visible()?q.next():p(0,true);break;case n.PAGEUP:c.preventDefault();q.visible()?q.pageUp():p(0,true);break;case n.PAGEDOWN:c.preventDefault();q.visible()?q.pageDown():p(0,true);break;case b.multiple&&e.trim(b.multipleSeparator)==","&&n.COMMA:case n.TAB:case n.RETURN:if(v()){c.preventDefault();E=true;return false}break;case n.ESC:q.hide();break;default:clearTimeout(z);z=setTimeout(p, b.delay);break}}).focus(function(){d++}).blur(function(){d=0;C.mouseDownOnSelect||i()}).click(function(){d++>1&&!q.visible()&&p(0,true)}).bind("search",function(){function c(w,l){var B;if(l&&l.length)for(var y=0;y<l.length;y++)if(l[y].result.toLowerCase()==w.toLowerCase()){B=l[y];break}typeof f=="function"?f(B):k.trigger("result",B&&[B.data,B.value])}var f=arguments.length>1?arguments[1]:null;e.each(A(k.val()),function(w,l){s(l,c,c)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(c, f){e.extend(b,f);"data"in f&&m.populate()}).bind("unautocomplete",function(){q.unbind();k.unbind();e(a.form).unbind(".autocomplete")})};e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(a){return a[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(a, b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};e.Autocompleter.Cache=function(a){function b(i,o){a.matchCase||(i=i.toLowerCase());var t=i.indexOf(o);if(a.matchContains=="word")t=i.toLowerCase().search("\\b"+o.toLowerCase());if(t==-1)return false;return t==0||a.matchContains}function v(i,o){x>a.cacheLength&&A();r[i]||x++;r[i]=o}function p(){if(!a.data)return false; var i={},o=0;if(!a.url)a.cacheLength=1;i[""]=[];for(var t=0,s=a.data.length;t<s;t++){var g=a.data[t];g=typeof g=="string"?[g]:g;var h=a.formatMatch(g,t+1,a.data.length);if(h!==false){var n=h.charAt(0).toLowerCase();i[n]||(i[n]=[]);g={value:h,data:g,result:a.formatResult&&a.formatResult(g)||h};i[n].push(g);o++<a.max&&i[""].push(g)}}e.each(i,function(k,z){a.cacheLength++;v(k,z)})}function A(){r={};x=0}var r={},x=0;setTimeout(p,25);return{flush:A,add:v,populate:p,load:function(i){if(!a.cacheLength|| !x)return null;if(!a.url&&a.matchContains){var o=[];for(var t in r)if(t.length>0){var s=r[t];e.each(s,function(g,h){b(h.value,i)&&o.push(h)})}return o}else if(r[i])return r[i];else if(a.matchSubset)for(t=i.length-1;t>=a.minChars;t--)if(s=r[i.substr(0,t)]){o=[];e.each(s,function(g,h){if(b(h.value,i))o[o.length]=h});return o}return null}}};e.Autocompleter.Select=function(a,b,v,p){function A(){if(z){u=e("<div/>").hide().addClass(a.resultsClass).css("position","absolute").appendTo(document.body);m=e("<ul/>").appendTo(u).mouseover(function(d){if(r(d).nodeName&& r(d).nodeName.toUpperCase()=="LI"){h=e("li",m).removeClass(s.ACTIVE).index(r(d));e(r(d)).addClass(s.ACTIVE)}}).click(function(d){e(r(d)).addClass(s.ACTIVE);v();b.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});a.width>0&&u.css("width",a.width);z=false}}function r(d){for(d=d.target;d&&d.tagName!="LI";)d=d.parentNode;if(!d)return[];return d}function x(d){g.slice(h,h+1).removeClass(s.ACTIVE);i(d);d=g.slice(h,h+1).addClass(s.ACTIVE); if(a.scroll){var j=0;g.slice(0,h).each(function(){j+=this.offsetHeight});if(j+d[0].offsetHeight-m.scrollTop()>m[0].clientHeight)m.scrollTop(j+d[0].offsetHeight-m.innerHeight());else j<m.scrollTop()&&m.scrollTop(j)}}function i(d){h+=d;if(h<0)h=g.size()-1;else if(h>=g.size())h=0}function o(d){return a.max&&a.max<d?a.max:d}function t(){m.empty();for(var d=o(n.length),j=0;j<d;j++)if(n[j]){var C=a.formatItem(n[j].data,j+1,d,n[j].value,k);if(C!==false){C=e("<li/>").html(a.highlight(C,k)).addClass(j%2== 0?"ac_even":"ac_odd").appendTo(m)[0];e.data(C,"ac_data",n[j])}}g=m.find("li");if(a.selectFirst){g.slice(0,1).addClass(s.ACTIVE);h=0}e.fn.bgiframe&&m.bgiframe()}var s={ACTIVE:"ac_over"},g,h=-1,n,k="",z=true,u,m;return{display:function(d,j){A();n=d;k=j;t()},next:function(){x(1)},prev:function(){x(-1)},pageUp:function(){h!=0&&h-8<0?x(-h):x(-8)},pageDown:function(){h!=g.size()-1&&h+8>g.size()?x(g.size()-1-h):x(8)},hide:function(){u&&u.hide();g&&g.removeClass(s.ACTIVE);h=-1},visible:function(){return u&& u.is(":visible")},current:function(){return this.visible()&&(g.filter("."+s.ACTIVE)[0]||a.selectFirst&&g[0])},show:function(){var d=e(b).offset();u.css({width:typeof a.width=="string"||a.width>0?a.width:e(b).width(),top:d.top+b.offsetHeight,left:d.left}).show();if(a.scroll){m.scrollTop(0);m.css({maxHeight:a.scrollHeight,overflow:"auto"});if(e.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var j=0;g.each(function(){j+=this.offsetHeight});d=j>a.scrollHeight;m.css("height",d?a.scrollHeight: j);d||g.width(m.width()-parseInt(g.css("padding-left"))-parseInt(g.css("padding-right")))}}},selected:function(){var d=g&&g.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return d&&d.length&&e.data(d[0],"ac_data")},emptyList:function(){m&&m.empty()},unbind:function(){u&&u.remove()}}};e.Autocompleter.Selection=function(a,b,v){if(a.createTextRange){var p=a.createTextRange();p.collapse(true);p.moveStart("character",b);p.moveEnd("character",v);p.select()}else if(a.setSelectionRange)a.setSelectionRange(b, v);else if(a.selectionStart){a.selectionStart=b;a.selectionEnd=v}a.focus()}})(jQuery); var regions=[{area:"Worldwide",country:"Antarctica"},{area:"Worldwide",country:"Antigua and Barbuda"},{area:"Worldwide",country:"Argentina"},{area:"Worldwide",country:"Aruba"},{area:"Worldwide",country:"Bahamas"},{area:"Worldwide",country:"Barbados"},{area:"Worldwide",country:"Belize"},{area:"Worldwide",country:"Bermuda"},{area:"Worldwide",country:"Bolivia"},{area:"Worldwide",country:"Brazil"},{area:"Worldwide",country:"British Virgin Is."},{area:"Worldwide",country:"Canada"},{area:"Worldwide",country:"Cayman Is."}, {area:"Worldwide",country:"Chile"},{area:"Worldwide",country:"Colombia"},{area:"Worldwide",country:"Costa Rica"},{area:"Worldwide",country:"Cuba"},{area:"Worldwide",country:"Curacao"},{area:"Worldwide",country:"Dominica"},{area:"Worldwide",country:"Dominican Republic"},{area:"Worldwide",country:"Ecuador"},{area:"Worldwide",country:"El Salvador"},{area:"Worldwide",country:"Falkland Is."},{area:"Worldwide",country:"French Guiana"},{area:"Worldwide",country:"Galapagos Is"},{area:"Worldwide",country:"Greenland"}, {area:"Worldwide",country:"Grenada"},{area:"Worldwide",country:"Guadeloupe"},{area:"Worldwide",country:"Guatemala"},{area:"Worldwide",country:"Guyana"},{area:"Worldwide",country:"Haiti"},{area:"Worldwide",country:"Honduras"},{area:"Worldwide",country:"Iran"},{area:"Worldwide",country:"Iraq"},{area:"Worldwide",country:"Israel"},{area:"Worldwide",country:"Jamaica"},{area:"Worldwide",country:"Jordan"},{area:"Worldwide",country:"Kuwait"},{area:"Worldwide",country:"Lebanon"},{area:"Worldwide",country:"Martinique"}, {area:"Worldwide",country:"Mexico"},{area:"Worldwide",country:"Montserrat"},{area:"Worldwide",country:"Nicaragua"},{area:"Worldwide",country:"Panama"},{area:"Worldwide",country:"Paraguay"},{area:"Worldwide",country:"Peru"},{area:"Worldwide",country:"Puerto Rico"},{area:"Worldwide",country:"Qatar"},{area:"Worldwide",country:"Saint Kitts and Nevis"},{area:"Worldwide",country:"Saint Lucia"},{area:"Worldwide",country:"Saudi Arabia"},{area:"Worldwide",country:"St Vincent"},{area:"Worldwide",country:"Syria"}, {area:"Worldwide",country:"Trinidad and Tobago"},{area:"Worldwide",country:"U.S Virgin Is."},{area:"Worldwide",country:"US Virgin Is."},{area:"Worldwide",country:"United Arab Emirates"},{area:"Worldwide",country:"Uruguay"},{area:"Worldwide",country:"USA"},{area:"Worldwide",country:"United States of America"},{area:"Worldwide",country:"Venezuela"},{area:"Europe",country:"Afghanistan"},{area:"Europe",country:"Albania"},{area:"Europe",country:"Algeria"},{area:"Europe",country:"Andorra"},{area:"Europe", country:"Angola"},{area:"Europe",country:"Armenia"},{area:"Europe",country:"Austria"},{area:"Europe",country:"Azerbaijan"},{area:"Europe",country:"Bahrain"},{area:"Europe",country:"Belarus"},{area:"Europe",country:"Belgium"},{area:"Europe",country:"Benin"},{area:"Europe",country:"Bosnia & Herzegovina"},{area:"Europe",country:"Botswana"},{area:"Europe",country:"Bulgaria"},{area:"Europe",country:"Burkina Faso"},{area:"Europe",country:"Burundi"},{area:"Europe",country:"Cameroon"},{area:"Europe",country:"Canary Islands"}, {area:"Europe",country:"Cape Verde"},{area:"Europe",country:"Central African Republic"},{area:"Europe",country:"Chad"},{area:"Europe",country:"Comoros"},{area:"Europe",country:"Croatia"},{area:"Europe",country:"Cyprus"},{area:"Europe",country:"Czech Republic"},{area:"Europe",country:"Dem. Republic of the Congo"},{area:"Europe",country:"Denmark"},{area:"Europe",country:"Djibouti"},{area:"Europe",country:"Egypt"},{area:"Europe",country:"Eq Guinea"},{area:"Europe",country:"Eritrea"},{area:"Europe",country:"Estonia"}, {area:"Europe",country:"Ethiopia"},{area:"Europe",country:"Faroe Islands"},{area:"Europe",country:"Finland"},{area:"Europe",country:"France"},{area:"Europe",country:"Gabon"},{area:"Europe",country:"Gambia"},{area:"Europe",country:"Georgia"},{area:"Europe",country:"Germany"},{area:"Europe",country:"Ghana"},{area:"Europe",country:"Gibraltar"},{area:"Europe",country:"Greece"},{area:"Europe",country:"Guinea"},{area:"Europe",country:"Guinea-Bissau"},{area:"Europe",country:"Hungary"},{area:"Europe",country:"Iceland"}, {area:"Europe",country:"Italy"},{area:"Europe",country:"Ivory Coast"},{area:"Europe",country:"Kazakstan"},{area:"Europe",country:"Kenya"},{area:"Europe",country:"Kyrgyzstan"},{area:"Europe",country:"Latvia"},{area:"Europe",country:"Lesotho"},{area:"Europe",country:"Liberia"},{area:"Europe",country:"Libya"},{area:"Europe",country:"Liechtenstein"},{area:"Europe",country:"Lithuania"},{area:"Europe",country:"Luxembourg"},{area:"Europe",country:"Macedonia"},{area:"Europe",country:"Madagascar"},{area:"Europe", country:"Malawi"},{area:"Europe",country:"Mali"},{area:"Europe",country:"Malta"},{area:"Europe",country:"Mauritania"},{area:"Europe",country:"Mauritius"},{area:"Europe",country:"Moldova"},{area:"Europe",country:"Monaco"},{area:"Europe",country:"Montenegro"},{area:"Europe",country:"Morocco"},{area:"Europe",country:"Mozambique"},{area:"Europe",country:"Namibia"},{area:"Europe",country:"Netherlands"},{area:"Europe",country:"Netherlands Antilles"},{area:"Europe",country:"Niger"},{area:"Europe",country:"Nigeria"}, {area:"Europe",country:"Norway"},{area:"Europe",country:"Oman"},{area:"Europe",country:"Poland"},{area:"Europe",country:"Portugal"},{area:"Europe",country:"Rep. of Congo"},{area:"Europe",country:"Reunion Islands"},{area:"Europe",country:"Romania"},{area:"Europe",country:"Russia"},{area:"Europe",country:"Rwanda"},{area:"Europe",country:"San Marino"},{area:"Europe",country:"Sao Tome and Principe"},{area:"Europe",country:"Senegal"},{area:"Europe",country:"Serbia"},{area:"Europe",country:"Seychelles"}, {area:"Europe",country:"Sierra Leone"},{area:"Europe",country:"Slovakia"},{area:"Europe",country:"Slovenia"},{area:"Europe",country:"Somalia"},{area:"Europe",country:"South Africa"},{area:"Europe",country:"Spain"},{area:"Europe",country:"St. Maarten"},{area:"Europe",country:"Sudan"},{area:"Europe",country:"Suriname"},{area:"Europe",country:"Swaziland"},{area:"Europe",country:"Sweden"},{area:"Europe",country:"Switzerland"},{area:"Europe",country:"Tajikistan"},{area:"Europe",country:"Tanzania"},{area:"Europe", country:"Togo"},{area:"Europe",country:"Tunisia"},{area:"Europe",country:"Turkey"},{area:"Europe",country:"Turkmenistan"},{area:"Europe",country:"Uganda"},{area:"Europe",country:"Ukraine"},{area:"Europe",country:"Uzbekistan"},{area:"Europe",country:"Yemen"},{area:"Europe",country:"Zambia"},{area:"Europe",country:"Zimbabwe"},{area:"UK",country:"Bangladesh"},{area:"UK",country:"Bhutan"},{area:"UK",country:"Brunei"},{area:"UK",country:"Burma"},{area:"UK",country:"Cambodia"},{area:"UK",country:"China"}, {area:"UK",country:"East Timor"},{area:"UK",country:"England (United Kingdom)"},{area:"UK",country:"Hong Kong"},{area:"UK",country:"India"},{area:"UK",country:"Indonesia"},{area:"UK",country:"Ireland"},{area:"UK",country:"Japan"},{area:"UK",country:"Laos"},{area:"UK",country:"Macau"},{area:"UK",country:"Malaysia"},{area:"UK",country:"Maldives"},{area:"UK",country:"Micronesia"},{area:"UK",country:"Mongolia"},{area:"UK",country:"Nepal"},{area:"UK",country:"North Korea"},{area:"UK",country:"Nothern Ireland (United Kingdom)"}, {area:"UK",country:"Pakistan"},{area:"UK",country:"Philippines"},{area:"UK",country:"Scotland (United Kingdom)"},{area:"UK",country:"Singapore"},{area:"UK",country:"South Korea"},{area:"UK",country:"Sri Lanka"},{area:"UK",country:"Taiwan"},{area:"UK",country:"Thailand"},{area:"UK",country:"United Kingdom"},{area:"UK",country:"UK"},{area:"UK",country:"U.K"},{area:"UK",country:"Vietnam"},{area:"UK",country:"Wales (United Kingdom)"},{area:"Pacific",country:"American Samoa"},{area:"Pacific",country:"Cocos Island"}, {area:"Pacific",country:"Cook Islands"},{area:"Pacific",country:"Guam"},{area:"Pacific",country:"Kiribati"},{area:"Pacific",country:"Marshall Islands"},{area:"Pacific",country:"N Mariana Islands"},{area:"Pacific",country:"Nauru"},{area:"Pacific",country:"New Caledonia"},{area:"Pacific",country:"Niue"},{area:"Pacific",country:"Palau"},{area:"Pacific",country:"Papua New Guinea"},{area:"Pacific",country:"Pitcairn Islands"},{area:"Pacific",country:"Samoa"},{area:"Pacific",country:"Solomon Islands"},{area:"Pacific", country:"Tahiti"},{area:"Pacific",country:"Tonga"},{area:"Pacific",country:"Tuvalu"},{area:"Pacific",country:"Vanuatu"},{area:"Pacific",country:"Wallis and Futuna"},{area:"SPacific",country:"Bali"},{area:"SPacific",country:"Fiji"},{area:"SPacific",country:"New Zealand"},{area:"SPacific",country:"Norfolk Island"},{area:"Australia",country:"Australia"}];