$(document).ready(function() {
/*
	$(".box .img-link").click(function(){
		$(this).children(".top").children(".bottom").children(".box_content").slideDown();
		
		$(this).children(".top").children(".bottom").children(".box_content").slideUp();
	});*/

	$(".box .img-link").click(function(){
		var box = $(this).attr("alt");
		if ($("."+box).css("display")=="none") {
			$(".box_content").slideUp();
			$("."+box).slideDown();
		} else {
			$("."+box).slideUp();
		}
	});
	
	
	
	$(element).eq(i).css({display:"block"});
	actNextNews = setTimeout(nextNews,time);
	
	
});

//Define Global vars for nextNews
i = 0;
time = 5000;
element = '#slide .rotation';
var actNextNews;
//End Define Global vars for nextNews


function nextNews()
{
    var amount = jQuery(element).length;
    if(amount > i+1)//amount > that number order (i+1) of .content
							{
	jQuery(element).eq(i).fadeOut(1000);
                                    jQuery(element).eq(i+1).fadeIn("1000");
									i++;
	clearTimeout(actNextNews);
							}
							else
							{
	jQuery(element).eq(i).fadeOut(1000);
                                    jQuery(element).eq(0).fadeIn(1000);
									i = 0;
	clearTimeout(actNextNews);
	}
   if(time != 0) actNextNews = setTimeout(nextNews,time);
}





