function randomIdsOfCat(catslength){ var arr = []; for(i = 0;i<catslength;i++) { while(arr.indexOf(r = getRandomInt(0, uCatsOut.length)) != -1); arr.push(r); } return arr; }