$(function() {
	// Options for SuperBGImage
	$.fn.superbgimage.options = {
		id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: 1, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 1, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 1, // 0-none, 1-autostart slideshow
		slide_interval: 7000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 'slow', // animation speed
		preload: 1, // 0-none, 1-preload images
	};

	// initialize SuperBGImage
	$('#thumbs1').superbgimage();
});

$(document).ready(function() {
    $("#toggle").click(function () {
        if($("#inhalthome").is(":visible")) {
	    $("#toggle").html('<img src="fileadmin/site/wohnunion/images/home_trigger.png" alt="" />');
	    $("#toggle").removeClass("opened").addClass("closed");	
            
            $("#inhalthome").hide("fast", function () {
                // use callee so don't have to name the function
                //$(this).prev().hide("fast", arguments.callee); 
            });
        } else {
            $("#toggle").html('<img src="fileadmin/site/wohnunion/images/home_trigger2.png" alt="" />');
	    $("#toggle").removeClass("closed").addClass("opened");	

            $("#inhalthome").show("fast", function () {
                // use callee so don't have to name the function
                //$(this).prev().show("fast", arguments.callee); 
            });
        }

        //prevent the browser to follow the link
        return false;
    });

    $("#toggle2").click(function () {
        if($("#inhalt").is(":visible")) {
            $("#inhalt").hide("fast", function () {
                // use callee so don't have to name the function
                $(this).prev().hide("fast", arguments.callee); 
            });
            
            $("#toggle2").html('<img src="fileadmin/site/wohnunion/images/einblenden.png" alt="" />');
	    $("#toggle2").removeClass("opened").addClass("closed");	
        } else {
            $("#inhalt").show("fast", function () {
                // use callee so don't have to name the function
                $(this).prev().show("fast", arguments.callee); 
            });
            
            $("#toggle2").html('<img src="fileadmin/site/wohnunion/images/ausblenden.png" alt="" />');
	    $("#toggle2").removeClass("closed").addClass("opened");	
        }

        //prevent the browser to follow the link
        return false;
    });
    
    $(".show").click(function () {
        $("#inhalt").show("fast");

        //prevent the browser to follow the link
        return false;
    });

    $("a.gallery_image").click(function() {
    	var url = this.href;
	var style = 'background:url(' + url + ') top left no-repeat';
	    
        //$('#wrapper').attr('style', style);
        
        $('#thumbs2').stopSlideShow();
	$('#thumbs2').superbgShowImage($(this).attr('rel'));   

	//prevent the browser to follow the link
        return false;
    });

    $('#slider1').bxSlider({
        pager: true,
        pagerSelector: '#my-pager',
        pagerType: 'short',
        nextSelector: '#next',
        prevSelector: '#prev',
        pagerShortSeparator: '<span>von</span>'
    });
    
    $('.scroll-pane').jScrollPane({showArrows: true,hideFocus:true});
    
});
// JavaScript Document

