window.onload=iniciar;

function iniciar() {
var i;
var imagenes = new Array("1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","b0-calidad.jpg","b0-contacto.png","b0-empleo.png","b0-empresa.png","b0-idi-english.png","b0-idi-espanol.png","b0-maq-gha-capacidad-carga.png","b0-maq-gha-por-alcance.png","b0-maq-gruas-celosia.png","b0-maq-gruas-hidraulica.png","b0-maq-gruas-telescopicas.png","b0-maq-gt-altura-max.png","b0-maq-gt-capacidad-max.png","b0-maq-pepa-altura-trabajo.png","b0-maq-pepa-capacidad-cesta.png","b0-maq-plataformas-elevadoras.png","b0-maq-tetp-capacidad-carga.png","b0-maq-tetp-longitud-max.png","b0-maq-transportes-especiales.png","b0-maquinaria.png","b0-mpe-carretillas-elevadoras.png","b0-mpe-manipulador-telescopico.png","b0-mpe-plataformas-articuladas.png","b0-mpe-plataformas-de-tijera.png","b0-mpe-plataformas-telescopicas.png","b0-mte-tranportes-combinado.png","b0-mte-tranportes-dolly.png","b0-mte-tranportes-gondola.png","b0-mte-tranportes-plataforma.png","b0-noticias.png","b0-proyectos.png","b0-s-alquiler-maquinaria.png","b0-s-ingenieria-montajes.png","b0-s-rigar-montajes.png","b0-servicios.png","b1-calidad.png","b1-contacto.png","b1-empleo.png","b1-empresa.png","b1-idi-english.png","b1-idi-espanol.png","b1-maq-gha-capacidad-carga.png","b1-maq-gha-por-alcance.png","b1-maq-gruas-celosia.png","b1-maq-gruas-hidraulica.png","b1-maq-gruas-telescopicas.png","b1-maq-gt-altura-max.png","b1-maq-gt-capacidad-max.png","b1-maq-pepa-altura-trabajo.png","b1-maq-pepa-capacidad-cesta.png","b1-maq-plataformas-elevadoras.png","b1-maq-tetp-capacidad-carga.png","b1-maq-tetp-longitud-max.png","b1-maq-transportes-especiales.png","b1-maquinaria.png","b1-mpe-carretillas-elevadoras.png","b1-mpe-manipulador-telescopico.png","b1-mpe-plataformas-articuladas.png","b1-mpe-plataformas-de-tijera.png","b1-mpe-plataformas-telescopicas.png","b1-mte-tranportes-combinado.png","b1-mte-tranportes-dolly.png","b1-mte-tranportes-gondola.png","b1-mte-tranportes-plataforma.png","b1-noticias.png","b1-proyectos.png","b1-s-alquiler-maquinaria.png","b1-s-ingenieria-montajes.png","b1-s-rigar-montajes.png","b1-servicios.png","bg-11x397.png","bg-14x16.png","bg-566x9.png","bg-80x15.png","bg-calidad.jpg","bg-empleo.jpg","bg-empresa.jpg","bg-ficha-tecnica-descargar.png","bg-servicios.jpg","bg-tit-contacto.png","bg-tit-maquinaria.png","bg-tit-noticias.png","bg-tit-proyectos.png","bg-tit-servicios.png","bg0-243x11.png","bg1-243x11.png","bg1-maquinaria.jpg","bg2-maquinaria.jpg","calidad-img01.jpg","calidad-img02.jpg","calidad-img03.jpg","close.png","contacto-img01.jpg","contacto-img02.jpg","contacto-img03.jpg","contacto-img04.jpg","empleo-img01.jpg","empleo-img02.jpg","empleo-img03.jpg","empleo-img04.jpg","empresa-img01.jpg","empresa-img02.jpg","empresa-img03.jpg","empresa-img04.jpg","ico-der.png","ico-email.png","ico-flecha1.png","ico-flecha2.png","ico-home.png","ico-inf.png","ico-izq.png","ico-sup.png","ico-vineta.png","left.png","leftDisabled.png","linea-conte-15x390.png","linea-inf.png","linea-sup.png","loader.gif","logo-ingenieria.png","logo-rigar-gtepa.png","logo-rigar-montajes.png","logo-sgs.png","logotipo-82x82.png","mapa-contacto.png","maq-gruas-celosia-img-top.jpg","maq-gruas-hidraulica-img-top-.jpg","maq-gruas-telescopicas-img-top.jpg","maq-gruas-telescopicas-img01.jpg","maq-gruas-telescopicas-img02.jpg","maq-gruas-telescopicas-img03.jpg","maq-gruas-telescopicas-img04.jpg","maq-pe-articuladas-img-top-.jpg","maq-te-tplataforma-img-top-.jpg","maquinaria-img01.jpg","maquinaria-img02.jpg","maquinaria-img03.jpg","maquinaria-img04.jpg","noticias-img01.jpg","noticias-img02.jpg","noticias-img03.jpg","proyectos-img01.jpg","proyectos-img02.jpg","proyectos-img03.jpg","right.png","rightDisabled.png","servicios-img01-ingenieria.jpg","servicios-img01-montajes.jpg","servicios-img01.jpg","servicios-img02-ingenieria.jpg","servicios-img02-montajes.jpg","servicios-img02.jpg","servicios-img03-ingenieria.jpg","servicios-img03-montajes.jpg","servicios-img03.jpg","servicios-img04-montajes.jpg","servicios-img04.jpg","servicios-img05-montajes.jpg","tit-clasificacion.png");
var lista_imagenes = new Array();
for(i in imagenes){
     lista_imagenes = new Image();
     lista_imagenes.src = "images/"+imagenes;
	}
}

