To get the Id of the current record:
var id = Xrm.Page.data.entity.getId();
To get the entity name:
var entityName = Xrm.Page.data.entity.getEntityName();
For more information see the Microsoft website: https://msdn.microsoft.com/en-us/library/gg334720.aspx
