//<!-- hide from old browsers...



var info
var initVal = "please select"



function createArray() {

    info = new Array(
initVal + "*Any",
"United Kingdom*Any|Angus|Antrim|Argyll and Bute|Armagh|Avon|Ayrshire|Bedfordshire|Berkshire|Blaenau Gwent|Birmingham|Borders|Bridgend|Bristol|Buckinghamshire|Caerphilly|Cambridgeshire|Cardiff|Carmarthenshire|Central|Ceredigion|Channel Islands|Cheshire|Clwyd|Conwy|Cornwall|County Durham|Cumbria|Denbighshire|Derbyshire|Devon|Dorset|Dumfries and Galloway|Down|Dyfed|East Sussex|East Yorkshire|Edinburgh|Essex|Fermanagh|Fife|Flintshire|Galway|Glasgow|Gloucestershire|Grampian|Greater Manchester|Gwent|Gwynedd|Hampshire|Herefordshire|Hertfordshire|Highland|Isle of Anglesey|Isle of Man|Isle of Wight|Kent|Lanarkshire|Lancashire|Leicestershire|Lincolnshire|London|Londonderry|Lothian|Merseyside|Merthyr Tydfil|Middlesex|Mid Glamorgan|Monmouthshire|Neath Port Talbot|Newport|Norfolk|North Yorkshire|Northamptonshire|Northumberland|Nottinghamshire|Orkney|Oxfordshire|Pembrokeshire|Powys|Rhondda Cynon Taf|Shetland|Shropshire|Somerset|South Glamorgan|South Yorkshire|Staffordshire|Strathclyde|Suffolk|Surrey|Swansea|Tayside|Torfaen|Tyne and Wear|Tyrone|Vale of Glamorgan|Warwickshire|West Midlands|West Sussex|West Yorkshire|Western Isles|West Glamorgan|Wiltshire|Worcestershire|Wrexham",
"United States*Any|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming",
"Ireland*Any|Carlow|Cavan|Clare|Cork|Donegal|Dublin|Galway|Kerry|Kildare|Kilkenny|Laois|Leitrim|Limerick|Longford|Louth|Mayo|Meath|Monaghan|Offaly|Roscommon|Sligo|Tipperary|Waterford|Westmeath|Wexford|Wicklow",
"Australasia*Any|Fiji|New South Wales|New Zealand|Northern Territory|Papua New Guinea|Queensland|South Australia|Tasmania|Victoria|Western Australia",
"Canada*Any|Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland|NorthWest Territories|Nova Scotia|Ontario|Prince Edward Island|Quebec|SasKatchewan|Yukon",
"Africa*Any|Algeria|Angola|Benin|Botswana|Burkina Faso|Burundi|Cameroon|Cape Verdi Islands|Central African Republic|Chad|Comoros|Congo|Djibouti Republic|Egypt|Equatorial Guinea|Ethiopia|Gabon|Gambia|Ghana|Guinea|Guinea-Bissau|Ivory Coast|Kenya|Lesotho|Liberia|Libya|Madagascar|Mali|Mauritania|Mauritius|Morocco|Mozambique|Namibia|Niger|Nigeria|Reunion|Rwanda|Senegal|Seychelles|Sierra Leone|South Africa|Sudan|Swaziland|Tanzania|Tunisia|Uganda|Zaire|Zambia|Zimbabwe",
"Asia*Any|Afghanistan|Azerbaijan|Bangladesh|Bhutan|Brunei|Burma|Cambodia|China|Hong Kong|India|Indonesia|Japan|Kazakhstan|Laos|Macau|Malaysia|Maldive Islands|Mongolia|Nepal|North Korea|Pakistan|Philippines|Singapore|South Korea|Sri Lanka|Taiwan|Thailand|Vietnam",
"Europe*Any|Albania|Andorra|Austria|Belarus|Belgium|Bosnia and Herzegovina|Bulgaria|Croatia|Cyprus|Czech Republic|Denmark|Estonia|Faroe Islands|Finland|France|Germany|Gibraltar|Greece|Hungary|Iceland|Italy|Latvia|Lithuania|Luxembourg|Macedonia|Malta|Netherlands|Norway|Poland|Portugal|Romania|Russian Federation|Serbia|Slovakia|Slovenia|Spain|Sweden|Switzerland|Turkey|Ukraine|Yugoslavia",
"The Caribbean*Any|Anguilla|Antigua|Aruba|The Bahamas|Barbados|Barbuda|Bermuda|Bonaire|The British Virgin Islands|The Cayman Islands|Cuba|Curacao|Dominica|The Dominican Republic|Grenada|Guadeloupe|Haiti|Jamaica|Martinique|Montserrat|Puerto Rico|Saba|St. Barthelemy|St. Kitts and Nevis|St. Lucia|St. Martin|St. Vincent and the Grenadines|Tobago|Trinidad|Turks and Caicos|The U.S. Virgin Islands",
"Mexico*Any|acapulco|Aguascalientes|Cabo San Lucas|Cancun|Celaya|Chihuahua|Ciudad Del Carmen|Ciudad Juarez|Ciudad Obregon|Coatzacoalcos|Cozumel|Culiacan|Culiacan Sinaloa|Guadalajara|Guaymas|Hermosillo|Huatulco|Ixtapa-Zihuatanejo|La Paz|Lazaro Cardenas|Leon Guanajuato|Loreto|Los Mochis|Manzanillo|Manzanillo Colima|Matamoros|Mazatlan|Mazatlan-Sin|Merida|Mexicali|Mexico City|Minatitlan|Monterrey|Morelia-Michoacan|Nuevo Laredo|Oaxaca|Playa Del Carmen|Puebla|Puerto Escondido|Puerto Vallarta|Queretaro|Ramos Arizpe-Coah|Salina Cruz|Saltillo-Coahuila|San Jose Del Cabo|San Juan Del Rio|San Luis Potosi|Silao-Guanajuato|Tamaulipas|Tapachula|Tepic|Tijuana|Toluca-Edo|Torreon|Torreon Coahuila|Torres Satelite|Tuxtla Gutierrez|Veracruz|Villahermosa|Zacatecas",
"Central America*Any|Belize|Costa Rica|El Salvador|Guatemala|Honduras|Nicaragua|Panama",
"South America*Any|Argentina|Brazil|Chile|Columbia|Paraguay|Peru|Uruguay|Venezuela|Costa Rica|Cuba|Dominica|Ecuador|Haiti|Honduras|Mexico|",
"Middle East*Any|Bahrain|Iran|Iraq|Israel|Jordan|Kuwait|Lebanon|Oman|Qatar|Saudi Arabia|Syria|United Arab Emirates"
);

}


