- // Timezone selection form
- $timezone_form = 'Continent:';
- $timezone_form .= '<select name="continent" id="continent" onChange="onChangecontinent();">';
- $timezone_form .= $continents_html.'</select>';
- $timezone_form .= ' City:';
- $timezone_form .= '<select name="city" id="city">'.$cities[$pcontinent].'</select><br />';
-
- // Javascript handler - updates the city list when the user selects a continent
- $timezone_js = '<script>';
- $timezone_js .= 'function onChangecontinent() {';
- $timezone_js .= 'document.getElementById("city").innerHTML =';
- $timezone_js .= ' citiescontinent[document.getElementById("continent").value]; }';
- $timezone_js .= 'var citiescontinent = '.json_encode($cities).';';
- $timezone_js .= '</script>';
+ $continents = array_keys($continents);
+ $continents['selected'] = $pcontinent;
+ $cities['selected'] = $pcity;