function mover(id, img) {
 document.getElementById(id).src="images/"+img;
}
function poner_texto_tel(tit,txt,img) {
 document.getElementById("grua_tit").innerHTML=tit;
 document.getElementById("grua_txt").innerHTML=txt;
 if(img!="") document.getElementById("img1").style.backgroundImage="url(images/maquinarias/gh_"+img+")";
}
function quitar_texto_tel(img) {
 document.getElementById("grua_tit").innerHTML="";
 document.getElementById("grua_txt").innerHTML="";
 document.getElementById("img1").style.backgroundImage="url(images/"+img+")";
}

function subiendo() {
if(detener_sube) { 
  posini-=1;
  document.getElementById("capa_img").style.marginTop=posini+"px";
  if((342-posini)>=document.getElementById("capa_img").scrollHeight) detener_sube=0;
  setTimeout("subiendo()",2);
 }
}
function bajando() {
if(detener_baja && posini<0 ) { 
  posini+=1;
  document.getElementById("capa_img").style.marginTop=posini+"px";
  setTimeout("bajando()",2);
 }
}
function subir_listado() {
detener_sube=1;
detener_baja=0;
var p=document.getElementById("capa_img").style.marginTop;
var px=p.split("px");
posini=(px[0]);
subiendo();
}
function bajar_listado() {
detener_sube=0;
detener_baja=1;
var p=document.getElementById("capa_img").style.marginTop;
var px=p.split("px");
posini=parseInt(px[0]);

bajando();
}
function detener_subiendo() {
 detener_sube=0;
}
function detener_bajando() {
 detener_baja=0;
}

function tsubiendo() {
if(detener_tsube) { 
  tposini-=1;
  document.getElementById("noticias_desc").style.marginTop=tposini+"px";
  if((160-tposini)>=document.getElementById("noticias_desc").scrollHeight) detener_tsube=0;
  setTimeout("tsubiendo()",2);
 }
}
function tbajando() {
if(detener_tbaja && tposini<0 ) { 
  tposini+=1;
  document.getElementById("noticias_desc").style.marginTop=tposini+"px";
  setTimeout("tbajando()",2);
 }
}

function mostrar_txtnoticia() {
if (document.getElementById('noticias_desc').scrollHeight > 165) {
	document.getElementById("fle_sup").style.visibility="visible";
	document.getElementById("fle_inf").style.visibility="visible";
}
}
function ver_imgnot(img) {
	document.getElementById("foto_noticia").innerHTML='<img src="images/proyectos/'+ img+'" border="0" width="214" height="201" />';

}
function subir_texto() {
detener_tsube=1;
detener_tbaja=0;
var p=document.getElementById("noticias_desc").style.marginTop;
var px=p.split("px");
tposini=(px[0]);
tsubiendo();
}
function bajar_texto() {
detener_tsube=0;
detener_tbaja=1;
var p=document.getElementById("noticias_desc").style.marginTop;
var px=p.split("px");
tposini=parseInt(px[0]);

tbajando();
}
function detener_tsubiendo() {
 detener_tsube=0;
}
function detener_tbajando() {
 detener_tbaja=0;
}
function izquierda() {
if(detener_izq) { 
  posinih-=2;
  document.getElementById("scroll_cont").style.marginLeft=posinih+"px";
  if((478-posinih)>=document.getElementById("scroll_cont").scrollWidth) detener_izq=0;
  setTimeout("izquierda()",2);
 }
}
function derecha() {
if(detener_der && posinih<0 ) { 
  posinih+=2;
  document.getElementById("scroll_cont").style.marginLeft=posinih+"px";
  setTimeout("derecha()",2);
 }
}
function mover_izquierda() {
detener_izq=1;
detener_der=0;
var p=document.getElementById("scroll_cont").style.marginLeft;
var px=p.split("px");
posinih=parseInt(px[0]);
izquierda();
}
function mover_derecha() {
detener_izq=0;
detener_der=1;
var p=document.getElementById("scroll_cont").style.marginLeft;
var px=p.split("px");
posinih=parseInt(px[0]);
derecha();
}
function detener_izquierda() {
 detener_izq=0;
}
function detener_derecha() {
 detener_der=0;
}



function avanza() {
if(posini>pos_scroll) { 
  posini-=20;
  document.getElementById("listado_cont").style.marginLeft=posini+"px"; 
  setTimeout("avanza()",2);
 }
 else {
  if (pag_actual==total_pag+1) { 
    document.getElementById("listado_cont").style.marginLeft=anchopx+"px"; 
    posini=anchopx; pos_scroll=0; pag_actual=1;
    avanza();
   }
 }
}

function ver_mas() {
if(pag_actual<=total_pag){
pag_actual++;
var p=document.getElementById("listado_cont").style.marginLeft;
var px=p.split("px");
posini=pos_scroll;
pos_scroll-=anchopx;
avanza();
}

}

