function populate(array1, array2, length)
{
	var randomIndex,random;
	while (array2.length !== length) 
	{
		random = Math.floor(Math.random()*array1.length);
		randomIndex = Math.floor(Math.random()*array1[random].list.length);
		if($.inArray(array1[random].list[randomIndex],array2) === -1)
		array2.push(array1[random].list[randomIndex]);
	}
	return array2;
}

function getUniqueValArr(inputArr,outputArr,length)
{
	for(var i=0;i<length;i++)
	{
		var randNum=Math.floor(Math.random()*inputArr.length);
		if(outputArr.includes(inputArr[randNum]))
		{
			i--;
			continue;
		}
		else
		{
			outputArr.push(inputArr[randNum]);	
		}
	
	}
}

function shuffleArray(array)
{
	var i,j,temp;
	for (i = array.length - 1; i > 0; i--) 
	{
	    j = Math.floor(Math.random() * (i + 1));
	    temp = array[i];
	    array[i] = array[j];
	    array[j] = temp;
	}
	return array;
}

