some javascript loops