Added random gradient routine to javascript