jQuery(document).ready(function($)

{


$("#galerie_laubbaum_container").jCarouselLite({auto: 4500,  speed: 600, visible: 4, mouseWheel: true});
$("#galerie_nadelbaum_container").jCarouselLite({auto: 4500,  speed: 600, visible: 4, mouseWheel: true});
$("#galerie_wacholder_container").jCarouselLite({auto: 4500,  speed: 600, visible: 4, mouseWheel: true});
$("#galerie_gestaltungen_container").jCarouselLite({auto: 4500,  speed: 600, visible: 4, mouseWheel: true});



$(".galerie_image").fancybox({'zoomSpeedIn': 800, 'zoomSpeedOut': 300, 'overlayShow': true, 'overlayOpacity': .8} );

$("#galerie_navigation > span").click(function()
{
    $("#galerie_navigation > span").removeClass("active");
    $(this).addClass("active");
    var linkId = $(this).attr("id");
   
    $(".galcon").fadeOut(1000);
    $("#galerie_"+linkId+"_container").fadeIn(1000);
})




$('#box_top_navigation_workshop').click(function()
{
    $('.wysiwyg').remove();
    $('#wysiwyg_container').remove();
    $('#speichern').hide();

    $('.boxlink').css({'font-weight': 'normal'});
    $('#admin_box_middle_text').append('<textarea id="wysiwyg_container"></textarea>');

    $('#box_top_navigation_workshop').css({'font-weight': 'bold'});
    
    $.ajax(
    {
	url: "fileservice.php?file=workshop.txt",
	success: function(data)
	{
	    $('#wysiwyg_container').val(data);
	    $('#wysiwyg_container').wysiwyg({css: "../styles/editorstyle.css"});
	}
    });
    writefile = "workshop.txt";
    $('#speichern').show();
});

$('#box_top_navigation_aktuelles').click(function()
{
    $('.wysiwyg').remove();
    $('#wysiwyg_container').remove();
    $('#speichern').hide();

    $('.boxlink').css({'font-weight': 'normal'});
    $('#admin_box_middle_text').append('<textarea id="wysiwyg_container"></textarea>');
    
    $('#box_top_navigation_aktuelles').css({'font-weight': 'bold'});

    $.ajax(
    {
	url: "fileservice.php?file=aktuelles.txt",
	success: function(data)
	{
	    $('#wysiwyg_container').val(data);
	    $('#wysiwyg_container').wysiwyg({css: "../styles/editorstyle.css"});
	}
    });
    writefile = "aktuelles.txt";
    $('#speichern').show();
});

$('#speichern').click(function()
{
    text = $('#wysiwyg_container').val();
    $.ajax(
    {
	type: 'POST',
	url: "fileservice.php?writefile="+writefile,
	data: "data="+text+"",
	dataType: 'html'
	});


    //alert($('#wysiwyg_container').val());
    $('.wysiwyg').remove();
    $('#wysiwyg_container').remove();
    $('#speichern').hide();
    
    $('.boxlink').css({'font-weight': 'normal'});
    $('#admin_box_middle_text').append('<textarea id="wysiwyg_container"></textarea>');
});


});




