function randomize(tag){
	var aList = AJS.$bytc(tag, "randomize");
	var e1, e2, temp;

	if(aList.length > 2){

		//swap half the elements	
	
		for(var i = 0; i < aList.length; i++){			
			e1 = Math.floor( Math.random() * (aList.length) );
			do{
				e2 = Math.floor( Math.random() * (aList.length) );
			}while(e1 == e2);
			
			if(AJS.isIe())
				aList[e1].swapNode(aList[e2]);
			else{
				temp = aList[e1].innerHTML;				
				AJS.setHTML(aList[e1],aList[e2].innerHTML);
				AJS.setHTML(aList[e2], temp);
			}			
		}			
	}

	aList = AJS.$bytc("a", "castBadges");
	if( typeof(aList) != "undefined" && aList.length > 1 ){
		e1 = Math.floor( Math.random() * (aList.length) );
		do{
			e2 = Math.floor( Math.random() * (aList.length) );
		}while(e1 == e2);
		AJS.showElement(aList[e1], aList[e2]);
	}

}