$(document).ready(function() {
  $("img").lazyload({
    threshold : 200,
	placeholder : "/img/cargando.gif",
    effect : "fadeIn"  
  });
});


function chachiCaptions(){// No me digáis que no es más divertido poner nombres graciosos a las funciones...

	var images = document.getElementsByTagName('img');
	for (var j=0; j<images.length; j++){
		var image = images [j];
		if ( image.getAttribute("class") == "caption"){		
			var alt = image.getAttribute('alt');
			var newcode = document.createElement('span');
			newcode.appendChild(document.createTextNode(alt));
			image.parentNode.appendChild(newcode);
			image.alt="";
			//image.removeAttribute('alt');
		}
	}

}
window.onload = chachiCaptions;
