$(document).ready(function(){                   
    $('.fade').innerfade({    // áttűnés
        speed: 2000,
        timeout: 6000,
        type: 'sequence',
        containerheight: '100px'
    });

    $('#altaji').hover(function() {
	    feheredes('.altaji a');
	    }, function() {
	    zoldul('.altaji a');
    });
                    
    $('#balti-szlav').hover(function() {
    	feheredes('.balti-szlav a');
    }, function() {
    	zoldul('.balti-szlav a');
    });

    $('#german').hover(function() {
    	feheredes('.german a');
    }, function() {
    	zoldul('.german a');
    });
    
    $('#latin').hover(function() {
    	feheredes('.latin a');
    }, function() {
    	zoldul('.latin a');
    });

    $('#egyeb').hover(function() {
    	feheredes('.egyeb a');
    }, function() {
    	zoldul('.egyeb a');
    });


    $('.nyelv a').hover(function() {
    	$(this).css ('color', '#fff');}, function() {
    		$(this).css ('color', '#17320d');    
    });

    $('.nyelvcsalad').hover(function() {
    	$('.nyelv a').css('color', '#17320d');
    	$(this).addClass('nyelvcsalad-hover');
    }, function() {
    	$(this).removeClass('nyelvcsalad-hover');
    });
    
    function feheredes(ezt) {
    	var sebesseg = 5;
   	    $(ezt).animate({marginTop: "0px"}, sebesseg, function() {
   			$(ezt).css('color', '#fff');
	    });

	}
	function zoldul(ezt) {
    	$(ezt).animate({marginTop: "0px"}, 300, function() {
   			$(ezt).css('color', '#17320d');
	    });
	}
	
	$('.nyelv').hover(function() {
		var tcsalad = $(this).attr('class');
		var hossz = tcsalad.length;
		var csalad = "#" + tcsalad.substr(6,hossz-6);
		$(csalad).addClass('nyelvcsalad-hover');
	}, function() {
		var tcsalad = $(this).attr('class');
		var hossz = tcsalad.length;
		var csalad = "#" + tcsalad.substr(6,hossz-6);
    	$(csalad).removeClass('nyelvcsalad-hover');
	})
});                 