function UpdateProvinceSelect()
{
    var country = document.getElementById('countryID');
    var countryID = country.options[country.selectedIndex].value;
    RunPHPFile('Provinces_js.php?countryID='+countryID);

    // debug window
    //var debugWin = window.open('', 'debug');
    //debugWin.document.write('countryID: '+countryID);
    //debugWin.document.close();
}

function CheckOtherProvince()
{

    var province = document.getElementById( 'provinceID' );
    var value = province.options[province.selectedIndex].value;
    if( value == -1 )
    {
        // create a popup window for entering the other province selection
        var fRet;
        fRet = prompt("Enter a province/state.","New Province/State");
        if(fRet != null)
        {
            var optionObj = new Option( fRet, fRet );
        	var optionRank = province.options.length-1;
            province.options[ optionRank ] = optionObj;

            province.options[ optionRank ].selected = true;

            var optionObj = new Option( 'Other...', -1 );
        	var optionRank = province.options.length;
            province.options[ optionRank ] = optionObj;
        }

    }

}
