/*------------------------------------------------------------------*/
/*     Rutinas para el funcionamiento de la site CarpasElPilar.com  */
/*                   realizadas por Agustin Garcia                  */
/*------------------------------------------------------------------*/


/*          js que se cargan al inicio                              */

function OnloadJS(){
  AjusteCentro(); /* seguridad para ajuste central con pantalla < 1024 px */

}




/*          js para ajustar el centrado de la site                  */

var nc = (document.layers) ? true:false;
var ie =   (document.all) ? true:false;
var n6 = (document.getElementById) ? true:false;

function AjusteCentro() {
var id = 'container'; /* nombre de la capa */

  if(screen.width <= 800){
    if(ie){
      document.all[id].style.top = '0px';
      document.all[id].style.left = '0px';
      document.all[id].style.marginTop = '0px';
      document.all[id].style.marginLeft = '0px';
    }
    else if(nc){
      document.principal.document.fondo.document.layers[id].marginTop = '0px';
      document.principal.document.fondo.document.layers[id].marginLeft = '0px';
      document.principal.document.fondo.document.layers[id].top = '0px';
      document.principal.document.fondo.document.layers[id].left = '0px';
    }
    else if(n6){
      document.getElementById(id).style.marginTop = '0px';
      document.getElementById(id).style.marginLeft = '0px';
      document.getElementById(id).style.top = '0px';
      document.getElementById(id).style.left = '0px';
    }
  }
}


/* para mover la foto del menu de la galeria */

function muevefoto(cuanto){

var mi_div = document.getElementById('imagenmenugaleria');
var movimiento = cuanto * 234;
mi_div.style.backgroundPosition = '0px -' + movimiento + 'px';
}

/* Image Preload:
 * Usage:  js_preload( [ "test1.ext", "test2.ext", "test3.ext" ] );
 */

function js_preload( files )
{
        var img = new Image;

        for( var i = 0; i != files.length; ++ i ) {
                img.src = files[ i ];
        }
}

function EfectoDom(anchor){

	for (var i = 1; i< 6; i++){
		
		$('infoa'+ i).style.backgroundColor = 'transparent';

	}

	$(anchor).style.backgroundColor = '#DBEBF6';





}