simple javascript pagination