/**
 * we do on document load
 *
 * @since 12.11.2010
 *
 *
 *
 */
jQuery(document).ready(function($) {
    /**
    $(window).scroll(function() {
        $("#jakTop").css("top", $(window).scrollTop() + "px");
    });
    **/
    $( '#menu-item-73' ).css( 'background', 'url( /wp-content/themes/jak/images/contact_open.gif ) right center no-repeat' );
    $( '#menu-item-73' ).css( 'padding-right', '12px' );
    $( '#menu-item-73' ).click( function() { contactSlide(); return false; } );
    $( '#jakContactCancel' ).click( function() { contactSlide(); return false; } );

    var contactSlide = function() {

        if ( $( '#jakTopContact' ).css( 'display' ) == 'block' )
        {
            $( '#jakTopContact' ).slideUp( 'slow' );
            $( '#menu-item-73' ).css( 'background', 'url( /wp-content/themes/jak/images/contact_open.gif ) right center no-repeat' );
        }
        else
        {
            $( '#jakTopContact' ).slideDown( 'slow');
            $( '#menu-item-73' ).css( 'background', 'url( /wp-content/themes/jak/images/contact_close.gif ) right center no-repeat' );
        }
    }

    /**
     *
     *
     *
     * 
     */
    jQuery('#jakBody-13 #jakContentMain table span').click(function() { toogleLists( this ) });

    var toogleLists = function( obj ) {
        var list = $(obj).parent().parent().parent().parent().nextAll('*');

        if ( list )
        {
            if ( 'block' == jQuery(list).css( 'display' ) )
            {
                // jQuery(obj).css( 'background', 'url( ./wp-content/themes/jak/images/Dreieck.png ) 0px 5px no-repeat' );
                jQuery(list).slideUp('fast');
            }
            else
            {
                // jQuery(obj).css( 'background', 'url( ./wp-content/themes/jak/images/Dreieck.png ) 0px 5px no-repeat' );
                jQuery(list).slideDown('fast');
            }
        }
    }
});
