Added javascript function for getting archives