var desplazamiento;
var incremento = 100;
var tiempo = 400;
var posNoticias = 0;

var incrementoM = 100;
var tiempoM = 400;
var posNoticiasM = 0;

$(document).ready(inicia);

function inicia (){
	$("#subeScroll").click(subeScroll);
	$("#bajaScroll").click(bajaScroll);
	desplazamiento = $("#newsContent").height() - $("#news").height();
	$("#subeMScroll").click(subeMScroll);
	$("#bajaMScroll").click(bajaMScroll);
	desplazamientoM = $("#newsMContent").height() - $("#newsMain").height();
}

function subeScroll(){
	if(posNoticias> -desplazamiento){
		posNoticias+= -incremento;
		//$("#contenidoNoticias").css("top", posNoticias);
		$("#newsContent").animate({ top: posNoticias}, tiempo);
	}
}

function bajaScroll(){
	if(posNoticias< 0){
		posNoticias+= incremento;
		//$("#contenidoNoticias").css("top", posNoticias);
		$("#newsContent").animate({ top: posNoticias}, tiempo);
	}
}

function subeMScroll(){
	if(posNoticiasM> -desplazamientoM){
		posNoticiasM+= -incrementoM;
		//$("#contenidoNoticias").css("top", posNoticias);
		$("#newsMContent").animate({ top: posNoticiasM}, tiempoM);
	}
}

function bajaMScroll(){
	if(posNoticiasM< 0){
		posNoticiasM+= incrementoM;
		//$("#contenidoNoticias").css("top", posNoticias);
		$("#newsMContent").animate({ top: posNoticiasM}, tiempoM);
	}
}

