function test() {

    for (var i = 0; i < window.document.forms[0].elements[0].length; i++) {
        if (window.document.forms[0].elements[0].options[i].selected == true) {
            theCountry = window.document.forms[0].elements[0].options[i].text
        }
    }
    for (var i = 0; i < window.document.forms[0].elements[1].length; i++) {
        window.document.forms[0].elements[1].options[i].value = null;
        window.document.forms[0].elements[1].options[i].text = '';
    }
    theRegion = window.document.forms[0].elements[1].options;

    if(theCountry == 'Norway') {
    	theRegion[0].value = 6;
    	theRegion[0].text = 'Hordaland';
    	theRegion[1].value = 8;
    	theRegion[1].text = 'Møre og Romsdal';
    	theRegion[2].value = 13;
    	theRegion[2].text = 'Rogaland';
    	theRegion[3].value = 14;
    	theRegion[3].text = 'Sogn og Fjordane';
    	theRegion[4].value = 16;
    	theRegion[4].text = 'Vest Agder';
    	theRegion[5].value = 17;
    	theRegion[5].text = 'Vestfold';
    	theRegion[6].value = 25;
    	theRegion[6].text = 'Østfold';
    }
    if(theCountry == 'Sweden') {
    	theRegion[0].value = 5;
    	theRegion[0].text = 'Halland';
    	theRegion[1].value = 22;
    	theRegion[1].text = 'Skåne';
    	theRegion[2].value = 15;
    	theRegion[2].text = 'Västra Götaland';
    	theRegion[3].value = 27;
    	theRegion[3].text = 'Vellinge';
    }
    if(theCountry == 'Denmark') {
    	theRegion[0].value = 9;
    	theRegion[0].text = 'Nordjylland';
    	theRegion[1].value = 11;
    	theRegion[1].text = 'Ribe';
    	theRegion[2].value = 12;
    	theRegion[2].text = 'Ringkøbing';
    	theRegion[3].value = 26;
    	theRegion[3].text = 'Storstrøm Amt';
    	theRegion[4].value = 20;
    	theRegion[4].text = 'Sønderjylland';
    	theRegion[5].value = 18;
    	theRegion[5].text = 'Viborg';
    	theRegion[6].value = 3;
    	theRegion[6].text = 'Århus';
    }
    if(theCountry == 'United Kingdom') {
    	theRegion[0].value = 1;
    	theRegion[0].text = 'Aberdeen';
    	theRegion[1].value = 2;
    	theRegion[1].text = 'Aberdeenshire';
    	theRegion[2].value = 23;
    	theRegion[2].text = 'East Lothian';
    	theRegion[3].value = 4;
    	theRegion[3].text = 'Fife';
    	theRegion[4].value = 24;
    	theRegion[4].text = 'Moray Firth';
    	theRegion[5].value = 10;
    	theRegion[5].text = 'North York Moors';
    	theRegion[6].value = 19;
    	theRegion[6].text = 'Northumberland';
    }
    if(theCountry == 'Netherlands') {
    	theRegion[0].value = 28;
    	theRegion[0].text = 'Fryslân';
    	theRegion[1].value = 21;
    	theRegion[1].text = 'Groningen';
    	theRegion[2].value = 30;
    	theRegion[2].text = 'Noord-Holland';
    	theRegion[3].value = 32;
    	theRegion[3].text = 'Zeeland';
    	theRegion[4].value = 31;
    	theRegion[4].text = 'Zuid-Holland';
    }
    if(theCountry == 'Germany') {
    	theRegion[0].value = 29;
    	theRegion[0].text = 'Amt Karrharde';
    }
    
}

function submitSearch() {
    window.location.href = 'http://www.northseatrail.org/index.php/en/search_results/(search)/'+window.document.forms["search_form"].elements["search"].value+'/(extra)/search='+window.document.forms["search_form"].elements["search"].value+'&lang='+window.document.forms["search_form"].elements["lang"].value;
}