Xpages dynamically set style

i am trying to make it so a textinput control is shown or hidden dynamical on a tabbed pannel.

that is based on if a combo box has “Other” selected or not

this is what i have for the onChange event for the combo on the page:

if(document.getElementById(“#{id:Country}”).value == “Other”){

document.getElementById("#{id:countryOther}").style.display = "inline";

}

else {

document.getElementById("#{id:countryOther}").style.display = "none";

document.getElementById("#{id:countryOther}").value = "";

}

and i have this to specify the control is hidden originally "style=“display:none”

the problem im having is i want the box to be shown or hidden when the page is created depending on if “Other” is stored or not, and as this might change when the user is using the page i cant just have a select on the rendered property.

otherwise i can put that function on the tab click but it then wont let me change between the tabs on the tabbed pannel.

i would generally just do this on the afterload in html but xpages doesn have that feature

thanks for any help