function PAGEhome_bgChanger(count, i) {
	if(count > 0) {
		$("#PAGEhome > .bg:eq(1)").css( {
			backgroundImage: "url(pages/home/images/bg/" + i + ".jpg)"
		});
		setTimeout(function() {
			if(++i > count) {
				i = 1;
			}
			$("#PAGEhome > .bg:eq(0)").css( {
				backgroundImage: "url(pages/home/images/bg/" + i + ".jpg)"
			});
			$("#PAGEhome > .bg:eq(1)").fadeOut(1000, function() {
				if(++i > count) {
					i = 1;
				}
				setTimeout(function() {
					$("#PAGEhome > .bg:eq(1)").css( {
						backgroundImage: "url(pages/home/images/bg/" + i + ".jpg)"
					});
					$("#PAGEhome > .bg:eq(1)").fadeIn(1000, function() {
						PAGEhome_bgChanger(count, i);
					});
				}, 3000);
			});
		}, 3000);
	}
}

$(document).ready(function() {
	$("#PAGEhome > .quicklinks a:eq(1)").click(function(event) {
		event.preventDefault();
		$("#body > ul a:eq(1)").trigger("click");
	});
	$("#PAGEhome > .quicklinks a:eq(2)").click(function(event) {
		event.preventDefault();
		$("#body > ul a:eq(2)").trigger("click");
	});
	$("#PAGEhome").append("<script type=\"text/javascript\" src=\"http://twitter.com/statuses/user_timeline/hesedel.json?callback=PAGEhome_Twitter&amp;count=5\"></script>");
});