var tkany=[]; window.onload=function(){ var option1 = document.createElement('option'); option1.text = " "; option1.value = "/catalogue.php"; try { document.f1.menuforma.add(option1,null); // Standards compliant. } catch (e) { document.f1.menuforma.add(option1); // IE only version. } for (tk in tkany) { var option = document.createElement('option'); option.text = tkany[tk]; option.value = "/catalogue.php?tkan="+tk; if (document.location.toString().split('?tkan=')[1]==tk) option.selected = true; try { document.f1.menuforma.add(option,null); // Standards compliant. } catch (e) { document.f1.menuforma.add(option); // IE only version. } } }