$(function(){
	window.defaultStatus="Design + Programming by FEINHEIT kreativ studio · www.feinheit.ch";
	$('form input').each(function(index) {
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	});
	$('form input').fieldtag();
    
    $("a.fancybox").fancybox();
	
	$(".scrollable").scrollable({
		circular: true
	});
	
	$('.gallery .image a').click(function(event) {
		event.preventDefault();
		
		$(this).parents('.gallery').find('.image').removeClass('selected');
		$(this).parent().addClass('selected');
		
		
		preview = $(this).parents('.gallery').siblings('.caption')
		caption = $(this).siblings('.caption').clone()
		
		$(preview).fadeOut('fast', function() {
			$(preview).replaceWith(caption).fadeIn('fast');
		})
		
	});
	
	$('.togglenext').next().hide();
	$('.togglenext.open').hide();
	$('.togglenext.open').next().show();
	$('.togglenext').click(function() {
		$(this).next().slideDown();
		$(this).slideUp();
	})
    $('.toggleprev').click(function() {
        $(this).parent().slideUp();
        $(this).parent().prev().slideDown();
    });
    
    $('#id_country>option').tsort();
});

