$(document).ready(function(){
	$(".image_cycle").cycle({
							timeout: 5000,
							fx: 'fade',
							speed: 900,
							before:  onBefore, 
    						after:   onAfter
	});
	
	$(".link_more").click(function(){
		$(this).parent().parent().slideUp('slow');
		$(this).parent().parent().parent().children("div.hiddenTbl").slideDown('slow');
		return false;
	});

	$(".link_back").click(function(){
		$(this).parent().parent().slideUp('slow');
		$(this).parent().parent().parent().children("div.visibleTbl").slideDown('slow');
		return false;
	});
	
});

function onBefore() { 
     $(this).children("div[@class=image_title]").fadeOut("slow");
}; 
function onAfter() {
	$(this).children("div[@class=image_title]").fadeIn("slow"); 
     
};

function home_loaded(){
	var elements = new Array(4);
	elements[0] = "#box1";
	elements[1] = "#box2";
	elements[2] = "#box3";
	elements[3] = "#box4";
	$.balanceElementHeight(elements);
};

function links_loaded(){
	$("#container_links").balanceChildrenHeight();
};
