// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------
// random code;
// depends: 	jQuery library;
// author:		ah;
// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------


function random(el) {
	var root_el = el;
	var noImages = $(root_el).find('img').length;
	var randomInt = Math.random();
	var imageIndex = Math.ceil(noImages * randomInt);

	$(root_el).find('img:nth-child('+ imageIndex +')').removeClass('hide');
}


$(document).ready(function() {
	$('#random').each(function() {random(this);});
});

// --------------------------------------------------------------------------------------------------------------------------------
// --- end of file --- 
// -------------------------------------------------------------------------------------------------------------------------------

