$(document).ready(function() {
	triggerFirst();
	$(".article-entry:not('.active')").live('mouseover',function(){
		$(this).css("background-color","#EFF1D5");
	}).live('mouseout',function(){
		$(this).css("background-color","transparent");
	}).live('mousedown',function(){
		$(this).css("background-color","transparent");
	});
	//$(".article-entry:not('.active') a").live('mouseout',function(){
	//	$(this).parent().css("background-color","#transparent");
	//});
	/*$(".article-entry:not('.active')").hover(
		function() {
			$(this).css("background-color","#EFF1D5");
		},
		function() {
			$(this).css("background-color","transparent");
		}
	);*/
	$(".article-entry a").click(function() {
		var hre = $(this).siblings(".hiddenvars").text();
		
		$("#articleBody").load(
			"articleajax.html",
			{"aid":hre}
		);
		$(".active").removeClass("active");
		$(this).parent().addClass("active");
		return false;
	});
	
});

function triggerFirst() {
	//Make the first item active
	var firstentry = $(".article-entry").eq(0);
	firstentry.addClass('active');
	
	hre = firstentry.children("span.hiddenvars").text();
	$("#articleBody").load(
		"articleajax.html",
		{"aid":hre}
	);
	//var article = firstentry.children(".resource-entry-article").html();
	//firstentry.children(".resource-entry-article").hide();
	//$("#article-entry").html(article);
}