// Unique Random Numbers
// -Picks a number of unique random numbers from an array
// (c) 2002 Premshree Pillai
// http://www.qiksearch.com
// http://premshree.resource-locator.com
// E-mail : qiksearch@rediffmail.com

function pickNums(nums, numArr)
{
	if(nums>numArr.length)
	{
		alert('You are trying to pick more elements from the array than it has!');
		return false;
	}
	var pickArr=new Array();
	var tempArr=numArr;
	for(var i=0; i<nums; i++)
	{
		pickArr[pickArr.length]=tempArr[Math.round((tempArr.length-1)*Math.random())];
		var temp=pickArr[pickArr.length-1];
		for(var j=0; j<tempArr.length; j++)
		{
			if(tempArr[j]==temp)
			{
				tempArr[j]=null;
				var tempArr2=new Array();
				for(var k=0; k<tempArr.length; k++)
					if(tempArr[k]!=null)
						tempArr2[tempArr2.length]=tempArr[k];
				tempArr=tempArr2;
				break;
			}
		}
	}
	return pickArr;
}		
