if(typeof inArray=='undefined'){document.write('<scr'+'ipt src="/js/inArray.js" language="JavaScript" type="text/javascript"></scr'+'ipt>');}

function selectFromArray(array,quantity){
	var selected=[];
	if(typeof array=='object'&&!isNaN(array.length)&&!isNaN(parseInt(quantity))){
		var quantity=parseInt(quantity);
		var alreadySelected=[];
		for(var i=0;i<array.length&&i<quantity;i++){
			var possible=Math.round(Math.random()*(array.length-1));
			while(inArray(possible,alreadySelected)||typeof array[possible]=='undefined'){var possible=Math.round(Math.random()*(array.length-1));}
			alreadySelected[i]=possible;
			selected[selected.length]=array[possible];
		}
	}
	return selected;
}
