* the index where to insert the element (starting at 1)
*/
public void insertElement( String element, int index )
{
if ( index <= getSize() ) {
HTMLOptionElement option = (HTMLOptionElement)htmlDoc.createElement( "OPTION" );
Node text = htmlDoc.getBody().getFirstChild().cloneNode( true );
option.appendChild( text );
option.getFirstChild().setNodeValue( element );
selectElement.insertBefore( option, selectElement.getChildNodes().item( index - 1 ) );
}
else {
addElement( element );
}