Hi,
if you are using CRM 2011 I suggest to change your sintax to the supported method.
Instead of crmForm.FormType you need to use
if (Xrm.Page.ui.getFormType() == 1) {
// ...
}
if you are using CRM4, the behavior you described is very strange.
My blog: www.crmanswers.net