cities["Pick"] = ["Other"]; function fillSelectColor1(nValue,nList){ if (nValue=="Other") { document.getElementById('color1div').style.visibility = 'visible'; } else { document.getElementById('color1div').style.visibility = 'hidden'; document.getElementById('color1other').value = ''; } } function fillSelectColor2(nValue,nList){ if (nValue=="Other") { document.getElementById('color2div').style.visibility = 'visible'; } else { document.getElementById('color2div').style.visibility = 'hidden'; document.getElementById('color2other').value = ''; } } function fillSelect(nValue,nList){ if (nValue!="Dog" && nValue!="Cat") nValue = "Other"; if (nValue=="Dog") { document.getElementById('doggy_link').href = 'http://www.justdogbreeds.com/dog-breeds.html'; document.getElementById('doggy_link').style.visibility = 'visible'; } else if (nValue=="Cat") { document.getElementById('doggy_link').href = 'http://www.pictures-of-cats.org/pictures-of-cat-breeds.html'; document.getElementById('doggy_link').style.visibility = 'visible'; } else { document.getElementById('doggy_link').style.visibility = 'hidden'; } nList.options.length = 1; var curr = cities[nValue]; for (each in curr) { var nOption = document.createElement('option'); nOption.appendChild(document.createTextNode(curr[each])); nOption.setAttribute("value",curr[each]); nList.appendChild(nOption); } //if (nValue =="Other") nList.selectedIndex=1; } function fillSelectCity(nValue,nList){ nList.options.length = 1; var curr = cities[nValue]; for (each in curr) { var nOption = document.createElement('option'); nOption.appendChild(document.createTextNode(curr[each])); nOption.setAttribute("value",curr[each]); nList.appendChild(nOption); } if (nValue =="Other") nList.selectedIndex=1; }