// JavaScript Document
function get_random(max_value)
{
    var ranNum= Math.floor(Math.random()*max_value);
    return ranNum;
}
function intercambiar_imagenes(imagenes,destino,counter){
	var cuantasImagenes = imagenes.length ;
	var imagen;
	if (counter == 0) {
		imagen = get_random(cuantasImagenes)
	} else {
		if (counter == cuantasImagenes) {
			counter = 0;
		} else {
			counter + 1;
		}
		imagen = counter;
	}
	alt = imagenes[imagen][0];
	src = imagenes[imagen][1];
	
	imagen = document.getElementById(destino);
	imagen.setAttribute("src", src);
	imagen.setAttribute("alt", alt);
	imagen.setAttribute("title", alt);
	
	//alert("Bienvenido:"+counter+" - "+cuantasImagenes);
}
function css_bkgimg_switch(imagen,destino) 
{
	elemento = document.getElementById(destino);
	elemento.style.backgroundImage = 'url('+imagen+')';
}