Javascript Create Associative Array Javascript Function