function showDiv(elemento, width, height, scrolling, bouncing, evt)
{
	body = document.getElementsByTagName("body")[0];
	
	if(document.getElementById("showDiv") == null)
	{
		div = document.createElement("div");
		img = document.createElement("img");
		img.setAttribute("src", "css/img/indicator_medium.gif");
		img.style.margin = "5px";
		div.appendChild(img);
		div.setAttribute("id", "showDiv");
		div.style.width = width + "px";
		body.appendChild(div);
		if(scrolling)scroll("showDiv", 0, height, 15, bouncing);
		else div.style.height = height + "px";	
		locate(evt, "showDiv");
	}
	
	return div;
}

function scroll(_id, _size, _maxHeight, _speed, _bouncing)
{
	id = _id;
	size = _size;
	maxHeight = _maxHeight;
	speed = _speed;
	bouncing = _bouncing;
	element = document.getElementById(id);
	if(size < maxHeight)
	{
		element.style.height = size + "px";
		size += speed;
		setTimeout("scroll(id, size, maxHeight, speed, bouncing)", 10);
	}
	else if(bouncing) bounce(id, maxHeight, 30, maxHeight, 0);
	else return;
}
	
function bounce1(_id, _height, _bounceHeight, _size, _speed, _direction)
{
	id = _id;
	height = _height;
	bounceHeight = _bounceHeight;
	size = _size;
	speed = _speed;
	direction = _direction;
	
	element = document.getElementById(id);
	
	if(height > bounceHeight)
	{
		element.style.height = size + "px";
		if(direction == "up" && size > bounceHeight)
		{
			size -= speed;
		}
		else if((direction == "down" && size < height) || (direction == "down" && size <= bounceHeight))
		{
			size += speed;
		}
		else if(size <= bounceHeight)
		{
			direction = "down";
			if( ( ( height - bounceHeight ) / 2 ) > speed)
				bounceHeight += (height - bounceHeight) / 2;
			else
				bounceHeight += speed;
		}
		else if(size >= height)
		{
			direction = "up";
		}
		setTimeout("bounce(id, height, bounceHeight, size, speed, direction)", 0);
	}
	else return;
}

function bounce(_id, _height, _bounceHeight, _size, _arrayValue)
{
	id = _id;
	height = _height;
	bounceHeight = _bounceHeight;
	size = _size;
	arrayValue = _arrayValue;
	
	//values = new Array(-(Math.PI/2), 0, (Math.PI/2), Math.PI, ((3 * Math.PI) / 2));
	values = new Array(-(Math.PI/2), -(Math.PI/4), 0, (Math.PI/4), (Math.PI/2), ((3 * Math.PI) / 4), Math.PI, ((5 * Math.PI) / 4), ((3 * Math.PI) / 2));
	len = values.length;
	
	if(bounceHeight > len / 2)
	{
	
		document.getElementById(id);
		element.style.height = size + "px";
		
		if(arrayValue == len - 1) bounceHeight /= 2;
		arrayValue = (arrayValue + 1) % len;
		size = height - ( (bounceHeight / 2) * (Math.sin(values[arrayValue]) + 1));
		setTimeout("bounce(id, height, bounceHeight, size, arrayValue)", 20);
	}
}
	

function locate(e, id)
{
	var posx = 0, posy = 10;
	if (!e) e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if(e.clientX || e.clientY)
	{
		if(document.documentElement.scrollTop)
		{
			posx = e.clientX+document.documentElement.scrollLeft;
			posy = e.clientY+document.documentElement.scrollTop;
		}
		else
		{
			posx = e.clientX+document.body.scrollLeft;
			posy = e.clientY+document.body.scrollTop;
		}
	}
	document.getElementById(id).style.top = (posy+10)+"px";
	document.getElementById(id).style.left = (posx)+"px";
}