﻿

var pcaCtrls =[];

function PCASmartForm(countryobject, parent, country, language, callback,instructions)
{

    //Declarations
	this.COUNTRY_NAME=0;
	this.COUNTRY_DEFAULTLANGUAGE=1;
	this.COUNTRY_FIELDS=2;
	this.COUNTRY_AVAILABLE=3;
	this.LABEL_LANGUAGE=0;
	this.LABEL_LABELS=1;
	this.LABEL_HELP=2;
	this.FORMAT_LABEL=0;
	this.FORMAT_LINE1=1;
	this.FORMAT_LINE2=2;

	this.TAG_FLOOR="F";
	this.TAG_BUILDING="B";
	this.TAG_ROAD="R";
	this.TAG_LOCALITY="D";
	this.TAG_TOWN="T";
	this.TAG_STATE="S";
	this.TAG_POSTCODE="P";
	this.TAG_COUNTRY="C";
	this.TAG_LANGUAGE="L";
	this.TAG_NEWLINE="|";
	this.TAG_SPACE="_";
	this.TAG_HELPTEXT="H";
    
    //Properties
	this.uid = pcaCtrls.length+=1;
    this.strNextFieldToFocus = 'building_';
//    this.AccountCode = "CMPNY11912";
  //  this.LicenseKey = "UD11-BM53-DY94-CM21";
    this.AccountCode = "PERCA11112";
    this.LicenseKey = "rk59-hb52-wc18-tn37";
    this.Building = "";
	this.Street = "";
	this.Locality = "";
	this.City = "";
	this.State = "";
	this.Postcode = "";
	this.Country = "";
	this.HomeCountry = "";
	this.Language = "";
	this.ShowAllCountries = true;
	this.Callback = callback;
	this.CountryName = function()
	{
		return this.Countries[this.Country][this.COUNTRY_NAME];
	}
	this.BaseUrl = function()
	{
		if (self.location.protocol=='https:')
			return 'https://services.postcodeanywhere.co.uk'
		else
			return 'http://services.postcodeanywhere.co.uk';
	}
    
    //Update the control list
    pcaCtrls[pcaCtrls.length] = this;
    
    
    //List of countries
    this.Countries = new Array();
  this.Countries["ALA"] = ["Aaland Islands", "ENG", "BRTS", "0"];
  this.Countries["AFG"] = ["Afghanistan", "ENG", "BRTS", "0"];
  this.Countries["ALB"] = ["Albania", "ENG", "BRTS", "0"];
  this.Countries["DZA"] = ["Algeria", "ENG", "BRTS", "0"];
  this.Countries["ASM"] = ["American Samoa", "ENG", "BRTS", "0"];
  this.Countries["AND"] = ["Andorra", "FRE", "BRT", "0"];
  this.Countries["AGO"] = ["Angola", "ENG", "BRTS", "0"];
  this.Countries["AIA"] = ["Anguilla", "ENG", "BRTS", "0"];
  this.Countries["ATA"] = ["Antarctica", "ENG", "BRTS", "0"];
  this.Countries["ATG"] = ["Antigua and Barbuda", "ENG", "BRTS", "0"];
  this.Countries["ARG"] = ["Argentina", "ENG", "BRTS", "0"];
  this.Countries["ARM"] = ["Armenia", "ENG", "BRTS", "0"];
  this.Countries["ABW"] = ["Aruba", "ENG", "BRTS", "0"];
  this.Countries["AUS"] = ["Australia", "ENG", "BRTS", "0"];
  this.Countries["AUT"] = ["Austria", "DEU", "RBDT", "1"];
  this.Countries["AZE"] = ["Azerbaijan", "ENG", "BRTS", "0"];
  this.Countries["BHS"] = ["Bahamas", "ENG", "BRTS", "0"];
  this.Countries["BHR"] = ["Bahrain", "ENG", "BRTS", "0"];
  this.Countries["BGD"] = ["Bangladesh", "ENG", "BRTS", "0"];
  this.Countries["BRB"] = ["Barbados", "ENG", "BRTS", "0"];
  this.Countries["BLR"] = ["Belarus", "ENG", "BRTS", "0"];
  this.Countries["BEL"] = ["Belgium", "ENG", "RBT", "1"];
  this.Countries["BLZ"] = ["Belize", "ENG", "BRTS", "0"];
  this.Countries["BEN"] = ["Benin", "ENG", "BRTS", "0"];
  this.Countries["BMU"] = ["Bermuda", "ENG", "BRTS", "0"];
  this.Countries["BTN"] = ["Bhutan", "ENG", "BRTS", "0"];
  this.Countries["BOL"] = ["Bolivia", "ENG", "BRTS", "0"];
  this.Countries["BIH"] = ["Bosnia and Herzegowina", "ENG", "BRTS", "0"];
  this.Countries["BWA"] = ["Botswana", "ENG", "BRTS", "0"];
  this.Countries["BVT"] = ["Bouvet Island", "ENG", "BRTS", "0"];
  this.Countries["BRA"] = ["Brazil", "ENG", "BRTS", "0"];
  this.Countries["IOT"] = ["British Indian Ocean Territory", "ENG", "BRTS", "0"];
  this.Countries["VGB"] = ["British Virgin Islands", "ENG", "BRTS", "0"];
  this.Countries["BRN"] = ["Brunei Darussalam", "ENG", "BRTS", "0"];
  this.Countries["BGR"] = ["Bulgaria", "ENG", "BRTS", "0"];
  this.Countries["BFA"] = ["Burkina Faso", "ENG", "BRTS", "0"];
  this.Countries["BDI"] = ["Burundi", "ENG", "BRTS", "0"];
  this.Countries["KHM"] = ["Cambodia", "ENG", "BRTS", "0"];
  this.Countries["CMR"] = ["Cameroon", "ENG", "BRTS", "0"];
  this.Countries["CAN"] = ["Canada", "ENG", "BRTS", "0"];
  this.Countries["CPV"] = ["Cape Verde", "ENG", "BRTS", "0"];
  this.Countries["CYM"] = ["Cayman Islands", "ENG", "BRTS", "0"];
  this.Countries["CAF"] = ["Central African Republic", "ENG", "BRTS", "0"];
  this.Countries["TCD"] = ["Chad", "ENG", "BRTS", "0"];
  this.Countries["CHL"] = ["Chile", "ENG", "BRTS", "0"];
  this.Countries["CHN"] = ["China", "ENG", "BRTS", "0"];
  this.Countries["CXR"] = ["Christmas Island", "ENG", "BRTS", "0"];
  this.Countries["CCK"] = ["Cocos Islands", "ENG", "BRTS", "0"];
  this.Countries["COL"] = ["Colombia", "ENG", "BRTS", "0"];
  this.Countries["COM"] = ["Comoros", "ENG", "BRTS", "0"];
  this.Countries["COG"] = ["Congo", "ENG", "BRTS", "0"];
  this.Countries["COK"] = ["Cook Islands", "ENG", "BRTS", "0"];
  this.Countries["CRI"] = ["Costa Rica", "ENG", "BRTS", "0"];
  this.Countries["CIV"] = ["Cote D'ivoire", "ENG", "BRTS", "0"];
  this.Countries["HRV"] = ["Croatia", "ENG", "BRTS", "0"];
  this.Countries["CUB"] = ["Cuba", "ENG", "BRTS", "0"];
  this.Countries["CYP"] = ["Cyprus", "ENG", "BRTS", "0"];
  this.Countries["CZE"] = ["Czech Republic", "CZE", "RBT", "1"];
  this.Countries["COD"] = ["Democratic Republic of the Congo", "ENG", "BRTS", "0"];
  this.Countries["DNK"] = ["Denmark", "DAN", "RBT", "1"];
  this.Countries["DJI"] = ["Djibouti", "ENG", "BRTS", "0"];
  this.Countries["DMA"] = ["Dominica", "ENG", "BRTS", "0"];
  this.Countries["DOM"] = ["Dominican Republic", "ENG", "BRTS", "0"];
  this.Countries["ECU"] = ["Ecuador", "ENG", "BRTS", "0"];
  this.Countries["EGY"] = ["Egypt", "ENG", "BRTS", "0"];
  this.Countries["SLV"] = ["El Salvador", "ENG", "BRTS", "0"];
  this.Countries["GNQ"] = ["Equatorial Guinea", "ENG", "BRTS", "0"];
  this.Countries["ERI"] = ["Eritrea", "ENG", "BRTS", "0"];
  this.Countries["EST"] = ["Estonia", "ENG", "BRTS", "0"];
  this.Countries["ETH"] = ["Ethiopia", "ENG", "BRTS", "0"];
  this.Countries["FLK"] = ["Falkland Islands", "ENG", "BRTS", "0"];
  this.Countries["FRO"] = ["Faroe Islands", "ENG", "BRTS", "0"];
  this.Countries["FJI"] = ["Fiji", "ENG", "BRTS", "0"];
  this.Countries["FIN"] = ["Finland", "FIN", "RBT", "1"];
  this.Countries["FRA"] = ["France", "FRE", "BRT", "1"];
  this.Countries["GUF"] = ["French Guiana", "ENG", "BRTS", "0"];
  this.Countries["PYF"] = ["French Polynesia", "ENG", "BRTS", "0"];
  this.Countries["ATF"] = ["French Southern Territories", "ENG", "BRTS", "0"];
  this.Countries["GAB"] = ["Gabon", "ENG", "BRTS", "0"];
  this.Countries["GMB"] = ["Gambia", "ENG", "BRTS", "0"];
  this.Countries["GEO"] = ["Georgia", "ENG", "BRTS", "0"];
  this.Countries["DEU"] = ["Germany", "DEU", "RBT", "1"];
  this.Countries["GHA"] = ["Ghana", "ENG", "BRTS", "0"];
  this.Countries["GIB"] = ["Gibraltar", "ENG", "BRTS", "0"];
  this.Countries["GRC"] = ["Greece", "GRE", "RBT", "1"];
  this.Countries["GRL"] = ["Greenland", "ENG", "BRTS", "0"];
  this.Countries["GRD"] = ["Grenada", "ENG", "BRTS", "0"];
  this.Countries["GLP"] = ["Guadeloupe", "ENG", "BRTS", "0"];
  this.Countries["GUM"] = ["Guam", "ENG", "BRTS", "0"];
  this.Countries["GTM"] = ["Guatemala", "ENG", "BRTS", "0"];
  this.Countries["GGY"] = ["Guernsey", "ENG", "BRTS", "0"];
  this.Countries["GIN"] = ["Guinea", "ENG", "BRTS", "0"];
  this.Countries["GNB"] = ["Guinea-Bissau", "ENG", "BRTS", "0"];
  this.Countries["GUY"] = ["Guyana", "ENG", "BRTS", "0"];
  this.Countries["HTI"] = ["Haiti", "ENG", "BRTS", "0"];
  this.Countries["HMD"] = ["Heard and McDonald Islands", "ENG", "BRTS", "0"];
  this.Countries["HND"] = ["Honduras", "ENG", "BRTS", "0"];
  this.Countries["HKG"] = ["Hong Kong", "ENG", "BRTS", "0"];
  this.Countries["HUN"] = ["Hungary", "HUN", "RBT", "0"];
  this.Countries["ISL"] = ["Iceland", "ENG", "BRTS", "0"];
  this.Countries["IND"] = ["India", "ENG", "BRTS", "0"];
  this.Countries["IDN"] = ["Indonesia", "ENG", "BRTS", "0"];
  this.Countries["IRN"] = ["Iran", "ENG", "BRTS", "0"];
  this.Countries["IRQ"] = ["Iraq", "ENG", "BRTS", "0"];
  this.Countries["IRL"] = ["Ireland", "ENG", "BRTS", "1"];
  this.Countries["IMN"] = ["Isle of Man", "ENG", "BRTS", "0"];
  this.Countries["ISR"] = ["Israel", "ENG", "BRTS", "0"];
  this.Countries["ITA"] = ["Italy", "ITA", "RBTS", "1"];
  this.Countries["JAM"] = ["Jamaica", "ENG", "BRTS", "0"];
  this.Countries["JPN"] = ["Japan", "ENG", "BRTS", "0"];
  this.Countries["JEY"] = ["Jersey", "ENG", "BRTS", "0"];
  this.Countries["JOR"] = ["Jordan", "ENG", "BRTS", "0"];
  this.Countries["KAZ"] = ["Kazakhstan", "ENG", "BRTS", "0"];
  this.Countries["KEN"] = ["Kenya", "ENG", "BRTS", "0"];
  this.Countries["KIR"] = ["Kiribati", "ENG", "BRTS", "0"];
  this.Countries["KWT"] = ["Kuwait", "ENG", "BRTS", "0"];
  this.Countries["KGZ"] = ["Kyrgyzstan", "ENG", "BRTS", "0"];
  this.Countries["LAO"] = ["Lao People's Democratic Republic", "ENG", "BRTS", "0"];
  this.Countries["LVA"] = ["Latvia", "ENG", "BRTS", "0"];
  this.Countries["LBN"] = ["Lebanon", "ENG", "BRTS", "0"];
  this.Countries["LSO"] = ["Lesotho", "ENG", "BRTS", "0"];
  this.Countries["LBR"] = ["Liberia", "ENG", "BRTS", "0"];
  this.Countries["LBY"] = ["Libyan Arab Jamahiriya", "ENG", "BRTS", "0"];
  this.Countries["LIE"] = ["Liechtenstein", "ENG", "BRTS", "0"];
  this.Countries["LTU"] = ["Lithuania", "ENG", "BRTS", "0"];
  this.Countries["LUX"] = ["Luxembourg", "FRE", "BRT", "1"];
  this.Countries["MAC"] = ["Macau", "ENG", "BRTS", "0"];
  this.Countries["MKD"] = ["Macedonia", "ENG", "BRTS", "0"];
  this.Countries["MDG"] = ["Madagascar", "ENG", "BRTS", "0"];
  this.Countries["MWI"] = ["Malawi", "ENG", "BRTS", "0"];
  this.Countries["MYS"] = ["Malaysia", "ENG", "BRTS", "0"];
  this.Countries["MDV"] = ["Maldives", "ENG", "BRTS", "0"];
  this.Countries["MLI"] = ["Mali", "ENG", "BRTS", "0"];
  this.Countries["MLT"] = ["Malta", "ENG", "BRTS", "0"];
  this.Countries["MHL"] = ["Marshall Islands", "ENG", "BRTS", "0"];
  this.Countries["MTQ"] = ["Martinique", "ENG", "BRTS", "0"];
  this.Countries["MRT"] = ["Mauritania", "ENG", "BRTS", "0"];
  this.Countries["MUS"] = ["Mauritius", "ENG", "BRTS", "0"];
  this.Countries["MYT"] = ["Mayotte", "ENG", "BRTS", "0"];
  this.Countries["MEX"] = ["Mexico", "ENG", "BRDTS", "0"];
  this.Countries["FSM"] = ["Micronesia", "ENG", "BRTS", "0"];
  this.Countries["MDA"] = ["Moldova", "ENG", "BRTS", "0"];
  this.Countries["MCO"] = ["Monaco", "ENG", "BRTS", "0"];
  this.Countries["MNG"] = ["Mongolia", "ENG", "BRTS", "0"];
  this.Countries["MSR"] = ["Montserrat", "ENG", "BRTS", "0"];
  this.Countries["MAR"] = ["Morocco", "ENG", "BRTS", "0"];
  this.Countries["MOZ"] = ["Mozambique", "ENG", "BRTS", "0"];
  this.Countries["MMR"] = ["Myanmar", "ENG", "BRTS", "0"];
  this.Countries["NAM"] = ["Namibia", "ENG", "BRTS", "0"];
  this.Countries["NRU"] = ["Nauru", "ENG", "BRTS", "0"];
  this.Countries["NPL"] = ["Nepal", "ENG", "BRTS", "0"];
  this.Countries["NLD"] = ["Netherlands", "DUT", "RBT", "1"];
  this.Countries["ANT"] = ["Netherlands Antilles", "ENG", "BRTS", "0"];
  this.Countries["NCL"] = ["New Caledonia", "ENG", "BRTS", "0"];
  this.Countries["NZL"] = ["New Zealand", "ENG", "BRTS", "1"];
  this.Countries["NIC"] = ["Nicaragua", "ENG", "BRTS", "0"];
  this.Countries["NER"] = ["Niger", "ENG", "BRTS", "0"];
  this.Countries["NGA"] = ["Nigeria", "ENG", "BRTS", "0"];
  this.Countries["NIU"] = ["Niue", "ENG", "BRTS", "0"];
  this.Countries["NFK"] = ["Norfolk Island", "ENG", "BRTS", "0"];
  this.Countries["PRK"] = ["North Korea", "ENG", "BRTS", "0"];
  this.Countries["MNP"] = ["Northern Mariana Islands", "ENG", "BRTS", "0"];
  this.Countries["NOR"] = ["Norway", "NOR", "RBT", "1"];
  this.Countries["OMN"] = ["Oman", "ENG", "BRTS", "0"];
  this.Countries["PAK"] = ["Pakistan", "ENG", "BRTS", "0"];
  this.Countries["PLW"] = ["Palau", "ENG", "BRTS", "0"];
  this.Countries["PSE"] = ["Palestinian Territory", "ENG", "BRTS", "0"];
  this.Countries["PAN"] = ["Panama", "ENG", "BRTS", "0"];
  this.Countries["PNG"] = ["Papua New Guinea", "ENG", "BRTS", "0"];
  this.Countries["PRY"] = ["Paraguay", "ENG", "BRTS", "0"];
  this.Countries["PER"] = ["Peru", "ENG", "BRTS", "0"];
  this.Countries["PHL"] = ["Philippines", "ENG", "BRTS", "0"];
  this.Countries["PCN"] = ["Pitcairn", "ENG", "BRTS", "0"];
  this.Countries["POL"] = ["Poland", "POL", "RBT", "1"];
  this.Countries["PRT"] = ["Portugal", "POR", "RBDT", "1"];
  this.Countries["PRI"] = ["Puerto Rico", "ENG", "BRTS", "0"];
  this.Countries["QAT"] = ["Qatar", "ENG", "BRTS", "0"];
  this.Countries["REU"] = ["Reunion", "ENG", "BRTS", "0"];
  this.Countries["ROU"] = ["Romania", "ENG", "BRTS", "0"];
  this.Countries["RUS"] = ["Russian Federation", "RUS", "RBT", "0"];
  this.Countries["RWA"] = ["Rwanda", "ENG", "BRTS", "0"];
  this.Countries["SHN"] = ["Saint Helena", "ENG", "BRTS", "0"];
  this.Countries["KNA"] = ["Saint Kitts and Nevis", "ENG", "BRTS", "0"];
  this.Countries["LCA"] = ["Saint Lucia", "ENG", "BRTS", "0"];
  this.Countries["SPM"] = ["Saint Pierre and Miquelon", "ENG", "BRTS", "0"];
  this.Countries["VCT"] = ["Saint Vincent and the Grenadines", "ENG", "BRTS", "0"];
  this.Countries["WSM"] = ["Samoa", "ENG", "BRTS", "0"];
  this.Countries["SMR"] = ["San Marino", "ITA", "RBT", "0"];
  this.Countries["STP"] = ["Sao Tome and Principe", "ENG", "BRTS", "0"];
  this.Countries["SAU"] = ["Saudi Arabia", "ENG", "BRTS", "0"];
  this.Countries["SEN"] = ["Senegal", "ENG", "BRTS", "0"];
  this.Countries["SCG"] = ["Serbia And Montenegro", "ENG", "BRTS", "0"];
  this.Countries["SYC"] = ["Seychelles", "ENG", "BRTS", "0"];
  this.Countries["SLE"] = ["Sierra Leone", "ENG", "BRTS", "0"];
  this.Countries["SGP"] = ["Singapore", "ENG", "BRTS", "0"];
  this.Countries["SVK"] = ["Slovakia", "ENG", "BRTS", "0"];
  this.Countries["SVN"] = ["Slovenia", "ENG", "BRTS", "0"];
  this.Countries["SLB"] = ["Solomon Islands", "ENG", "BRTS", "0"];
  this.Countries["SOM"] = ["Somalia", "ENG", "BRTS", "0"];
  this.Countries["ZAF"] = ["South Africa", "ENG", "BRTS", "1"];
  this.Countries["SGS"] = ["South Georgia and the South Sandwich Islands", "ENG", "BRTS", "0"];
  this.Countries["KOR"] = ["South Korea", "ENG", "BRTS", "0"];
  this.Countries["ESP"] = ["Spain", "SPA", "RBDT", "1"];
  this.Countries["LKA"] = ["Sri Lanka", "ENG", "BRTS", "0"];
  this.Countries["SDN"] = ["Sudan", "ENG", "BRTS", "0"];
  this.Countries["SUR"] = ["Suriname", "ENG", "BRTS", "0"];
  this.Countries["SJM"] = ["Svalbard and Jan Mayen Islands", "ENG", "BRTS", "0"];
  this.Countries["SWZ"] = ["Swaziland", "ENG", "BRTS", "0"];
  this.Countries["SWE"] = ["Sweden", "SWE", "RBT", "1"];
  this.Countries["CHE"] = ["Switzerland", "FRE", "BRT", "1"];
  this.Countries["SYR"] = ["Syrian Arab Republic", "ENG", "BRTS", "0"];
  this.Countries["TWN"] = ["Taiwan", "ENG", "BRTS", "0"];
  this.Countries["TJK"] = ["Tajikistan", "ENG", "BRTS", "0"];
  this.Countries["TZA"] = ["Tanzania", "ENG", "BRTS", "0"];
  this.Countries["THA"] = ["Thailand", "ENG", "BRTS", "0"];
  this.Countries["TLS"] = ["Timor-Leste", "ENG", "BRTS", "0"];
  this.Countries["TGO"] = ["Togo", "ENG", "BRTS", "0"];
  this.Countries["TKL"] = ["Tokelau", "ENG", "BRTS", "0"];
  this.Countries["TON"] = ["Tonga", "ENG", "BRTS", "0"];
  this.Countries["TTO"] = ["Trinidad and Tobago", "ENG", "BRTS", "0"];
  this.Countries["TUN"] = ["Tunisia", "ENG", "BRTS", "0"];
  this.Countries["TUR"] = ["Turkey", "ENG", "BRTS", "0"];
  this.Countries["TKM"] = ["Turkmenistan", "ENG", "BRTS", "0"];
  this.Countries["TCA"] = ["Turks and Caicos Islands", "ENG", "BRTS", "0"];
  this.Countries["TUV"] = ["Tuvalu", "ENG", "BRTS", "0"];
  this.Countries["UGA"] = ["Uganda", "ENG", "BRTS", "0"];
  this.Countries["UKR"] = ["Ukraine", "ENG", "BRTS", "0"];
  this.Countries["ARE"] = ["United Arab Emirates", "ENG", "BRTS", "0"];
  this.Countries["GBR"] = ["United Kingdom", "ENG", "BRDTS", "1"];
  this.Countries["UMI"] = ["United States Minor Outlying Islands", "ENG", "BRTS", "0"];
  this.Countries["USA"] = ["United States of America", "ENG", "BRTS", "1"];
  this.Countries["URY"] = ["Uruguay", "ENG", "BRTS", "0"];
  this.Countries["VIR"] = ["US Virgin Islands", "ENG", "BRTS", "0"];
  this.Countries["UZB"] = ["Uzbekistan", "ENG", "BRTS", "0"];
  this.Countries["VUT"] = ["Vanuatu", "ENG", "BRTS", "0"];
  this.Countries["VAT"] = ["Vatican", "ENG", "BRTS", "0"];
  this.Countries["VEN"] = ["Venezuela", "ENG", "BRTS", "0"];
  this.Countries["VNM"] = ["Viet Nam", "ENG", "BRTS", "0"];
  this.Countries["WLF"] = ["Wallis and Futuna Islands", "ENG", "BRTS", "0"];
  this.Countries["ESH"] = ["Western Sahara", "ENG", "BRTS", "0"];
  this.Countries["YEM"] = ["Yemen", "ENG", "BRTS", "0"];
  this.Countries["ZMB"] = ["Zambia", "ENG", "BRTS", "0"];
  this.Countries["ZWE"] = ["Zimbabwe", "ENG", "BRTS", "0"];
    
    
	//List of labels
	this.Labels = new Array();
  this.Labels["AND.ENG"] = ["Engilsh","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Number;R:Street;T:City;A:Apartment;",""];
  this.Labels["AND.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter)",""];
  this.Labels["AUS.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;S:State;A:Apartment / Suite",""];
  this.Labels["AUT.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["AUT.DEU"] = ["Deutsch","F:Gebäude/Etage;C:Land;L:Sprache;P:PLZ;R:Straße;T:Ort (or Wohnort);B:Hausnummer;A:Appartement",""];
  this.Labels["BEL.DUT"] = ["Dutch","F:Gebouw/Verdieping enz.;C:Land;L:Taal;P:Postcode;B:Huisnummer;R:Adres;T:Woonplaats;A:Huisnummertoevoeging",""];
  this.Labels["BEL.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building Number;R:Street;T:City;A:Apartment",""];
  this.Labels["BEL.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter) / Apartement",""];
  this.Labels["BEL.DEU"] = ["Deutsch","F:Gebäude/Etage;C:Land;L:Sprache;P:PLZ;R:Straße;T:Ort (or Wohnort);B:Hausnummer;A:Appartement",""];
  this.Labels["CAN.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building Number;R:Street Address / Route Type;T:Postal Town;S:Province/Territory;A:Apartment / Suite",""];
  this.Labels["CAN.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postale;B:Numéro;R:Rue / type route;T:Ville;S:Province / Territoire;A:Appartement",""];
  this.Labels["CHE.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:Town;A:Apartment",""];
  this.Labels["CHE.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter) / Apartement",""];
  this.Labels["CHE.DEU"] = ["Deutsch","F:Gebäude/Etage;C:Land;L:Sprache;P:PLZ;R:Strasse;T:Ort (or Wohnort);B:Hausnummer;A:Appartement",""];
  this.Labels["CHE.ITA"] = ["Italiano","F:Building/Floor etc.;C:Paese;L:Lingua;P:CAP;R:Via;T:Città;B:Numero civico;S:Provincia;A:Appartamento",""];
  this.Labels["CZE.CZE"] = ["Čeština","F:Budova/patro atd.;C:Země;L:Jazyk;P:PSČ;B:Čislo;R:Ulice;T:Město;A:Byt",""];
  this.Labels["CZE.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:Town;A:Apartment",""];
  this.Labels["DEF.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;S:State / Province;A:Apartment",""];
  this.Labels["DEU.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["DEU.DEU"] = ["Deutsch","F:Gebäude/Etage;C:Land;L:Sprache;P:PLZ;R:Straße;T:Ort (or Wohnort);B:Hausnummer;A:Appartement",""];
  this.Labels["DNK.DAN"] = ["Dansk","F:Building/Floor etc.;C:Landskab;L:Sprog;P:Postnumre;B:Husnummer;R:Gadenavn;T:Bynavn;A:Husbogstav",""];
  this.Labels["DNK.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building Number;R:Street;T:City;A:Apartment",""];
  this.Labels["ESP.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment;D:Locality",""];
  this.Labels["ESP.SPA"] = ["Español","F:Edificio/Planta;C:País;L:Lengua;P:Código Postal;B:Número;R:Calle;T:Ciudad;A:Piso;D:Localidad",""];
  this.Labels["FIN.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["FIN.FIN"] = ["Suomi","F:Building/Floor etc.;C:Kreivikunta;L:Kielenkäyttö;P:Postinumero;B:Numero;R:Postiosoiten;T:Kunta;A:Huone",""];
  this.Labels["FRA.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["FRA.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter)",""];
  this.Labels["GBR.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building Number;R:Street;T:Town;D:Locality;S:County;A:Apartment",""];
  this.Labels["GRC.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["GRC.GRE"] = ["Ελληνικά","F:Building/Floor etc.;C:Χώρα;L:Γλώσσα;P:Ταχ. Κώδικας;B:Αριθμός;R:Οδός;T:Δήμος-Πόλη;A:Apartment",""];
  this.Labels["HUN.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["HUN.HUN"] = ["Magyar","F:Building/Floor etc.;C:Ország;L:Nyelv;P:Irányítószám;B:Házszám;R:Út/Utca/Tér;T:Település;A:Lakás",""];
  this.Labels["IRL.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:Town;D:Locality;S:County;A:Apartment",""];
  this.Labels["ITA.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;S:Province;A:Apartment",""];
  this.Labels["ITA.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter) / Appartement;S:Province",""];
  this.Labels["ITA.DEU"] = ["Deutsch","F:Gebäude/Etage;C:Land;L:Sprache;P:PLZ;R:Straße;T:Ort (or Wohnort);B:Hausnummer;A:Appartement;S:Provincie",""];
  this.Labels["ITA.ITA"] = ["Italiano","F:Building/Floor etc.;C:Paese;L:Lingua;P:CAP;R:Via;T:Città;B:Numero civico;S:Provincia;A:Appartamento",""];
  this.Labels["LUX.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["LUX.FRE"] = ["Français","F:Tour/Etage;C:Pays;L:Langue;P:Code Postal;B:Numéro;R:Rue;T:Ville;A:Suffixe (par example: A, bis, ter)",""];
  this.Labels["LUX.LUT"] = ["Lëtzebuergesch","F:Building/Floor etc.;C:Land;L:Sprooch;P:Postleitzuel;B:Hausnummer;R:Strooss;T:Urtschaft",""];
  this.Labels["MEX.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment;D:Locality;S:State",""];
  this.Labels["MEX.SPA"] = ["Español","F:Building/Floor etc.;C:País;L:Lengua;P:Código Postal;B:Número;R:Calle;T:Localidad;A:Piso;S:Estado;D:Districto",""];
  this.Labels["NLD.DUT"] = ["Dutch","F:Gebouw/etage;C:Land;L:Taal;P:Postcode;B:Huisnummer;R:Adres;T:Woonplaats;A:Huisnummertoevoeging",""];
  this.Labels["NLD.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["NOR.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["NOR.NOR"] = ["Norsk","F:Building/Floor etc.;C:Land;L:Omgangsspråk;P:Postnummer;B:Nummer / Gatenummer / Husnummer;R:Gatenavn;T:Bynavn;A:Romnummer",""];
  this.Labels["NZL.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:Town;D:Locality;S:Area;A:Apartment",""];
  this.Labels["POL.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["POL.POL"] = ["Polski","F:Nazwa budynku/piętro;C:Kraj;L:Język;P:Kod pocztowy;B:Numer / Numer domu;R:Ulica;T:Miejscowość;A:Mieszkaniew, izba, pokó",""];
  this.Labels["PRT.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment;D:Locality",""];
  this.Labels["PRT.POR"] = ["Português","F:Building/Floor etc.;C:País;L:Língua;P:Código Postal;B:Número;R:Rua;T:Localidade;A:Andar;D:Local",""];
  this.Labels["RUS.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["RUS.RUS"] = ["Русский язык","F:Building/Floor etc.;C:страна;L:язык;P:почтовый индекс;B:число;R:Улица;T:City;A:Набережная",""];
  this.Labels["SMR.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postcode;B:Building;R:Street;T:City;S:Province;A:Apartment",""];
  this.Labels["SMR.ITA"] = ["Italiano","F:Building/Floor etc.;C:Paese;L:Lingua;P:CAP;R:Via;T:Città;B:Numero civico;S:Provincia;A:Appartamento",""];
  this.Labels["SWE.ENG"] = ["English","F:Building/Floor etc.;C:Country;L:Language;P:Postal Code;B:Building;R:Street;T:City;A:Apartment",""];
  this.Labels["SWE.SWE"] = ["Svenska","F:Building/Floor etc.;C:Land;L:Språk;P:Postnummer;B:Husnummer;R:Gatunamn;T:Stad;A:Lägenhet",""];
  this.Labels["USA.ENG"] = ["English", "F:Building/Floor etc.;C:Country;L:Language;P:Zipcode;B:Building Number;R:Street;T:City;S:State;A:Apartment / Suite", ""];
    
	// Help Text
		this.HelpText= new Array();

  this.HelpText["AND.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["AND.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["AUS.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["AUT.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["AUT.DEU"] = "Falls erforderlich, füllen Sie bitte Ihr Gebäude/Etage etc. und die Straßenummer ein und starten Sie mit der Eingabe Ihrer Straße. Wählen Sie Ihre Adresse aus der Liste (Ihre Adresse wird bei Übereinstimmung automatisch angezeigt.) "
  this.HelpText["BEL.DUT"] = "Gelieve de naam van het gebouw, verdieping, straatnummer in te vullen. Selecteer vervolgens uw adres uit de opgegeven lijst. De adresgegevens zullen automatisch worden aangepast."
  this.HelpText["BEL.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["BEL.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["BEL.DEU"] = "Falls erforderlich, füllen Sie bitte Ihr Gebäude/Etage etc. und die Straßenummer ein und starten Sie mit der Eingabe Ihrer Straße. Wählen Sie Ihre Adresse aus der Liste (Ihre Adresse wird bei Übereinstimmung automatisch angezeigt.) "
  this.HelpText["CAN.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["CAN.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["CHE.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["CHE.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["CHE.DEU"] = "Falls erforderlich, füllen Sie bitte Ihr Gebäude/Etage etc. und die Straßenummer ein und starten Sie mit der Eingabe Ihrer Straße. Wählen Sie Ihre Adresse aus der Liste (Ihre Adresse wird bei Übereinstimmung automatisch angezeigt.) "
  this.HelpText["CHE.ITA"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["CZE.CZE"] = "Pokud je potřeba, zadejte prosím označení budovy, patro či orientační číslo.Jako první zadávejte vždy název ulice. Adresu můžete zvolit z nabídky (pokud v seznamu existuje, pak se automaticky doplní):"
  this.HelpText["CZE.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["DEF.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["DEU.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["DEU.DEU"] = "Falls erforderlich, füllen Sie bitte Ihr Gebäude/Etage etc. und die Straßenummer ein und starten Sie mit der Eingabe Ihrer Straße. Wählen Sie Ihre Adresse aus der Liste (Ihre Adresse wird bei Übereinstimmung automatisch angezeigt.) "
  this.HelpText["DNK.DAN"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["DNK.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["ESP.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["ESP.SPA"] = "Por favor, rellene el número, piso y comience a completar el nombre de la calle eligiendo si lo desea la que aparece automáticamente."
  this.HelpText["FIN.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["FIN.FIN"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["FRA.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["FRA.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["GBR.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["GRC.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["GRC.GRE"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["HUN.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["HUN.HUN"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["IRL.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["ITA.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["ITA.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["ITA.DEU"] = "Falls erforderlich, füllen Sie bitte Ihr Gebäude/Etage etc. und die Straßenummer ein und starten Sie mit der Eingabe Ihrer Straße. Wählen Sie Ihre Adresse aus der Liste (Ihre Adresse wird bei Übereinstimmung automatisch angezeigt.) "
  this.HelpText["ITA.ITA"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["LUX.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["LUX.FRE"] = "Merci de saisir les noms des immeubles, tour, étages si nécessaire et de saisir le nom de la rue. Choisissez votre addresse dans la liste proposée automatiquement."
  this.HelpText["LUX.LUT"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["MEX.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["MEX.SPA"] = "Por favor, rellene el número, piso y comience a completar el nombre de la calle eligiendo si lo desea la que aparece automáticamente."
  this.HelpText["NLD.DUT"] = "Indien vereist, vermeld het gebouw of de verdieping waar u zich bevindt en het straatnummer en begin met de straatnaam. Kies u adres uit de gevonden adressen (uw adres zal automatisch worden aangevuld bij een exacte match):"
  this.HelpText["NLD.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["NOR.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["NOR.NOR"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["NZL.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["POL.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["POL.POL"] = "Prosimy o podanie dokładnych danych adresowych firmy. Prosimy o wybranie adresu z listy jeśli jest  dostępny:"
  this.HelpText["PRT.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["PRT.POR"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["RUS.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["RUS.RUS"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["SMR.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["SMR.ITA"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["SWE.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["SWE.SWE"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
  this.HelpText["USA.ENG"] = "Please enter your street number, building, mailpoint/floor etc (if required) and begin entering your street. Pick your address from the list of any matches found that appears (your address will be automatically completed if there is an exact match):"
	
	this.TelPrefix = new Array();
	
 this.TelPrefix["AND.ENG"] = "+376 (0)"
  this.TelPrefix["AND.FRE"] = "+376 (0)"
  this.TelPrefix["AUS.ENG"] = "+61 (0)"
  this.TelPrefix["AUT.ENG"] = "+43 (0)"
  this.TelPrefix["AUT.DEU"] = "+43 (0)"
  this.TelPrefix["BEL.DUT"] = "+32 "
  this.TelPrefix["BEL.ENG"] = "+32 "
  this.TelPrefix["BEL.FRE"] = "+32 "
  this.TelPrefix["BEL.DEU"] = "+32 "
  this.TelPrefix["CAN.ENG"] = "+1 (0)"
  this.TelPrefix["CAN.FRE"] = "+1 (0)"
  this.TelPrefix["CHE.ENG"] = "+41 (0)"
  this.TelPrefix["CHE.FRE"] = "+41 (0)"
  this.TelPrefix["CHE.DEU"] = "+41 (0)"
  this.TelPrefix["CHE.ITA"] = "+41 (0)"
  this.TelPrefix["CZE.CZE"] = "+420 (0)"
  this.TelPrefix["CZE.ENG"] = "+420 (0)"
  this.TelPrefix["DEF.ENG"] = "+44 (0)"
  this.TelPrefix["DEU.ENG"] = "+49 "
  this.TelPrefix["DEU.DEU"] = "+49 "
  this.TelPrefix["DNK.DAN"] = "+45 (0)"
  this.TelPrefix["DNK.ENG"] = "+45 (0)"
  this.TelPrefix["ESP.ENG"] = "+34 "
  this.TelPrefix["ESP.SPA"] = "+34 "
  this.TelPrefix["FIN.ENG"] = "+358 (0)"
  this.TelPrefix["FIN.FIN"] = "+358 (0)"
  this.TelPrefix["FRA.ENG"] = "+33 (0)"
  this.TelPrefix["FRA.FRE"] = "+33 (0)"
  this.TelPrefix["GBR.ENG"] = "+44 (0)"
  this.TelPrefix["GRC.ENG"] = "+30 (0)"
  this.TelPrefix["GRC.GRE"] = "+30 (0)"
  this.TelPrefix["HUN.ENG"] = "+36 (0)"
  this.TelPrefix["HUN.HUN"] = "+36 (0)"
  this.TelPrefix["IRL.ENG"] = "+353 (0)"
  this.TelPrefix["ITA.ENG"] = "+39 (0)"
  this.TelPrefix["ITA.FRE"] = "+39 (0)"
  this.TelPrefix["ITA.DEU"] = "+39 (0)"
  this.TelPrefix["ITA.ITA"] = "+39 (0)"
  this.TelPrefix["LUX.ENG"] = "+352 (0)"
  this.TelPrefix["LUX.FRE"] = "+352 (0)"
  this.TelPrefix["LUX.LUT"] = "+352 (0)"
  this.TelPrefix["MEX.ENG"] = "+52 (0)"
  this.TelPrefix["MEX.SPA"] = "+52 (0)"
  this.TelPrefix["NLD.DUT"] = "+31 (0)"
  this.TelPrefix["NLD.ENG"] = "+31 (0)"
  this.TelPrefix["NOR.ENG"] = "+47 (0)"
  this.TelPrefix["NOR.NOR"] = "+47 (0)"
  this.TelPrefix["NZL.ENG"] = "+64 (0)"
  this.TelPrefix["POL.ENG"] = "+48 (0)"
  this.TelPrefix["POL.POL"] = "+48 (0)"
  this.TelPrefix["PRT.ENG"] = "+351 (0)"
  this.TelPrefix["PRT.POR"] = "+351 (0)"
  this.TelPrefix["RUS.ENG"] = "+7 (0)"
  this.TelPrefix["RUS.RUS"] = "+7 (0)"
  this.TelPrefix["SMR.ENG"] = "+378 (0)"
  this.TelPrefix["SMR.ITA"] = "+378 (0)"
  this.TelPrefix["SWE.ENG"] = "+46 (0)"
  this.TelPrefix["SWE.SWE"] = "+46 (0)"
  this.TelPrefix["USA.ENG"] = "+1 (0)"
	

	
	//List of formats
	this.Formats = new Array();
  this.Formats["AND.ENG"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["AND.FRE"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["AUS.ENG"] = ["b_r|T_S_P|C", "b_r", ""];
  this.Formats["AUT.ENG"] = ["r_b|d|P_T|C", "r_b", "d"];
  this.Formats["AUT.DEU"] = ["r_b|d|P_T|C", "r_b", "d"];
  this.Formats["BEL.DUT"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["BEL.ENG"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["BEL.FRE"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["BEL.DEU"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["CAN.ENG"] = ["b_r|T_S_P|C", "b_r", ""];
  this.Formats["CAN.FRE"] = ["b_r|T_S_P|C", "b_r", ""];
  this.Formats["CHE.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["CHE.FRE"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["CHE.DEU"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["CHE.ITA"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["CZE.CZE"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["CZE.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["DEF.ENG"] = ["b_r|T_P|S|C", "b_r", ""];
  this.Formats["DEU.ENG"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["DEU.DEU"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["DNK.DAN"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["DNK.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["ESP.ENG"] = ["r_b|P_T|C", "r_b", "d"];
  this.Formats["ESP.SPA"] = ["r_b|P_T|C", "r_b", "d"];
  this.Formats["FIN.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["FIN.FIN"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["FRA.ENG"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["FRA.FRE"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["GBR.ENG"] = ["b,_r|d|T|s|P|_|C", "b_r", "d"];
  this.Formats["GRC.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["GRC.GRE"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["HUN.ENG"] = ["P_T|r_b|C", "r_b", ""];
  this.Formats["HUN.HUN"] = ["P_T|r_b|C", "r_b", ""];
  this.Formats["IRL.ENG"] = ["b,_r|T_P|s|C", "b_r", "d"];
  this.Formats["ITA.ENG"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["ITA.FRE"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["ITA.DEU"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["ITA.ITA"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["LUX.ENG"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["LUX.FRA"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["LUX.LUT"] = ["b_r|P_T|C", "b_r", ""];
  this.Formats["MEX.ENG"] = ["r_b|d|P_T_S|C", "r_b", "d"];
  this.Formats["MEX.SPA"] = ["r_b|d|P_T_S|C", "r_b", "d"];
  this.Formats["NLD.DUT"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["NLD.ENG"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["NOR.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["NOR.NOR"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["NZL.ENG"] = ["b_r|t_P|C", "b_r", ""];
  this.Formats["POL.ENG"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["POL.POL"] = ["r_b|P_T|C", "r_b", ""];
  this.Formats["PRT.ENG"] = ["r_b|d|P_T|C", "r_b", "d"];
  this.Formats["PRT.POR"] = ["r_b|d|P_T|C", "r_b", "d"];
  this.Formats["RUS.ENG"] = ["r_b|T|P|C", "r_b", ""];
  this.Formats["RUS.RUS"] = ["r_b|T|P|C", "r_b", ""];
  this.Formats["SMR.ENG"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["SMR.ITA"] = ["r_b|P_T_S|C", "r_b", ""];
  this.Formats["SWE.ENG"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["SWE.SWE"] = ["r_b|P__T|C", "r_b", ""];
  this.Formats["USA.ENG"] = ["b_r|T_S_P|C", "b_r", ""];


    //State management
    this.m_objPanelCountry = countryobject;
    this.m_objPanelForm = parent;
    this.m_blnDataLoaded = false;
	this.m_blnAutoSelect=false;
	this.m_objStreetList;
	this.m_strLastSearch = "";

    //Helpers
	this.RemoveDiacritics = function (what) 
	{
		var strResult="";
		var strChar="";
		for (i=0; i<what.length;i++)
		{
			strChar = what.substring(i, i+1).toUpperCase();
			if ("ÀÁÂÃàáâã".indexOf(strChar)>=0)
				strResult+="A";
			else if ("Åå".indexOf(strChar)>=0) 
				strResult+="AA";
			else if ("ÆæÄä".indexOf(strChar)>=0) 
				strResult+="AE";
			else if ("Çç".indexOf(strChar)>=0) 
				strResult+="C";
			else if ("Cc".indexOf(strChar)>=0) 
				strResult+="CH";
			else if ("dÐ".indexOf(strChar)>=0) 
				strResult+="DJ";
			else if ("ÈÉÊËèéêë".indexOf(strChar)>=0) 
				strResult+="E";
			else if ("ÌÍÏìíîï".indexOf(strChar)>=0) 
				strResult+="I";
			else if ("Ññ".indexOf(strChar)>=0) 
				strResult+="N";
			else if ("ÒÓÔÕOòóôõo".indexOf(strChar)>=0) 
				strResult+="O";
			else if ("ŒœØøÖö".indexOf(strChar)>=0) 
				strResult+="OE";
			else if ("Šš".indexOf(strChar)>=0) 
				strResult+="SH";
			else if ("ß".indexOf(strChar)>=0) 
				strResult+="SS";
			else if ("ÙÚÛUùúûu".indexOf(strChar)>=0) 
				strResult+="U";
			else if ("Üü".indexOf(strChar)>=0) 
				strResult+="UE";
			else if ("ŸÝýÿ".indexOf(strChar)>=0) 
				strResult+="Y";
			else if ("Žž".indexOf(strChar)>=0) 
				strResult+="ZH";
			else
				strResult+=strChar;
		}
		return strResult;
	}

	this.DoCountryLanguage = function(objLabels, blnUseDefaults) {

	    var strHtml = new this.StringBuffer()

	    strHtml.append("<table><tr>");
	    strHtml.append("<td class=contactuslbl id='Country_Label'>" + objLabels[this.TAG_COUNTRY] + "</td></tr>");
	    strHtml.append("<tr><td style='width:399'>");
	    strHtml.append("<select name='Country' class=contactusfld id=Country onchange=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + this.TAG_COUNTRY + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\">");
	    for (intItem = 0; intItem < this.ArrayLength(this.Countries); intItem++) {
	        strKey = this.ArrayKey(this.Countries, intItem);
	        strValue = this.Countries[strKey][this.COUNTRY_NAME];
	        if (strKey == this.Country) {
	            if (this.Countries[strKey][this.COUNTRY_AVAILABLE] == "1") {
	                strHtml.append("<option value=\"" + strKey + "\" selected class='available'>" + strValue + "</option>");
	            }
	            else {
	                if (this.ShowAllCountries == true) {
	                    strHtml.append("<option value=\"" + strKey + "\" selected class='unavailable'>" + strValue + "</option>")
	                };
	            }
	        }
	        else {
	            if (this.Countries[strKey][this.COUNTRY_AVAILABLE] == "1") {
	                strHtml.append("<option value=\"" + strKey + "\" class='available'>" + strValue + "</option>");
	            }
	            else {
	                if (this.ShowAllCountries == true) {
	                    strHtml.append("<option value=\"" + strKey + "\" class='unavailable'>" + strValue + "</option>")
	                }
	            }
	        }
	    }
	    strHtml.append("</select>");
	    strHtml.append("</td>");
	    strHtml.append("</tr>");

	    //Add the language field
	    strHtml.append("<tr>");
	    strHtml.append("<td class=contactuslbl id='Language_Label'>" + objLabels[this.TAG_LANGUAGE] + "</td></tr>");
	    strHtml.append("<tr><td style='width:399'>");
	    strHtml.append("<select class=contactusfld name=language id=Language onchange=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + this.TAG_LANGUAGE + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\">");
	    if (blnUseDefaults) {
	        strHtml.append("<option value=\"ENG\" selected>English</option>");
	    }
	    else {
	        for (strKey in this.Labels) {
	            strCountry = strKey.substring(0, 3);
	            strLanguage = strKey.substring(4, 7);
	            strValue = this.Labels[strKey][this.LABEL_LANGUAGE];
	            if (strCountry == this.Country) {
	                if (strLanguage == this.Language) {
	                    strHtml.append("<option value=\"" + strLanguage + "\" selected>" + strValue + "</option>");
	                }
	                else {
	                    strHtml.append("<option value=\"" + strLanguage + "\">" + strValue + "</option>");
	                }
	            }
	        }
	    }
	    strHtml.append("</select>");
	    strHtml.append("</td>");
	    strHtml.append("</tr></table>");

	    return strHtml.toString();



	}

	this.DrawForm = function() {

	    var strHtml = new this.StringBuffer()
	    var strHtmlCountry = new this.StringBuffer();
	    var intCounter;
	    var intItem;
	    var strKey;
	    var strValue;
	    var strFields;
	    var strField;
	    var strLabels;
	    var strLabel;
	    var objLabels = new Array();
	    var blnUseDefaults = false;
	    var strHelpText;
	    var strTelPrefix;

	    //Get the list of fields
	    strFields = this.Countries[this.Country][this.COUNTRY_FIELDS];

	    //Get the labels
	    if (this.ContainsKey(this.Labels, this.Country + "." + this.Language)) {
	        strLabels = this.Labels[this.Country + "." + this.Language][this.LABEL_LABELS].split(";");
	        strHelpText = this.HelpText[this.Country + "." + this.Language];
	        strTelPrefix = this.TelPrefix[this.Country + "." + this.Language];
	        blnUseDefaults = false;
	    }
	    else {
	        strLabels = this.Labels["DEF.ENG"][this.LABEL_LABELS].split(";");
	        strHelpText = this.HelpText["DEF.ENG"];
	        blnUseDefaults = true;
	    }

	    for (intCounter = 0; intCounter < strLabels.length; intCounter++) {
	        strKey = strLabels[intCounter].substring(0, strLabels[intCounter].indexOf(":"));
	        strValue = strLabels[intCounter].substring(strLabels[intCounter].indexOf(":") + 1);
	        objLabels[strKey] = strValue;
	    }

	    //Start the form
	    strHtml.append("<table  width='360' >");

	    //Add the country field
	    strHtmlCountry.append(this.DoCountryLanguage(objLabels, blnUseDefaults));

	    //Add the postcode field	
	    strHtml.append("<tr>");
	    strHtml.append("<td  id='pcaZip'>" + objLabels[this.TAG_POSTCODE] + "</td></tr>");
	    strHtml.append("<tr><td  ><input onkeydown=\";pcaCtrls[" + this.uid + "].CheckTabToNext();\" name='Zip' class='contactusfld' type='text' id=txtPcaPostcode_" + this.uid + " value=\"" + this.Postcode + "\" size=10 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + this.TAG_POSTCODE + "');pcaCtrls[" + this.uid + "].FetchStreetsBegin(this.value)\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + this.TAG_POSTCODE + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	    strHtml.append("</tr>");

	    strHtml.append("<tr>");
	    strHtml.append("<td colspan='1'><div id='helptext'>" + strHelpText + "</div></td>");
	    strHtml.append("</tr>");

	    strHtml.append("<tr>");
	    strHtml.append("<td class=label>" + objLabels[this.TAG_FLOOR] + "</td></tr><tr><td><input name='BuildingFloor' id='building_" + this.uid + "' class='contactusfld' size='30' type='text' onfocus=\"pcaCtrls[" + this.uid + "].Hide()\" ></td>");
	    strHtml.append("</tr>");



	    //Work through the row order rules
	    for (intCounter = 0; intCounter < strFields.length; intCounter++) {
	        strField = strFields.substring(intCounter, intCounter + 1);
	        switch (strField) {
	            case this.TAG_BUILDING:
	                strHtml.append("<tr>");
	                strHtml.append("<td width='100px'>" + objLabels[strField] + "</td></tr>");
	                strHtml.append("<tr><td ><input name='BuildingNumber' class='contactusfld' type=text id=txtPcaBuilding_" + this.uid + " value=\"" + this.Building + "\" size=30 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	                strHtml.append("</tr>");
	                break;
	            case this.TAG_ROAD:
	                strHtml.append("<tr>");
	                strHtml.append("<td  id='pcaStreet'>" + objLabels[strField] + "</td></tr>");
	                strHtml.append("<tr><td ><input name='Street' class='contactusfld' type=text id=txtPcaStreet_" + this.uid + " value=\"" + this.Street + "\" size=30 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "');pcaCtrls[" + this.uid + "].AutoComplete(this.value)\" disableAutoComplete='True' onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	                strHtml.append("<a id='autocomp' name='autocomp'/> </a></td>");
	                strHtml.append("</tr>");
	                break;
	            case this.TAG_LOCALITY:
	                strHtml.append("<tr>");
	                strHtml.append("<td >" + objLabels[strField] + "</td></tr>");
	                strHtml.append("<tr><td ><input name='Locality' class='contactusfld' type=text id=txtPcaLocality_" + this.uid + " value=\"" + this.Locality + "\" size=30 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	                strHtml.append("</tr>");
	                break;
	            case this.TAG_TOWN:
	                strHtml.append("<tr>");
	                strHtml.append("<td  id='pcaCity'>" + objLabels[strField] + "</td></tr>");
	                strHtml.append("<tr><td ><input name='Town' class='contactusfld' type=text id=txtPcaCity_" + this.uid + " value=\"" + this.City + "\" size=30 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	                strHtml.append("</tr>");
	                break;
	            case this.TAG_STATE:
	                strHtml.append("<tr>");
	                strHtml.append("<td >" + objLabels[strField] + "</td></tr>");
	                strHtml.append("<tr><td ><input name='State' class='contactusfld' type=text id=txtPcaState_" + this.uid + " value=\"" + this.State + "\" size=30 onblur=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onkeyup=\"pcaCtrls[" + this.uid + "].SaveState(this.value, '" + strField + "')\" onfocus=\"pcaCtrls[" + this.uid + "].Hide()\"></td>");
	                strHtml.append("</tr>");
	                break;
	        }
	    }
	    strHtml.append("</table>");

	    var obj = document.getElementById('Telephone');
	    if (obj) obj.value = strTelPrefix;


	    var obj = document.getElementById('Fax');
	    if (obj) obj.value = strTelPrefix;

	    //Update the existing panel;
	    this.m_objPanelCountry.innerHTML = strHtmlCountry.toString();
	    this.m_objPanelForm.innerHTML = strHtml.toString();

	}

	this.SetCountry = function(what)
	{
		//Set the property
		this.Country=what;

		//Set the default language
		this.Language=this.Countries[what][this.COUNTRY_DEFAULTLANGUAGE];
		
		//Redraw the form
		this.DrawForm();
	}
	
	
	this.SetLanguage = function(what)
	{
		//Set the property
		this.Language=what;
		
		//Redraw the form
		this.DrawForm();

	}


	this.SaveState = function(value, type)
	{
		//Save the current state of the form item
		switch (type)
		{
			case this.TAG_BUILDING:	
				this.Building=value;
				break;
			case this.TAG_ROAD:	
				this.Street=value;
				break;
			case this.TAG_LOCALITY:	
				this.Locality=value;
				break;
			case this.TAG_TOWN:	
				this.City=value;
				break;
			case this.TAG_STATE:	
				this.State=value;
				break;
			case this.TAG_POSTCODE:	
				this.Postcode=value;
				break;
			case this.TAG_COUNTRY:
				this.Country=value;
				this.SetCountry(this.Country);
				break;
			case this.TAG_LANGUAGE:
				this.Language=value;
				this.SetLanguage(this.Language);
				break;
		}
		//Call the callback
		if (this.Callback) this.Callback();
	}
	
	this.GetLeft = function(what)
	{
		var objNode = what;
		var intValue = 0;
		if (navigator.appName=="Microsoft Internet Explorer") 
		{		
		
				while (objNode && objNode.tagName !="BODY" && objNode.tagName !="HTML" && objNode.id !="content_without_leftnav_middlecolumn")
				{
					intValue += objNode.offsetLeft;
					objNode = objNode.offsetParent;
				}
		}
		else{
				while (objNode.tagName !="BODY" && objNode.id !="content_leftcolumn")
				{
					intValue += objNode.offsetLeft;
					objNode = objNode.offsetParent;
				}

		}
		return intValue;
	}
	
	this.GetTop = function(what)
	{
		var objNode = what;
		var intValue = 0;
		if (navigator.appName=="Microsoft Internet Explorer") 
		{		
			
			while (objNode && objNode.tagName !="BODY" && objNode.tagName !="HTML" && objNode.id !="content_without_leftnav_middlecolumn")
			{
				intValue += objNode.offsetTop;
				objNode = objNode.offsetParent;
			}
		}
		else{
	
			while (objNode.tagName !="BODY" && objNode.id !="content_leftcolumn")
			{
				intValue += objNode.offsetTop;
				objNode = objNode.offsetParent;
			}


		}
		return intValue;
	}

	this.AutoComplete = function (value)
	{
		var strHtml = new this.StringBuffer();
		var strFilter=this.RemoveDiacritics(value);
		var intItems=0;
		var intCounter=0;
		var intLastMatch=0;
		var strLocation="";

		//Reposition + resize the autocomplete panel
		var coords;//= getAnchorPosition('autocomp');
		if(coords){
			alert(coords.y + " " + coords.x);
			document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.top = coords.y;
			document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.left = coords.x;
//			document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.position = 'absolute';
		}
		else{
			var y = this.GetTop(document.getElementById("txtPcaStreet_" + this.uid)) + document.getElementById("txtPcaStreet_" + this.uid).offsetHeight;
			var x = this.GetLeft(document.getElementById("txtPcaStreet_" + this.uid))
			var obj = document.getElementById("objPcaAutoCompletePanel_" + this.uid);
			obj.style.top = y + "px";
			obj.style.left = x + "px";
		}
		document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.width = document.getElementById("txtPcaStreet_" + this.uid).offsetWidth;
		if (navigator.appName=="Microsoft Internet Explorer") 
		{
			document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.width = document.getElementById("txtPcaStreet_" + this.uid).offsetWidth;
		}
		else
		{
			document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.width = document.getElementById("txtPcaStreet_" + this.uid).offsetWidth-2;
		}
		
		if (this.m_blnDataLoaded)
		{
			if (strFilter!="" )
			{
				//Draw the autocomplete items
				strHtml.append("<div  style='height:179px;overflow:auto;z-index:5'>");	
				for (intCounter=0; intCounter<pcaRecordCount; intCounter++)
				{
					if(this.m_objStreetList[intCounter].indexOf(strFilter)>=0)
					{
						strHtml.append("<div class='item' onmouseover=\"this.className='itemhover';\" onmouseout=\"this.className='item';\">");	
						strHtml.append("<a href='javascript:pcaCtrls[" + this.uid + "].SelectItem(" + intCounter + ")'>");
						strHtml.append("<b>" + pcaData[intCounter][pcaFields["street"]] + "</b><br>");
						strLocation="";
						if (pcaData[intCounter][pcaFields["district"]]!="") strLocation += ", " + pcaData[intCounter][pcaFields["district"]];
						if (pcaData[intCounter][pcaFields["city"]]!="") strLocation += ", " + pcaData[intCounter][pcaFields["city"]];
						if (pcaData[intCounter][pcaFields["state"]]!="") strLocation += ", " + pcaData[intCounter][pcaFields["state"]];
						strHtml.append(strLocation.substring(2,strLocation.length));
						strHtml.append("</a>");	
						strHtml.append("</div>");	
						intLastMatch = intCounter;
						intItems += 1;
					}
				}
				//Add the branding
				strHtml.append("</div>")
				strHtml.append("<div class='itemlast' style='height:20px;font-family:arial;font-size:7pt;color:#aaaaaa;'>");
				strHtml.append("<div style='float:left;padding-left:5px;padding-top:4px;'>" + intItems + " item(s)</div>");
				strHtml.append("<div style='float:right;padding-right:5px;;padding-top:4px;'><i>Powered by</i> <a href='http://www.crmtechnologies.com/postcodeanywhere/' target=_blank><font color='#000088'><b>Postcode</b>Anywhere</font></a></div>");
				strHtml.append("</div>")
			}
			if (intItems==0) 
			{
				//Nothing found so hide the list
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).innerHTML = "";
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.display="none";
			}
			else if (intItems==1 && this.m_blnAutoSelect)
			{
				//One item found so select it automatically
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).innerHTML = "";
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.display="none";
				this.SelectItem(intLastMatch);
			}
			else
			{
				//Multiple items found, show the list
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).innerHTML = strHtml.toString();
				document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.display="block";
				var  obj = document.getElementById('Industry');
				if(obj) obj.style.visibility = "hidden";
			}
		}	
	}

	this.Hide = function()
	{
		document.getElementById("objPcaAutoCompletePanel_" + this.uid).innerHTML = "";
		document.getElementById("objPcaAutoCompletePanel_" + this.uid).style.display="none";
		var  obj = document.getElementById('Industry');
		if(obj) obj.style.visibility = "visible";

	}

    this.FetchStreetsBegin = function (postcode)
    {
        var scriptTag = document.getElementById("pcaScript");
        var headTag = document.getElementsByTagName("head").item(0);
        var strUrl = "";
        
        if (postcode!="")
        {
        
            //Enable autoselect
            this.m_blnAutoSelect = true;

			if (this.m_strLastSearch != postcode+this.Country)
			{
			
				//Save the last search
				this.m_strLastSearch = postcode+this.Country;
        
				//Build the url
				strUrl = this.BaseUrl() + "/inline2.aspx?";
				strUrl += "&action=international";
				strUrl += "&type=fetch_streets";
				strUrl += "&postcode=" + escape(postcode);
				strUrl += "&country=" + escape(this.Country);
				strUrl += "&account_code=" + escape(this.AccountCode);
				strUrl += "&license_key=" + escape(this.LicenseKey);
				strUrl += "&callback=pcaCtrls[" + this.uid + "].FetchStreetsEnd";

				//Make the request
				if (scriptTag) 
				{
					try
					{
						headTag.removeChild(scriptTag);
					}
					catch (e)
					{
						//Ignore
					}
				}
				scriptTag = document.createElement("script");
				scriptTag.src = strUrl
				scriptTag.type = "text/javascript";
				scriptTag.id = "pcaScript";
				headTag.appendChild(scriptTag);
			};
        }
    }


    this.FetchStreetsEnd = function() {
        var intFields = 0;
        var intField = 0;
        
        //Test for an error
        if (pcaIsError) {
            //Show the error message
            alert(pcaErrorMessage);
        }
        else {
            //Check if there were any items found
            if (pcaRecordCount == 0) {
                //alert("Sorry, no matching items found");
            }
            else {
                var intCounter;

                //Create the new array to level the diacritics
                this.m_objStreetList = new Array(pcaRecordCount);
                intFields = this.ArrayLength(pcaFields);

                //Level the diacritics and expand the results
                for (intCounter = 0; intCounter < pcaRecordCount; intCounter++) {
                    if (intCounter > 0) {
                        //Expand the data where required
                        for (intField = 0; intField < intFields; intField++) {
                            if (pcaData[intCounter][intField] == "=") {
                                pcaData[intCounter][intField] = pcaData[intCounter - 1][intField];
                            }
                        }
                    }
                    this.m_objStreetList[intCounter] = this.RemoveDiacritics(pcaData[intCounter][pcaFields["street"]]);
                }

                //Automatically select if just 1 item is returned
                if (pcaRecordCount == 1) {
                    this.SelectItem(0);
                }

                //Notify completion
                this.m_blnDataLoaded = true;

            }
        }
    }
        
        
	this.SelectItem = function (item)
	{
        
		//Set the properties
		this.Street=pcaData[item][pcaFields["street"]];
		this.Locality=pcaData[item][pcaFields["district"]];
		this.City=pcaData[item][pcaFields["city"]];
		this.State=pcaData[item][pcaFields["state"]];
        
		//Disable autoselect
		this.m_blnAutoSelect = false;
        
		//Redraw the form
		this.DrawForm();

	    //Reset the focus
//	    var obj = document.getElementById('txtPcaBuilding_' + this.uid );
//	    var obj2 = document.getElementById('txtPcaStreet_' + this.uid );
//	    if(obj) setTimeout("document.getElementById('txtPcaBuilding_" + this.uid + "').focus();",200);
//	    else if(ob2) setTimeout("document.getElementById('txtPcaStreet_" + this.uid + "').focus();",200);

	    var obj = document.getElementById('building_' + this.uid );
	    if(obj) setTimeout("document.getElementById('building_" + this.uid + "').focus();",200);

	    	

		//Call the callback
		if (this.Callback) this.Callback();
        
	}
	
	this.Label = function()
	{
		if (this.ContainsKey(this.Formats, this.Country + "." + this.Language))
		{
			return this.ApplyFormat(this.Formats[this.Country + "." + this.Language][this.FORMAT_LABEL]);	
		}
		else
		{
			return this.ApplyFormat(this.Formats["DEF.ENG"][this.FORMAT_LABEL]);	
		}
	}
	
	this.Line1 = function()
	{
		if (this.ContainsKey(this.Formats, this.Country + "." + this.Language))
		{
			return this.ApplyFormat(this.Formats[this.Country + "." + this.Language][this.FORMAT_LINE1]);
		}
		else
		{
			return this.ApplyFormat(this.Formats["DEF.ENG"][this.FORMAT_LINE1]);	
		}
	}
	
	this.Line2 = function()
	{
		if (this.ContainsKey(this.Formats, this.Country + "." + this.Language))
		{
			return this.ApplyFormat(this.Formats[this.Country + "." + this.Language][this.FORMAT_LINE2]);
		}
		else
		{
			return this.ApplyFormat(this.Formats["DEF.ENG"][this.FORMAT_LINE1]);	
		}
	}
	
	this.ApplyFormat = function(rules)
	{
		var strRule;
		var strLabel = "";
		var strLine = "";
		var intCounter;
	
		//Format the address
		for (intCounter=0; intCounter<rules.length; intCounter++)
		{
			strRule=rules.substring(intCounter,intCounter+1);
			switch (strRule.toUpperCase())
			{
				case this.TAG_BUILDING:
					strLine += this.FixCase(this.Building, strRule);
					break;
				case this.TAG_ROAD:
					strLine += this.FixCase(this.Street, strRule);
					break;
				case this.TAG_LOCALITY:
					strLine += this.FixCase(this.Locality, strRule);
					break;
				case this.TAG_TOWN:
					strLine += this.FixCase(this.City, strRule);
					break;
				case this.TAG_STATE:
					strLine += this.FixCase(this.State, strRule);
					break;
				case this.TAG_POSTCODE:
					strLine += this.FixCase(this.Postcode, strRule);
					break;
				case this.TAG_COUNTRY:
					if (this.Country!=this.HomeCountry)
					{
						strLine += this.FixCase(this.Countries[this.Country][this.COUNTRY_NAME], strRule);
					}
					break;
				case this.TAG_NEWLINE:
					if (strLine != "") strLabel += strLine + "\n";
					strLine ="";
					break;
				case this.TAG_SPACE:	
					strLine += " ";
					break;
				default:
					strLine += strRule;
					break;
			}
		}
		
		//Add the final line
		if (strLine != "") strLabel += strLine + "\n";
				
		//Return the formatted label
		return strLabel;
	}
	
	this.FixCase = function(text, tag)
	{
		var strLowerCase = "qwertyuiopasdfghjklzxcvbnm";
		if (strLowerCase.indexOf(tag)>=0)
			return text
		else
			return text.toUpperCase();
	}
	
	
	this.ArrayLength = function (what)
	{
		var intItems=0;
		var strKey;

		for (strKey in what)
		{
			intItems+=1;
		}
		
		return intItems;
		
	}
	
	
	this.ArrayKey = function (what, index)
	{
		var intItems=0;
		var key;
		
		for (strKey in what)
		{
			if (intItems==index)
			{
				return strKey
			}
			intItems+=1;
		}
		
		return -1;
	}

	this.ContainsKey = function (what, key)
	{
		var key;
		
		for (strKey in what)
		{
			if (strKey==key)
			{
				return true;
			}
		}
		
		return false;
	}	
	
	this.StringBuffer = function () 
	{ 
		this.buffer = []; 
		this.append = function(what)
		{
			this.buffer.push(what); 
		}
		this.toString = function()
		{
			return this.buffer.join(""); 
		}
	} 

		
    //Set the default state
    if (country=="")
    {
        //These are set serverside based on IP address
        this.SetCountry("GBR");
    }
    else
    {
        //Set based on the user's request
        this.SetCountry(country);
        this.SetLanguage(language);
    }
    
    this.CheckTabToNext = function(e){
    	
    	this.tabflag = 0;
    	
		if(window.event) // IE
			{
			e = window.event;
			keynum = e.keyCode;
			}
		else if(e && e.which) // Netscape/Firefox/Opera
			{
			keynum = e.which;
			}
		
		if(e && e.keyCode==9){
			this.tabflag = 1;		
	   	}
  
    
    
    }
    
    
    this.setFocusToNext = function (e)
    {


		if(this.tabflag == 1){
	    	var obj = document.getElementById(this.strNextFieldToFocus + this.uid);
	    	if(obj) obj.focus();
	    	this.tabflag = 0;
    	}
  
    
    

    }

}

// JScript source code



// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================


/* SOURCE FILE: AnchorPosition.js */

/* 
AnchorPosition.js
Author: Matt Kruse
Last modified: 10/11/02

DESCRIPTION: These functions find the position of an <A> tag in a document,
so other elements can be positioned relative to it.

COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.

FUNCTIONS:
getAnchorPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor. Position is relative to the PAGE.

getAnchorWindowPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor, relative to the WHOLE SCREEN.

NOTES:

1) For popping up separate browser windows, use getAnchorWindowPosition. 
   Otherwise, use getAnchorPosition

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
*/ 

// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

