You can use this code in Javascript (if your script tag is inside a visualforce page):
var newAccountEndpoint = '{!URLFOR($Action.Account.New)}';
var newOpptyEndpoint = '{!URLFOR($Action.Opportunity.New)}';
Or as I stated before refer to pre made list of standard salesforce object prefixes