// JavaScript Document

function addCircles(type,number){
	var circlediv = document.getElementById('circles');
	var sourceimage = 'images/bg_circle.png';
	if(type == 'large'){
		var approx_size = 160;
		var max_opacity = 5;
	}else if(type == 'normal'){
		var approx_size = 70;
		var max_opacity = 8;
	}else if(type == 'small'){
		var approx_size = 10;
		var max_opacity = 12;
	}
	for(var i = 0; i < parseInt(number); i++){
		var circle = document.createElement('img');
		var opacity = Math.round(Math.random()*max_opacity);
		var size = 10 - Math.round(Math.random()*20) + approx_size;
		circle.src = sourceimage;
		circle.className = 'bg_circle';
		circle.id = 'circle' + type + i;
		circle.alt = Math.round(Math.random()*4)-2;
		circle.title = Math.round(Math.random()*4)-2;
		circle.style.opacity = (opacity / 100);
		circle.style.KhtmlOpacity = (opacity / 100);
		circle.style.filter = "Alpha(opacity=" + opacity + ")";
		circle.style.MozOpacity = (opacity/100);
		circle.style.height = size + 'px';
		circle.style.width = size + 'px';
		circle.style.top = Math.round(Math.random()*600+20) + 'px';
		circle.style.left = Math.round(Math.random()*1200+20) + 'px';
		//alert('top: ' + circle.style.top + ' / left: ' + circle.style.left + ' / opacity: ' + opacity + ' / size: ' + size);
		circlediv.appendChild(circle);
	}
	
}