var max_pos;
var min_pos = 0;
var pos = 1;
var avance_punto;





function CalculosIniciales(maximo)
{
	max_pos = maximo;
	var navegador = navigator.appName;
	var explorador=2;
	if (navegador == "Microsoft Internet Explorer")
	{
		explorador=1;
	}
	avance_punto=Math.round((document.getElementById('circulo').offsetHeight-(8*explorador))/(max_pos-1));
}

function arribanoticia()
{
	var div = document.getElementById('grupo_noticias');
	var circulo = document.getElementById('circulo');
	var value = div.style.top;
	var value_circulo = circulo.style.top;
	value = value.replace(/px/,'');
	value_circulo = value_circulo.replace(/px/,'');
	if(pos > min_pos)
	{
		pos--;
		avance_noticia=document.getElementById('noticia_'+pos).offsetHeight;
		inicio=parseInt(value)+avance_noticia;
		div.style.top=inicio+"px";
		inicio_circulo=parseInt(value_circulo)-avance_punto;
		circulo.style.top = inicio_circulo+"px";
	}
}

function abajonoticia()
{
	var div = document.getElementById('grupo_noticias');
	var circulo = document.getElementById('circulo');
	var value = div.style.top;
	var value_circulo = circulo.style.top;
	value = value.replace(/px/,'');
	value_circulo = value_circulo.replace(/px/,'');
	if(pos < max_pos)
	{
		avance_noticia=document.getElementById('noticia_'+pos).offsetHeight;
		pos++;
		inicio=parseInt(value)-avance_noticia;
		div.style.top=inicio+"px";
		inicio_circulo=parseInt(value_circulo)+avance_punto;
		circulo.style.top = inicio_circulo+"px";
	}
}
