In case you have more entities to chose from on a lookup window, then you might want to be able to set the default for this lookup. For instance, the regarding field on an activity entity like letter, email and fax does support multiple entities. If you want this to default set to contact, then use this javascript on the form onload:
//set default
crmForm.all.regardingobjectid.defaulttype = "2";
Even better, what if you dont want your user to be able to choose any entity and force them to use the contact entity? Then use this script:
//set only contact
crmForm.all.regardingobjectid.lookuptypes = "2";
//set icon
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/ico_16_2.gif";
Dont forget to set the icon. The icon will be displayed in front of the selected name after a selection in the lookup box has been made.
For a custom entity, then mind that the icon does not work that easily. Use this script for custom entities:
//set only contact
crmForm.all.regardingobjectid.lookuptypes = "10003";
//set icon
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/icon.aspx?objectTypeCode=10003&iconType=GridIcon&inProduction=1&cache=1";
Good luck!