createArray()

function updateMenus(what){
    var ctry = what.value;
    var tmp, arr, found
    
    found = false
    for (c=0; c<info.length; c++){
        tmp = info[c]
        if (tmp.split('*')[0] == ctry){
            arr = tmp.split('*')[1].split('|')
            found = true
            break
        }
    }

    if (found){
        document.getElementById("frm_town").options.length = arr.length;

        for ( var i = 0; i < arr.length; i++ ) {
            document.getElementById("frm_town").options[i].text  = arr[i];
            document.getElementById("frm_town").options[i].value = arr[i];
        }
        document.getElementById("frm_town").selectedIndex=0;
    }
    setState()
}

function setCountry(country) {
    var dd_country = document.getElementById("frm_country")
    for ( var c = 0; c < dd_country.options.length; c++ ) {
        if (country == document.getElementById("frm_country").options[c].text){
            dd_country.selectedIndex=c
            updateMenus(dd_country)
        }
    }
    setState()
}



function setRegion(region){
    var dd_region
    var dd_country = document.getElementById("frm_country")
    updateMenus(dd_country)
    dd_region = document.getElementById("frm_town")
    for ( var c = 0; c < dd_region.options.length; c++ ) {
        if (region == document.getElementById("frm_town").options[c].text){
            dd_region.selectedIndex=c
        }
    }
    setState()
}


function setState(){
    var ctry

    if (document.getElementById("td_region")){
        ctry = document.getElementById("frm_country").value
        
        document.getElementById("td_region").innerHTML = "<b>Region</b>"
        
        if (ctry == "United States")document.getElementById("td_region").innerHTML = "<b>State</b>"
        if (ctry == "United Kingdom")document.getElementById("td_region").innerHTML = "<b>County</b>"
    
    }   
}



function showIncBox(obj) {

    if (obj.value != '') {
        document.getElementById("tr_incBox").style.display = "block"
    } else {
        document.getElementById("tr_incBox").style.display = "none"
    }
}


// end of hiding -->