I am trying to created a Javascript button on the Opportunity to replace the edit button. I want to check if some fields have a value, and if so direct the user to a VF page, if not direct them to the normal edit behavior. The button saves fine, but I get a dialog error "unexpected token '{'". Is there something wrong with my Javascript? Thanks.
IF('{!Account.Type}' == "New") && '{!Opportunity.Ad__c}' == null{
window.parent.location.href = "/apex/OpportunityEditOverride?id="+'{!Opportunity.Id}';
}
else{
window.parent.location.href = "/"+'{!Opportunity.Id}'+"/e?retURL=%2F"+'{!Opportunity.Id}';
}