function slideShow() {
	$('#gallery img').css({opacity: 0.0});
	$('#gallery img:first').css({opacity: 1.0});
	setInterval('gallery()',10000);
}

function gallery() {

	var current = ($('#gallery img.show')?  $('#gallery img.show') : $('#gallery img:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery img:first') :current.next()) : $('#gallery img:first'));		
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
}

$(document).ready(function(){
    slideShow();
    
    $('a.fancybox_galerie').fancybox({
        'titlePosition':'inside'
    });

    $('a.fancybox').fancybox();

    $('.fancybox_edit').fancybox({
        'width':735,
        'height':450,
        'autoScale':true,
        'transitionIn':'none',
        'transitionOut':'none',
        'type':'iframe',
        'padding': '0',
        'margin': '0'
    });

    $('a.email').each(function(){
            e = this.title.replace('[A]','@');
            var mail_array = e.split('[+]');
            var mail = mail_array.join('')
            this.href = 'mailto:' + mail;
            this.title = 'email';
            $(this).text(mail);
    });
});

(function($) {
	$(function() {
		$("#scroller").simplyScroll({
			autoMode: 'loop',
			pauseOnHover: true,
			frameRate: 20,
			speed: 1
		});
	});
})(jQuery);

$(function() {
    $('.hoverHelp').tipsy({
        gravity: 'w',
        html: true
    });
});

$(function() {
    $("#user").dialog({
     show: 'slide',
     width: 200,
     position: ['right','top']
    });
});

