var picker = new Array();

//------------------TITULO CAMBIO RECURRENTE-----------------------------------------------------------------------------------------------

var textoActual = 1;

var frase = new Array(6);

frase[0] = "Transparencia y supervisión para millones de ciudadanos";

frase[1] = "Dinamiza la modernización de España";

frase[2] = "Seguridad como valor irrenunciable"

frase[3] = "Ahorro de costes";

frase[4] = "Prevención de daños";

frase[5] = "Cuatro niveles de Visado";

function inicia_rolltext()
{
	picker[0] = setInterval("cambia_texto()",5000);
	document.getElementById('texto_rotatorio').innerHTML = frase[0];
}

function para_rolltext()
{
	clearInterval(picker[0]);
}


function cambia_texto()
{
	if(textoActual + 1 > 5) textoActual = 0;
	else textoActual++;
	
	document.getElementById('texto_rotatorio').innerHTML = frase[textoActual];
}

//--------------------------------------------------------------------------------------------------------------------------------------------

//------------------ANIMACIÓN BANNER----------------------------------------------------------------------------------------------------------

var banner_img = new Array(3);
var banner_url = new Array(3);
var i;

banner_img[2] = "img/banner_1.gif";
banner_img[1] = "img/banner_2.gif";
banner_img[0] = "img/banner_3.gif";
banner_url[2] = "descarga-de-documentos-y-enlaces.php";
banner_url[1] = "informacion-a-los-medios-de-comunicacion.php";
banner_url[0] = "presentacion-campana.php";

function inicia_banner()
{
	i = 0;
	picker[1] = setInterval("cambia_banner1()",3000);
	estado = false;
}

function cambia_banner1(){
		
	document.getElementById('banner1').src = banner_img[i];
	document.getElementById('banner11').href = banner_url[i];

	if(i == 2) i = 0;
	else i++;
}

function para_banner1()
{
	clearInterval(picker[1]);
}

//------------------FUNCION DE ANIMACION LOGOS-------------------------------------------------------------------------------------------

var px;


function move_item(elemento, posx, posy)
{
	obj = document.getElementById(elemento);
	obj.style.top = posy+"px";
	obj.style.left = posx+"px";
}

function desplaza()
{
	img_wd = 1390 //tamaño de la imagen
	
	if(px == (img_wd * -1) ) px = 0;
	
	move_item('escudos', px,0);
	px--;
}

function inicia_desplaza()
{
	px = 0;
	picker[2] = setInterval("desplaza()",30);	
}

//------------------FIN FUNCION DE ANIMACION LOGOS---------------------------------------------------------------------------------------

//------------------TITULO CAMBIO RECURRENTE-----------------------------------------------------------------------------------------------

var textoActual2 = 1;

var frase2 = new Array(6);

frase2[0] = "El 74% de los espa&ntilde;oles opina que eliminar la obligatoriedad de visar los trabajos y proyectos de ingenier&iacute;a perjudicaría a su seguridad y calidad";

frase2[1] = "El 85% de la poblaci&oacute;n preferir&iacute;a que una obra importante, en su casa o edificio, estuviese visada por el Colegio de Ingenieros correspondiente";

frase2[2] = "Nueve de cada diez espa&ntilde;oles afirman que el sistema de colegiaci&oacute;n obligatoria para los ingenieros debe mantenerse"

frase2[3] = "El 92% de la poblaci&oacute;n opina que los Colegios de Ingenier&iacute;a deberían visar todos los trabajos t&eacute;cnicos en el &aacute;mbito de sus actuaciones";

frase2[4] = "Ingenierías y Arquitecturas por una sociedad m&aacute;s segura";

frase2[5] = "M&aacute;s de diez mil ingenieros y arquitectos de toda Espa&ntilde;a se han concentrado ante Econom&iacute;a en defensa del servicio colegial de visado como garant&iacute;a de la integridad f&iacute;sica y seguridad de las personas";

function inicia_rolltext2()
{
	picker[3] = setInterval("cambia_texto2()",5000);
	document.getElementById('texto_rotatorio2').innerHTML = frase2[0];
}

function para_rolltext2()
{
	clearInterval(picker[3]);
}


function cambia_texto2()
{
	if(textoActual2 + 1 > 5) textoActual2 = 0;
	else textoActual2++;
	
	document.getElementById('texto_rotatorio2').innerHTML = frase2[textoActual2];
}

//--------------------------------------------------------------------------------------------------------------------------------------------

//------------------FUNCION DE INICIALIZACION GENERAL-------------------------------------------------------------------------------------------

function inicializa()
{
	if(document.getElementById('escudos') != null) inicia_desplaza();
	if(document.getElementById('banner1') != null)	inicia_banner();
	if(document.getElementById('texto_rotatorio') != null)inicia_rolltext();
	if(document.getElementById('texto_rotatorio2') != null)inicia_rolltext2();

}

//------------------FIN FUNCION DE INICIALIZACION GENERAL---------------------------------------------------------------------------------------


