$(document).ready(function() {
		
		randomizeIt();
	
		$(".comelement").draggable();
	
		$("#intinction_chart_reset").click(function() {
		
			randomizeIt();
			return false;
		
		});
	
		function randomizeIt() {
			
			var posX = 0;
			var poxY = 0;
			var containerBoxWidth = parseInt($("#intinction_chart").css('width'))-100;	
			var containerBoxHeight = parseInt($("#intinction_chart").css('height'))-150;	

			$(".comelement").each(function() {
			
				posX = Math.floor(Math.random()*containerBoxWidth) + "px";
				posY = Math.floor(Math.random()*containerBoxHeight) + "px";
				
				$(this).animate({left:posX,top:posY}, 2000);			
				
			});
		
		}
	
	});
