function handleCountry (formRef, actionArrayRef) {
    if (formRef.continent.options[formRef.continent.options.selectedIndex].value.substring(0,1) != '0') {
        if (formRef.country.options[formRef.country.options.selectedIndex].value.substring(0,1) != '0') {

            var url = actionArrayRef[formRef.continent.options.selectedIndex][formRef.country.options.selectedIndex];
            location.href = url;

        } else {   //alertcase: no choosable country selected !
            alert("Please choose a country");
            return false;
        }
    } else {   //alertcase: no choosable continent selected !
        alert("Please choose a continent");
        return false;
    }
}

function countrySelect (formRef, textArrayRef) {
    frm = (typeof(this.form) == "object")? this.form:formRef;

    if ((frm.continent.selectedIndex < 2) || (frm.continent.selectedIndex == 3) ) {
        frm.continent.selectedIndex = 0;
        // Repopulate the country list box with the initial display
        // information when the Continent list entry is selected from the continent list box.

        var countrySelectorHeaderJS = new String ("Country");
        var countryInitialTextJS = new String ("Please choose a continent");
        reloadOptionsTextArrays = new Array ( );
        reloadOptionsTextArrays[reloadOptionsTextArrays.length] = new String ( countrySelectorHeaderJS );
        reloadOptionsTextArrays[reloadOptionsTextArrays.length] = new String ( "-------------------" );
        reloadOptionsTextArrays[reloadOptionsTextArrays.length] = new String ( countryInitialTextJS ) ;
        var l = reloadOptionsTextArrays.length;
        frm.country.options.length = l;
        for (i = 0; i < l; i++) {
            var optionsText = new String (reloadOptionsTextArrays[i]);
            var obj = new Option(optionsText, '0'+i);
            frm.country.options[i] = obj;
        }
        frm.country.options[0].selected = true;
        return;
    }
    var newOpts = textArrayRef[frm.continent.options.selectedIndex];
    var l = newOpts.length;
    frm.country.options.length = l;
    for (var i = 0; i < l; i++) {
        if ((newOpts[i]== 'Country') || (newOpts[i]=='-------------------')) {
            var obj = new Option(newOpts[i], '0'+i);
        } else {
            var obj = new Option(newOpts[i], newOpts[i]);
        }
        frm.country.options[i] = obj;
    }
    frm.country.options[0].selected = true;
}
