/* - CUFON - */

Cufon.replace("div#header div#menu ul li a.cufon", {

	fontFamily : "Titillium",
	hover: true,
	hoverables: {a: true}

});

Cufon.replace("div.drei div.left ul.big li a", {

	fontFamily : "Titillium",
	hover: true,
	hoverables: {a: true}

});

Cufon.replace("div#header h1", {fontFamily : "Dekar"});

/*- jQUERY - */

$(document).ready(function(){

	/*- TABS - */
	
	var tabContainers = $('div.tabs > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.tabs ul.tabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.tabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();

});

function slideSwitch() {
    var $active = $('#slideshow img.active');
    if ($active.length == 0) $active = $('#slideshow img:last');
    var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
	.addClass('active')
	.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}

$(function() {
    setInterval( "slideSwitch()", 3000 );
});
