document.imgpropiedad2 = "";
document.imgnum2 = 0;
document.auto2 = 0;
var EjecutaCarrusel2;

function inicio10(){
	document.getElementById('titulo_not1').style.display='block';
	document.getElementById('titulo_not2').style.display='none';
	document.getElementById('titulo_not3').style.display='none';
	document.getElementById('titulo_not4').style.display='none';
	document.getElementById('titulo_not5').style.display='none';
	document.getElementById('contenido_not1').style.display='block';
	document.getElementById('contenido_not2').style.display='none';
	document.getElementById('contenido_not3').style.display='none';
	document.getElementById('contenido_not4').style.display='none';
	document.getElementById('contenido_not5').style.display='none';	
}

function inicio11(){
	document.getElementById('titulo_not2').style.display='block';
	document.getElementById('titulo_not1').style.display='none';
	document.getElementById('titulo_not3').style.display='none';
	document.getElementById('titulo_not4').style.display='none';
	document.getElementById('titulo_not5').style.display='none';
	document.getElementById('contenido_not2').style.display='block';
	document.getElementById('contenido_not1').style.display='none';
	document.getElementById('contenido_not3').style.display='none';
	document.getElementById('contenido_not4').style.display='none';
	document.getElementById('contenido_not5').style.display='none';
}

function inicio12(){
	document.getElementById('titulo_not3').style.display='block';
	document.getElementById('titulo_not2').style.display='none';
	document.getElementById('titulo_not1').style.display='none';
	document.getElementById('titulo_not4').style.display='none';
	document.getElementById('titulo_not5').style.display='none';
	document.getElementById('contenido_not3').style.display='block';
	document.getElementById('contenido_not2').style.display='none';
	document.getElementById('contenido_not1').style.display='none';
	document.getElementById('contenido_not4').style.display='none';
	document.getElementById('contenido_not5').style.display='none';
}

function inicio13(){
	document.getElementById('titulo_not4').style.display='block';
	document.getElementById('titulo_not2').style.display='none';
	document.getElementById('titulo_not3').style.display='none';
	document.getElementById('titulo_not1').style.display='none';
	document.getElementById('titulo_not5').style.display='none';
	document.getElementById('contenido_not4').style.display='block';
	document.getElementById('contenido_not2').style.display='none';
	document.getElementById('contenido_not3').style.display='none';
	document.getElementById('contenido_not1').style.display='none';
	document.getElementById('contenido_not5').style.display='none';
}

function inicio14(){
	document.getElementById('titulo_not5').style.display='block';
	document.getElementById('titulo_not2').style.display='none';
	document.getElementById('titulo_not3').style.display='none';
	document.getElementById('titulo_not4').style.display='none';
	document.getElementById('titulo_not1').style.display='none';
	document.getElementById('contenido_not5').style.display='block';
	document.getElementById('contenido_not2').style.display='none';
	document.getElementById('contenido_not3').style.display='none';
	document.getElementById('contenido_not4').style.display='none';
	document.getElementById('contenido_not1').style.display='none';
}

function CambiarImg2(x,y) {
	document.imgnum2=x;
	Carrusel2(0);
	window.clearInterval(EjecutaCarrusel2);
	document.auto2 = -1;
}

function regresar() {
	if(document.imgnum2>0){
		window.clearInterval(EjecutaCarrusel2);
		document.imgnum2=document.imgnum2-1;
		document.auto2 = 0;
		Carrusel2(0);		
		movimiento2();
		
	}	
}

function adelantar() {
	if(document.imgnum2<4){
		window.clearInterval(EjecutaCarrusel2);
		document.imgnum2=document.imgnum2+1;
		document.auto2 = 0;
		Carrusel2(0);		
		movimiento2();
		
	}	
}

function Carrusel2(x) {
	document.imgnum2 = document.imgnum2 + x;
	if(document.imgnum2 > (document.arrImg2.length - 1)) document.imgnum2 = 0;
	if(document.imgnum2 < 0) document.imgnum2 = (document.arrImg2.length - 1);
	if(document.imgnum2==0){
		inicio10();
	}else if(document.imgnum2==1){
		inicio11();
	}else if(document.imgnum2==2){
		inicio12();
	}else if(document.imgnum2==3){
		inicio13();
	}else if(document.imgnum2==4){
		inicio14();
	}
	document.images["imagennoticias"].src = document.arrImg2[document.imgnum2];
    document.imgpropiedad2 = document.arrImg2[document.imgnum2];
	
}

function movimiento2() {
	if(document.auto2 == 1) {
		window.clearInterval(EjecutaCarrusel2);
		document.auto2 = 0;		
	} else if(document.auto2 == 0) {
		EjecutaCarrusel2 = setInterval("Carrusel2(1)", 20000);
		document.auto2 = 1;		
	}
}

function abrir_noticias(){
	id = document.arrid[document.imgnum2];
	pagina='noticias.php?id='+id;
	location.href=pagina
}