
timerIDScroll = null;
var active = 0;

function CambiarNoticia(num){
    	if(document.getElementById){
    		obj[active].style.visibility = "hidden";
    		active = num;
    		obj[active].style.top = 0;
    		obj[active].style.visibility = "visible";
    	}
}

function ScrollUpNoticias(speed){
    	if(document.getElementById){
    		if(parseInt(obj[active].style.top) < 0){
    			obj[active].style.top = parseInt(obj[active].style.top) + speed + "px";
			}
    		timerIDScroll = setTimeout("ScrollUpNoticias("+speed+")",32);
    	}
}

function ScrollDownNoticias(speed){
    	if(document.getElementById){
    		if(parseInt(obj[active].style.top) > document.getElementById('noticias').offsetHeight - obj[active].offsetHeight){
    			obj[active].style.top = parseInt(obj[active].style.top) - speed + "px";
			}
    		timerIDScroll = setTimeout("ScrollDownNoticias("+speed+")",32);
    	}
}

function ScrollStopNoticias(){
    	if(document.getElementById){
    		clearTimeout(timerIDScroll);
    	}
}

function ScrollPageInit() {
    	if(document.getElementById){
    		obj = document.getElementById("noticias").getElementsByTagName("div");
    		obj['noticia1'].style.visibility = "visible";
    		obj['noticia1'].style.top = 0;
    		obj2 = document.getElementById("contenidoEnlaces");
    		obj2.style.top = 0;
    	}
    	if(document.addEventListener){
    		for(i=0;i<document.getElementsByTagName('a').length;i++){
    			document.getElementsByTagName('a')[i].style.position = "relative";
			}
    	}
}

function ScrollUpEnlaces(speed){
    	if(document.getElementById){
    		if(parseInt(obj2.style.top) < 0){
    			obj2.style.top = parseInt(obj2.style.top) + speed + "px";
		}
    		timerIDScroll = setTimeout("ScrollUpEnlaces("+speed+")",32);
    	}
}

function ScrollDownEnlaces(speed){
    	if(document.getElementById){
    		if(parseInt(obj2.style.top) > document.getElementById('enlaces').offsetHeight - obj2.offsetHeight){
    			obj2.style.top = parseInt(obj2.style.top) - speed + "px";
		}
    		timerIDScroll = setTimeout("ScrollDownEnlaces("+speed+")",32);
    	}
}

function ScrollStopEnlaces(){
    	if(document.getElementById){
    		clearTimeout(timerIDScroll);
    	}
}