(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: "Australia"
},
{
    area: "SPacific",
    country: "Bali"
},
{
    area: "SPacific",
    country: "Fiji"
},
{
    area: "SPacific",
    country: "Norfolk Island"
},
{
    area: "NZ",
    country: "New Zealand"
}];

/*
Date Input 1.2.1
Requires jQuery version: >= 1.2.6

Copyright (c) 2007-2008 Jonathan Leighton & Torchbox Ltd

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
DateInput = (function($) {
    // Localise the $ function
    function DateInput(el, opts) {
        if (typeof(opts) != "object") opts = {};
        $.extend(this, DateInput.DEFAULT_OPTS, opts);

        this.input = $(el);
        this.bindMethodsToObj("show", "hide", "hideIfClickOutside", "keydownHandler", "selectDate");

        this.build();
        this.selectDate();
        this.hide();
    };
    DateInput.DEFAULT_OPTS = {
        month_names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
        short_month_names: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        short_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
        start_of_week: 1
    };
    DateInput.prototype = {
        build: function() {
            var monthNav = $('<p class="month_nav">' +
            '<span class="button prev" title="[Page-Up]">&#171;</span>' +
            ' <span class="month_name"></span> ' +
            '<span class="button next" title="[Page-Down]">&#187;</span>' +
            '</p>');
            this.monthNameSpan = $(".month_name", monthNav);
            $(".prev", monthNav).click(this.bindToObj(function() {
                this.moveMonthBy( - 1);
            }));
            $(".next", monthNav).click(this.bindToObj(function() {
                this.moveMonthBy(1);
            }));

            var yearNav = $('<p class="year_nav">' +
            '<span class="button prev" title="[Ctrl+Page-Up]">&#171;</span>' +
            ' <span class="year_name"></span> ' +
            '<span class="button next" title="[Ctrl+Page-Down]">&#187;</span>' +
            '</p>');
            this.yearNameSpan = $(".year_name", yearNav);
            $(".prev", yearNav).click(this.bindToObj(function() {
                this.moveMonthBy( - 12);
            }));
            $(".next", yearNav).click(this.bindToObj(function() {
                this.moveMonthBy(12);
            }));

            var nav = $('<div class="nav"></div>').append(monthNav, yearNav);

            var tableShell = "<table><thead><tr>";
            $(this.adjustDays(this.short_day_names)).each(function() {
                tableShell += "<th>" + this + "</th>";
            });
            tableShell += "</tr></thead><tbody></tbody></table>";

            this.dateSelector = this.rootLayers = $('<div class="date_selector"></div>').append(nav, tableShell).appendTo('body');

            this.tbody = $("tbody", this.dateSelector);

            // Added for 'Today' selector
            var todaySpan = $("<div class='select-today'><span>Jump to today</span></div>").appendTo(this.dateSelector);
            $(todaySpan).click(this.bindToObj(function() {
                this.selectDate(new Date());
            }));

            if ($.browser.msie && $.browser.version < 7) {
                // The ieframe is a hack which works around an IE <= 6 bug where absolutely positioned elements
                // appear behind select boxes. Putting an iframe over the top of the select box prevents this.
                this.ieframe = $('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector);
                this.rootLayers = this.rootLayers.add(this.ieframe);

                // IE 6 only does :hover on A elements
                $(".button", nav).add("span", todaySpan).mouseover(function() {
                    $(this).addClass("hover")
                });
                $(".button", nav).add("span", todaySpan).mouseout(function() {
                    $(this).removeClass("hover")
                });
            };
            this.input.change(this.bindToObj(function() {
                this.selectDate();
            }));
            this.selectDate();
        },

        selectMonth: function(date) {
            var newMonth = new Date(date.getFullYear(), date.getMonth(), 1);

            if (!this.currentMonth || !(this.currentMonth.getFullYear() == newMonth.getFullYear() &&
            this.currentMonth.getMonth() == newMonth.getMonth())) {
                // We have moved to a different month and so need to re-draw the table
                this.currentMonth = newMonth;

                // Work out the range of days we will draw
                var rangeStart = this.rangeStart(date),
                rangeEnd = this.rangeEnd(date);
                var numDays = this.daysBetween(rangeStart, rangeEnd);
                var dayCells = "";

                // Draw each of the days
                for (var i = 0; i <= numDays; i++) {
                    var currentDay = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate() + i, 12, 00);

                    if (this.isFirstDayOfWeek(currentDay)) dayCells += "<tr>";

                    if (currentDay.getMonth() == date.getMonth()) {
                        var before = this.isBeforeToday(currentDay) ? "unselected_month": "selectable_day";

                        dayCells += '<td class="' + before + '" date="' + this.dateToString(currentDay) + '">' + currentDay.getDate() + '</td>';
                    } else {
                        dayCells += '<td class="unselected_month" date="' + this.dateToString(currentDay) + '">' + currentDay.getDate() + '</td>';
                    };

                    if (this.isLastDayOfWeek(currentDay)) dayCells += "</tr>";
                };
                this.tbody.empty().append(dayCells);

                // Write the month and year in the header
                this.monthNameSpan.empty().append(this.monthName(date));
                this.yearNameSpan.empty().append(this.currentMonth.getFullYear());

                $("td[date=" + this.dateToString(new Date()) + "]", this.tbody).addClass("today").removeClass('unselected_month');

                $(".selectable_day", this.tbody).add(".today", this.tbody).click(this.bindToObj(function(event) {
                    this.changeInput($(event.target).attr("date"));
                }));

                $("td.selectable_day", this.tbody).add(".today", this.tbody).mouseover(function() {
                    $(this).addClass("hover")
                });
                $("td.selectable_day", this.tbody).add(".today", this.tbody).mouseout(function() {
                    $(this).removeClass("hover")
                });
            };

            $('.selected', this.tbody).removeClass("selected");
            $('td[date=' + this.selectedDateString + ']', this.tbody).addClass("selected");
        },

        // Select a particular date. If the date is not specified it is read from the input. If no date is
        // found then the current date is selected. The selectMonth() function is responsible for actually
        // selecting a particular date.
        selectDate: function(date) {
            if (typeof(date) == "undefined") {
                date = this.stringToDate(this.input.val());
            };
            if (!date) date = new Date();

            this.selectedDate = date;
            this.selectedDateString = this.dateToString(this.selectedDate);
            this.selectMonth(this.selectedDate);
        },

        // Write a date string to the input and hide. Trigger the change event so we know to update the
        // selectedDate.
        changeInput: function(dateString) {
            this.input.val(dateString).change();
            this.hide();
        },

        show: function() {
            this.input.trigger('blur').addClass('cal-active');
            this.rootLayers.css("display", "block");
            $([window, document.body]).click(this.hideIfClickOutside);
            this.input.unbind("focus", this.show);
            $(document.body).keydown(this.keydownHandler);
            this.setPosition();
        },

        hide: function() {
            this.input.removeClass('cal-active');
            this.rootLayers.css("display", "none");
            $([window, document.body]).unbind("click", this.hideIfClickOutside);
            this.input.focus(this.show);
            $(document.body).unbind("keydown", this.keydownHandler);
        },

        // We should hide the date selector if a click event happens outside of it
        hideIfClickOutside: function(event) {
            if (event.target != this.input[0] && !this.insideSelector(event)) {
                this.hide();
            };
        },

        // Returns true if the given event occurred inside the date selector
        insideSelector: function(event) {
            var offset = this.dateSelector.position();
            offset.right = offset.left + this.dateSelector.outerWidth(true);
            offset.bottom = offset.top + this.dateSelector.outerHeight(true);

            return event.pageY < offset.bottom &&
            event.pageY > offset.top &&
            event.pageX < offset.right &&
            event.pageX > offset.left;
        },

        // Respond to various different keyboard events
        keydownHandler: function(event) {
            switch (event.keyCode)
            {
            case 9:
                // tab
            case 27:
                // esc
                this.hide();
                return;
                break;
            case 13:
                // enter
                this.changeInput(this.selectedDateString);
                break;
            case 33:
                // page up
                this.moveDateMonthBy(event.ctrlKey ? -12: -1);
                break;
            case 34:
                // page down
                this.moveDateMonthBy(event.ctrlKey ? 12: 1);
                break;
            case 38:
                // up
                this.moveDateBy( - 7);
                break;
            case 40:
                // down
                this.moveDateBy(7);
                break;
            case 37:
                // left
                this.moveDateBy( - 1);
                break;
            case 39:
                // right
                this.moveDateBy(1);
                break;
            default:
                return;
            }
            event.preventDefault();
        },

        stringToDate: function(string) {
            var matches;
            if (matches = string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/)) {
                return new Date(matches[3], matches[2] - 1, matches[1]);
            } else {
                return null;
            };
        },

        dateToString: function(date) {
            var month = (date.getMonth() + 1).toString();
            var dom = date.getDate().toString();
            if (month.length == 1) month = "0" + month;
            if (dom.length == 1) dom = "0" + dom;
            return dom + "/" + month + "/" + date.getFullYear();
        },

        setPosition: function() {
            var offset = this.input.offset();
            this.rootLayers.css({
                top: offset.top + this.input.outerHeight(),
                left: offset.left
            });

            if (this.ieframe) {
                this.ieframe.css({
                    width: this.dateSelector.outerWidth(),
                    height: this.dateSelector.outerHeight()
                });
            };
        },

        // Move the currently selected date by a particular number of days
        moveDateBy: function(amount) {
            var newDate = new Date(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate() + amount);
            this.selectDate(newDate);
        },

        // Move the month of the currently selected date by a particular number of months. If we are moving
        // to a month which does not have enough days to represent the current day-of-month, then we
        // default to the last day of the month.
        moveDateMonthBy: function(amount) {
            var newDate = new Date(this.selectedDate.getFullYear(), this.selectedDate.getMonth() + amount, this.selectedDate.getDate());
            if (newDate.getMonth() == this.selectedDate.getMonth() + amount + 1) {
                // We have moved too far. For instance 31st March + 1 month = 1st May, not 30th April
                newDate.setDate(0);
            };
            this.selectDate(newDate);
        },

        // Move the currently displayed month by a certain amount. This does *not* move the currently
        // selected date, so we end up viewing a month with no visibly selected date.
        moveMonthBy: function(amount) {
            var newMonth = new Date(this.currentMonth.getFullYear(), this.currentMonth.getMonth() + amount, this.currentMonth.getDate());
            this.selectMonth(newMonth);
        },

        monthName: function(date) {
            return this.month_names[date.getMonth()];
        },

        // A hack to make "this" refer to this object instance when inside the given function
        bindToObj: function(fn) {
            var self = this;
            return function() {
                return fn.apply(self, arguments)
            };
        },

        // See above
        bindMethodsToObj: function() {
            for (var i = 0; i < arguments.length; i++) {
                this[arguments[i]] = this.bindToObj(this[arguments[i]]);
            };
        },

        // Finds out the array index of a particular value in that array
        indexFor: function(array, value) {
            for (var i = 0; i < array.length; i++) {
                if (value == array[i]) return i;
            };
        },

        // Finds the number of a given month name
        monthNum: function(month_name) {
            return this.indexFor(this.month_names, month_name);
        },

        // Finds the number of a given short month name
        shortMonthNum: function(month_name) {
            return this.indexFor(this.short_month_names, month_name);
        },

        // Finds the number of a given day name
        shortDayNum: function(day_name) {
            return this.indexFor(this.short_day_names, day_name);
        },

        // Works out the number of days between two dates
        daysBetween: function(start, end) {
            start = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate());
            end = Date.UTC(end.getFullYear(), end.getMonth(), end.getDate());
            return (end - start) / 86400000;
        },

        /*
  changeDayTo: Given a date, move along the date line in the given direction until we reach the
  desired day of week.

  The maths is a bit complex, here's an explanation.

  Think of a continuous repeating number line like:

  .. 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 ..

  We are essentially trying to find the difference between two numbers
  on the line in one direction (dictated by the sign of direction variable).
  Unfortunately Javascript's modulo operator works such that -5 % 7 = -5,
  instead of -5 % 7 = 2, so we need to only work with the positives.

  To find the difference between 1 and 4, going backwards, we can treat 1
  as (1 + 7) = 8, so the different is |8 - 4| = 4. If we don't cross the 
  boundary between 0 and 6, for instance to find the backwards difference
  between 5 and 2, |(5 + 7) - 2| = |12 - 2| = 10. And 10 % 7 = 3.

  Going forwards, to find the difference between 4 and 1, we again treat 1
  as (1 + 7) = 8, and the difference is |4 - 8| = 4. If we don't cross the
  boundary, the difference between 2 and 5 is |2 - (5 + 7)| = |2 - 12| = 10.
  And 10 % 7 = 3.

  Once we have the positive difference in either direction represented as a
  absolute value, we can multiply it by the direction variable to get the difference
  in the desired direction.

  We can condense the two methods into a single equation:

    backwardsDifference = direction * (|(currentDayNum + 7) - dayOfWeek| % 7)
                        = direction * (|currentDayNum - dayOfWeek + 7|  % 7)

     forwardsDifference = direction * (|currentDayNum - (dayOfWeek + 7)| % 7)
                        = direction * (|currentDayNum - dayOfWeek - 7| % 7)

    (The two equations now differ only by the +/- 7)

             difference = direction * (|currentDayNum - dayOfWeek - (direction * 7)| % 7)
  */
        changeDayTo: function(dayOfWeek, date, direction) {
            var difference = direction * (Math.abs(date.getDay() - dayOfWeek - (direction * 7)) % 7);
            return new Date(date.getFullYear(), date.getMonth(), date.getDate() + difference);
        },

        // Given a date, return the day at the start of the week *before* this month
        rangeStart: function(date) {
            return this.changeDayTo(this.start_of_week, new Date(date.getFullYear(), date.getMonth()), -1);
        },

        // Given a date, return the day at the end of the week *after* this month
        rangeEnd: function(date) {
            return this.changeDayTo((this.start_of_week - 1) % 7, new Date(date.getFullYear(), date.getMonth() + 1, 0), 1);
        },

        // Is the given date the first day of the week?
        isFirstDayOfWeek: function(date) {
            return date.getDay() == this.start_of_week;
        },

        isBeforeToday: function(date) {
            var today = new Date();
            return (date < today) ? true: false;
        },

        // Is the given date the last day of the week?
        isLastDayOfWeek: function(date) {
            return date.getDay() == (this.start_of_week - 1) % 7;
        },

        // Adjust a given array of day names to begin with the configured start-of-week
        adjustDays: function(days) {
            var newDays = [];
            for (var i = 0; i < days.length; i++) {
                newDays[i] = days[(i + this.start_of_week) % 7];
            };
            return newDays;
        }
    };

    $.fn.date_input = function(opts) {
        return this.each(function() {
            new DateInput(this, opts);
        });
    };
    $.date_input = {
        initialize: function(opts) {
            $("input.date_input").date_input(opts);
        }
    };

    return DateInput;
})(jQuery);
// End localisation of the $ function
$(function() {
    // Date selector
    $('#depDate, #retDate').date_input();
});