//function to generate random numbers
function randomNumFunction(available) {
    return Math.floor((Math.random()*available)+1);
}
// function to look for dupes
function contains(a, e) {
            for(j=0;j<a.length;j++)if(a[j]==e)return true;
            return false;
}
// create the array
function makeRandomArray(count,available) {
	// count is the number of items to add to the array
	// available is the number of items available (numbered consecutively starting with 1)
	var rndmArray=new Array();
	rndmArray[0] = randomNumFunction();
	
	//temporary value
	var tempVal;
	for (i=0; i<count; i++) {
	            tempVal = randomNumFunction(available);
	            if((!contains(rndmArray, tempVal)) && (rndmArray.length < count)){
	                                    rndmArray[i] = tempVal;
	            }
	            else { i= i-1}
	}
	return rndmArray;
}

