Array.prototype.indexOf = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
Array.prototype.remove = function(val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
var arr = [1,2,3,4,5,6,7];
arr.remove(topicPageNo);
var index = Math.floor((Math.random()*arr.length));