$().ready(function(){
	var show_next=3;
	$('#mag_carousel').jcarousel(
	{
		visible:1,
		scroll: 1
	});
	$("#mag_carousel .jcarousel-item a").hover(function(){
		$("#mag_carousel .jcarousel-item img").css("border","6px solid #aaa");
	},
	function(){
		$("#mag_carousel .jcarousel-item img").css("border","6px solid #ddd");
	}
	);
	$('#toon_carousel').jcarousel(
	{
		visible:1,
		scroll: 1,


        vertical: true

	});
	$("#toon_carousel .jcarousel-item a").hover(function(){
		$("#toon_carousel .jcarousel-item img").css("border","6px solid #aaa");
	},
	function(){
		$("#toon_carousel .jcarousel-item img").css("border","6px solid #ddd");
	}
	);

	function show_two_articles(from)
	{
		var next=from+1;
		$("#section_"+from+", #section_"+next).show();
	}
/*
	$("a.more").click(function()
	{
		show_two_articles(show_next);
		show_next+=2;
		return false;
	});
*/	
	$(".section").hide().filter("#section_1,#section_2").show();
	$.visible_testim=0;
	var all_testim=$("#testimonials li");
	var num_testim=all_testim.length;
	var max_height=0;
	all_testim.each(function(i,e) {if($(e).height()>max_height) max_height=$(e).height()});
	$("#testimonials").css("height",max_height+10);
	all_testim.hide().filter(":first").show();	

	interval = window.setInterval(function(){
		var show_num=($.visible_testim==num_testim-1)?0:$.visible_testim+1;
		var show=$(all_testim[show_num]);
		var hide=$(all_testim[$.visible_testim]);
		hide.fadeOut("slow",function(){ show.fadeIn("fast")});
		$.visible_testim=show_num;	
	}, 10000);


});

