$(function() {
function randsort(c) {
	var o = new Array();
	for (var i = 0; i < c; i++) {
		var n = Math.floor(Math.random()*c);
		if( jQuery.inArray(n, o) > 0 ) --i;
		else o.push(n);
	}
	return o;
}
function propersort(c) {
	var o = new Array();
	for (var i = 0; i < c; i++) {
		var n = i;
		if( jQuery.inArray(n, o) > 0 ) --i;
		else o.push(n);
	}
	return o;
}

var e = $('ul.fader li');
var c = e.size();
var r = randsort(c);

$("ul.fader li").each(function(i) {
	var e = $(this);
	//e.fadeTo(0, 0.05);
	setTimeout(function(){	e.fadeTo(400, 1);}, r[i]*50);
	//setTimeout(function(){	e.fadeTo(250, 1);}, r[i]*50);
});


	//$("ul.fader > li").fadeTo(2000,0.2);
	//$(".products").fadeTo("fast", 0.4); // This sets the opacity of the thumbs to fade down to 0% when the page loads
	$("ul.fader li").hover(function(){
			$(this).find('a').fadeTo("fast", 0.2); // This should set the opacity to 100% on hover
			$(this).find('h1').addClass(".open").show();
		},function(){
			$(this).find('a').fadeTo("normal", 1); // This should set the opacity back to 0% on mouseout
			$(this).find('h1').removeClass(".open").hide();
		//$(".thumbnail").removeClass("thumbnailbg").show(); // This should make the thumbnail show always
	});


});
