Reference:
http://sliong.wordpress.com/2012/06/07/crm-2011-retrieve-entity-metadata-using-javascript/