$(document).ready(function() {
	var count = 0;
	var height = 0;
	$(".pics img").each(function() {
		count++;
		var img = this;
		if ($(img).hasClass("land")) {
			var div = document.createElement("div");
			//$(div).css("width", "100%");
			var src = $(img).attr("src");
			$(div).css("background", "transparent url(" + src + ") no-repeat center center");
			var ix = src.indexOf("/images/");
			$(img).attr("src", src.substring(0, ix + 8) + "slide-land-" + ((count % 2) ? "ccw" : "cw")+ ".png");
			$(div).insertAfter(img);
			$(div).append(img);
			height = Math.max(height, div.scrollHeight);
			img = div;
		}
		if (count > 1) {
			$(img).hide();
		}
	});

	count = 0;
	$(".quotes div").each(function() {
		count++;
		if (count > 1) {
			$(this).hide();
		}
	});
});

$(window).load(function() {
	$(".pics").shuffle(); 
	$(".quotes").cycle({ 
	    fx: 'fade',
	    timeout: 7000,
	    speed: 500,
	    delay: 3000,
	    pause: 1
	});
});
