button1.onPress=function()
{
getURL("javascript
:window.externalAddFavorite(адрес, заголовок);");
}
button2.onPress=function()
{
getURL("javascript
:this.style.behavior='url(#default#homepage)';
this.setHomePage(адрес);");
}
Вроде так

Правда, может во втором случае в роли this может быть что-то типа document.links[i]