
function showRandomDivs(group, number) {
	items = document.getElementsByTagName("div");
	
	var groupArray = new Array();
	
	var numToShow = number;
	
	for (var i = 0; i < items.length; i++) {
	
	   var thisGroup = items[i].getAttribute("group");
	   if (thisGroup && thisGroup == group) { 
	   
	     var thisRank = items[i].getAttribute("rank")
	     // Show it if the rank it low enough
	     
	     // Force display if the rank is <= 10
	     // We only add it to the group for picking otherwise
	     if (thisRank <= 10) {
	        items[i].style.display = "block";
	     	numToShow--;
	     } else {
	        groupArray.push(items[i]);
	     }
	   
	     
	   }
	   
	}
	
	while (groupArray.length > 0 && numToShow > 0) {
	     var rn = Math.floor ((Math.random() * groupArray.length))
 	     groupArray[rn].style.display = "block";
 	     groupArray.splice(rn,1);
 	     numToShow--;
 	}		
 	
 	// alert("Done Group " + group + "(need "+ number +" out of " + groupArray.length + ")");
 	
 	
}

