/*-- IE6nomore --*/

    $.IE6nomore = function(){
        if(!$('#ie6nomore').length)
            return;
        $('#ie6nomore').css({
            'left': 0,
            'top': 0,
            'bottom': 0,
            'right': 0,
            'position': 'absolute',
            'z-index': 9999
        });
    };

/*-- Swap image --*/

    function swapImage(element, newimage){
        var oldsrc = element.src;
        element.src = newimage;
        if (!element.onmouseout){
            element.onmouseout = function(){
                swapImage(this, oldsrc);
            }
        }
    }

/*-- Spam protection --*/

    function getAdr(prefix, postfix, text){
        document.write('<a href="mailto:' + prefix + '@' + postfix + '">' + (text ? text.replace(/&quot;/g, '"').replace(/%EMAIL%/, prefix + '@' + postfix) : prefix + '@' + postfix) + '</a>');
    }



/*-- Clickable parent element from a link --*/

    (function($){
        $.fn.clickable = function(){
            return this.each(function(){
                var el = this;
                if(!$('.click', el).length)
                    return;
                $(el).data('clickable_uri', $('.click', el).attr('href'));
                $(el).css('cursor', 'pointer');
                $(el).click(function(){
                    window.location = $(this).data('clickable_uri');
                })
            });
        }
    })(jQuery);



/*-- Iframe popup --*/

    (function($){
        $.fn.IframePopup = function(options){
            if(!$(this).length)
                return;

            // Settings
            var IP_Settings = {
                margin: 20, // Margin from the iframe popup
                width: 700, // Default popup width
                height: 500 // Default popup height
            };
            var IP_Settings = $.extend(IP_Settings, options);

            // Create iframe popup
            createIframePopup();
            // Open iframe popup
            $(this).click(function(){
                // Hide scrollbar and fadein overlay
                $('body, html').css('overflow', 'hidden');
                $(ip_overlay).fadeTo('slow', 0.8);
                // Set tabindex="-1" to content
                $('a, input, textarea, select, button').not('.close').each(function(){
                    $(this).addClass('tabindex').attr('tabindex', '-1');
                });
                // Get popup size from rel attribut
                var popupHeight = this.rel.split(',')[1];
                var popupWidth = this.rel.split(',')[0];
                if(popupWidth == null || popupHeight == null){
                    popupWidth = IP_Settings.width;
                    popupHeight = IP_Settings.height;
                }
                // Set popup size
                var NormalCSS = {
                    'bottom': 'auto',
                    'height': popupHeight+'px',
                    'left': '50%',
                    'margin-left' : Math.floor(-(popupWidth)/2)+'px',
                    'margin-top': Math.floor(-(popupHeight)/2)+'px',
                    'max-height': popupHeight+'px',
                    'top': '50%',
                    'width' : popupWidth+'px'
                };
                var FlexibleCSS = {
                    'bottom': IP_Settings.margin+'px',
                    'height': 'auto',
                    'margin-top': 0,
                    'top': IP_Settings.margin+'px'
                };
                // Normal iframe popup size
                $(ip_popup).css(NormalCSS).show();
                // Flexible iframe popup size
                $(window).resize(function(){
                    ($(this).height() <= ($(ip_popup).outerHeight()+2*IP_Settings.margin)) ? $(ip_popup).css(FlexibleCSS) : $(ip_popup).css(NormalCSS);
                });
                ($(window).height() <= ($(ip_popup).outerHeight()+2*IP_Settings.margin)) ? $(ip_popup).css(FlexibleCSS) : $(ip_popup).css(NormalCSS);
                // Insert iframe title
                $(ip_title).html(this.title);
                // Insert iframe content
                $(ip_popup).addClass('ip_loading');
                $(ip_iframe).attr('src', this); 
                // Preloader
                $(ip_iframe).css('visibility', 'hidden');
                $(ip_iframe).load(function(){
                    $(ip_popup).removeClass('ip_loading');
                    $(ip_iframe).css('visibility', 'visible');
                });
                $(document).bind('keydown', keyDown);
                return false;
            });

            // Close popup
            function closeIframePopup(){
                $('body').css('overflow', bodyOverflow);
                $('html').css('overflow', htmlOverflow);
                $(ip_popup).hide();
                $(ip_overlay).fadeOut('slow');
                $(window).unbind('resize');
                // Remove tabindex="-1"
                $('.tabindex').each(function(){
                    $(this).removeClass('tabindex').removeAttr('tabindex');
                });
            }

            // Keyboard events
            function keyDown(event){
                var code = event.keyCode;
                return ($.inArray(code, [27,88,67]) >= 0) ? closeIframePopup() : true;
            }

            // Create iframe popup
            function createIframePopup(){
                $('body').append(
                    ip_overlay = $('<div>').attr({ 'class': 'ip_overlay' }).hide().click(closeIframePopup),
                    ip_popup = $('<div class>').attr({ 'class': 'ip_popup' }).append(
                        ip_close = $('<a>').attr({ 'class': 'close', href: '#', title: close+' [ESC]' }).text(close).click(closeIframePopup),
                        ip_title = $('<h2>').attr({ 'class': 'title' }),
                        $('<div>').attr({ 'class': 'ip_content' }).append(
                            ip_iframe = $('<iframe>').attr({ 'src': '', 'frameborder': '0' })
                        )
                    ).hide()
                );
                $([
                    bodyOverflow = $('body').css('overflow'),
                    htmlOverflow = $('html').css('overflow')
                ])
            }
        };
    })(jQuery);


/*-- Forms --*/

    (function($){
        $.fn.forms = function(options){
            if(!this.length) return;

            var settings = $.extend({
                'summarypage': true,
                'multipage': true,
                'progress_steps': true,
                'error_value': false,
                'infobox': '.info',
                'scrolltop': '#content'
            }, options);

            return this.each(function(){
                var form = this;
                if(settings.error_value)
                    $(form).attr('autocomplete', 'off'); 
                // Multiple inputs
                $.fn.forms.multiInput(form);
                // Multipage
                $.fn.forms.multipage(settings, form);
                // Update contactinfo
                $.fn.forms.updateReceiver(form);
                // Error in value
                $.fn.forms.valueErrorMsg(settings, form);
                // Dependence
                $.fn.forms.dependence(settings, form);
                // Live validation on blur
                $.fn.forms.validcheck(settings, form, 'live');
                // Validate on submit
                $(form).submit(function(){
                    setTimeout(function(){ $('.error :input:enabled:first', form).focus(); }, 300);
                    var valid = $.fn.forms.validcheck(settings, form);
                    if(valid) $.fn.forms.confirm(form, settings);

                    return false;
                });
            });
        }

        // validate form
        $.fn.forms.valid = function(settings, el, check){
            var valid = true,
                error_msg = '';
            switch(el.type){
                case 'radio':
                    // radio validation
                    valid = false;
                    error_msg = 'Treffen Sie mindestens eine Auswahl!';
                    $('input[name='+el.name+']').each(function(){
                        if($(this).is(':checked')){
                            error_msg = '';
                            valid = true;
                        }
                    });
                    break;
                case 'checkbox':
                    // checkbox validation
                    var siblings = $(el).siblings('.group').andSelf();
                    if(siblings.length > 1){
                        $(el).parents('.entry').find('.group:last').addClass('last');
                        if (check == 'live' && $(el).hasClass('last') ||
                            check == 'live' && !$(el).hasClass('last') && $(el).parents('.entry').hasClass('error') || 
                            check != 'live'){
                            if(!$(siblings).is(':checked')){
                                error_msg = error_msg_checkbox;
                                valid = false;
                            }
                        }
                    }
                    else{
                        if(!$(el).is(':checked')){
                            error_msg = error_msg_checkbox;
                            valid = false;
                        }
                    }
                    break;
                default:
                    // normal validation
                    if(el.value == '' || el.value == error_msg_default){
                        error_msg = error_msg_default;
                        valid = false;
                    }
                    // e-mail validation
                    else if($(el).hasClass('email')){
                        var regExp = /^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
                        if(!el.value.match(regExp)){
                            error_msg = error_msg_email;
                            valid = false;
                        }
                    }
                    // number validation
                    else if($(el).hasClass('number')){
                        if(el.value != Math.round(el.value)){
                            error_msg = error_msg_number;
                            valid = false;
                        }
                    }
            }
            // error message
            if(valid){
                $('.error_msg', $(el).parents('.entry')).remove();
                $(el).parents('.entry').removeClass('error');
            }
            else {
                // custom error message
                if(custom_required_text[el.id])
                    error_msg = custom_required_text[el.id];
                // insert error message
                if(!$(el).parents('.entry').hasClass('error')){
                    var error_msg_box = $('<p>').addClass('error_msg').text(error_msg);
                    switch(el.type){
                        case 'radio':
                            error_msg_box.insertBefore($('input[name='+el.name+']:first'));
                            break;
                        case 'checkbox':
                            if($(el).hasClass('group'))
                                error_msg_box.insertBefore($(el).parents('.entry').find('.group:first'));
                            else
                                error_msg_box.insertBefore($(el));
                            break;
                        default:
                            if(settings.error_value && el.type != 'select-one' && $(el).is(':visible')){
                                $(el).data('value', $(el).val());
                                $(el).addClass('error_value');
                                $(el).val(error_msg);
                            }
                            else if($(el).siblings('.datepicker').length)
                                error_msg_box.insertAfter($(el).siblings('.datepicker'));
                            else
                                error_msg_box.insertAfter($(el));
                    }
                }
                else
                    $('.error_msg .text', $(el).parents('.entry')).text(error_msg);
                $(el).parents('.entry').addClass('error');
           
           topdivheight();
               
           
            }
        }

        // live, multipage or normal validation check
        $.fn.forms.validcheck = function(settings, form, check){
            var toValidate = new Array();
            switch(check){
                case 'live':
                    $('.required', form).blur(function(){
                        toValidate.push(this);
                        setTimeout(function(){
                            if(toValidate.length > 0){
                                if($(toValidate[0]).hasClass('required')) { // Some "required" classes might have been removed in the meantime (see dependencies)
                                    $.fn.forms.valid(settings, toValidate[0], 'live');
                                }
                                toValidate.shift();
                            }
                        }, 300);
                    });
                    break;
                default:
                    var required = (check == 'multipage') ? $('.section:visible .required', form) : $('.required', form);
                    required.each(function(){ $.fn.forms.valid(settings, this); });
            }
            return ($('.error', form).length || $('.error_value:visible', form).length) ? false : true;
        }

        // Error in value
        $.fn.forms.valueErrorMsg = function(settings, form){
            if(!settings.error_value)
                return;
            $('.required', form).focus(function(){
                if($(this).hasClass('error_value')){
                    $(this).val($(this).data('value')).data('value', '').removeClass('error_value');
                    $(this).parents('.error').removeClass('error');
                }
            });
        }

        // Get input value
        $.fn.forms.value = function(el){
            var value = '';
            if($(el).is('select'))
                value = $(':selected', el).text();
            else if($(el).is('input[type=checkbox]') && $(el).is(':checked'))
                value = yes;
            else if($(el).is('input[type=checkbox]') && !$(el).is(':checked'))
                value = no;
            else
                value = $(el).val();
            return value;
        }

        // Dependence
        $.fn.forms.dependence = function(settings, form){
            // Check radio
            $('input[type=radio]', form).click(function(){
                var el = this;
                $('input[name='+el.name+']').each(function(){
                    if($(this).is(':checked') && $(this).hasClass('dependence'))
                        addRequired(this);
                    else if(!$(this).is(':checked') && $(this).hasClass('dependence'))
                        removeRequired(this);
                });
                $.fn.forms.validcheck(settings, form, 'live');
            });
            // Check checkbox, textarea and input[type=text]
            $('.dependence', form).not('input[type=radio]').blur(function(){
                var el = this;
                switch(el.type){
                    case 'checkbox':
                        alert("not available at the moment");
                        break;
                    default:
                        (el.value.length) ? addRequired(el) : removeRequired(el);
                }
                $.fn.forms.validcheck(settings, form, 'live');
            });
            // Add required
            function addRequired(el){
                $('.depends_on_' + el.id).each(function(){
                    $(this).addClass('required');
                    var label = 'label[for='+this.id+']';
                    if(!$(label).find('em').length){
                        $(label).append(
                            $('<em>').text(' *')
                        );
                    }
                });
            }
            // Remove required
            function removeRequired(el){
                $('.depends_on_' + el.id).each(function(){
                    $(this).removeClass('required');
                    $(this).unbind();
                    $(this).parents('.entry').removeClass('error');
                    $('.error_msg', $(this).parents('.entry')).remove();
                    $('label[for='+this.id+'] em').remove();
                });
            }
        }

        // Create multipage, summarypage and progress bar
        $.fn.forms.multipage = function(settings, form){
            if(!settings.multipage)
                return;
            // generate the progress bar and steps
            if(settings.progress_steps){
                var progress_steps = $('<h2>').addClass('progress_steps');
                progress_steps.appendTo($(settings.infobox));
            }
            var progress_bar = $('<ol>').addClass('progress_bar');
            $('.section_title', form).each(function(){
                $('<li>').text($(this).text()).appendTo(progress_bar);
            })
            if(settings.summarypage){
                $('.section:last', form).after(
                    summary_section = $('<div>').addClass('section summary_section')
                );
                $('<li>').text(summary_title).appendTo(progress_bar);
            }
            progress_bar.appendTo($(settings.infobox));
            // show only first section
            $('.section', form).show().not(':first').hide();
            // the last button
            $('<button type=button>').attr({ 'accesskey': 'b', 'name': 'back' }).html('<span>' + back + '</span>').click(function(){
                $('.section:visible', form).hide().prev().show();
                $(':input:enabled:first', form).focus();
                updateWizzard(form);
                // Jump to top of the form
                $('html, body').scrollTop($(settings.scrolltop).offset().top-10);
                // Hide required text on summary page
                (summary_section.is(':visible')) ? $('.required_text', settings.infobox).hide() : $('.required_text', settings.infobox).show();
                return false;
            }).insertBefore('button[name=send]', form).hide();
            // the next button
            $('<button type=button>').attr({ 'accesskey': 'n', 'name': 'next' }).html('<span>' + next + '</span>').click(function(){
                $.fn.forms.validcheck(settings, form, 'multipage');
                if(!$('.error:visible', form).length && !$('.error_value:visible', form).length){
                    $('.section:visible', form).hide().next().show();
                    $('.section:visible :input:enabled:first', form).focus();
                    updateWizzard(form);
                    // Generate summary
                    generateSummary(form);
                    // Jump to top of the form
                    $('html, body').scrollTop($(settings.scrolltop).offset().top-10);
                    // Hide required text on summary page
                    (summary_section.is(':visible')) ? $('.required_text', settings.infobox).hide() : $('.required_text', settings.infobox).show();
                }
                else{
                    if(!settings.error_value)
                        $('.error :input:enabled:first', form).focus();
                }
                return false;
            }).insertBefore('button[name=send]', form).hide();
            updateWizzard(form);

            // should be run in each formfield change handles progress bar navigation and buttons
            function updateWizzard(form){
                // update button next
                var button_back = $('button[name=back]', form);
                ($('.section:first:visible', form).is(':visible')) ? button_back.hide() : button_back.show();
                // update button last
                var button_next = $('button[name=next]', form);
                ($('.section:last', form).is(':visible')) ? button_next.hide() : button_next.show();
                // update button submit
                var button_submit = $('button[name=send]', form);
                (!$('.section:last', form).is(':visible')) ? button_submit.attr({ 'disabled': 'true' }).hide() : button_submit.attr({ 'disabled': '' }).show();
                // update progress bar
                $('li.active', progress_bar).removeClass('active');
                $('li:contains("'+$('.section:visible .section_title', form).text()+'")', progress_bar).addClass('active done');
                $('li', progress_bar).each(function(index){
                    var title = $(this).text();
                    if(!$(this).children('a').length && $(this).hasClass('done')){
                        $(this).wrapInner(
                            $('<a>').attr({ 'rel': index, 'href': '#', 'title': title })
                        );
                    }
                });
                $('a', progress_bar).unbind('click').bind('click', function(){
                    $('.section:visible', form).hide();
                    $('.section:eq('+this.rel+')', form).show();
                    $(':input:visible:enabled:first', form).focus();
                    updateWizzard(form); 
                    return false;
                });
                // Update progress steps
                if(settings.progress_steps)
                    $(progress_steps).html(progress_step.replace('{x}', $('li.active', progress_bar).prevAll().length+1).replace('{y}', $('li', progress_bar).length));
            }
            // Generate summary table
            function generateSummary(form){
                if(settings.summarypage && $('.section:last', form).is(':visible')){
                    $('.summary_section', form).empty().append(
                        $('<h2>').addClass('section_title').attr('title', 'summary_title').text(summary_title)
                    );
                    $('.section', form).not(':last').each(function(){
                        var section_title = $(this).children('.section_title').text();
                        $('<table>').addClass('summary').append(
                            $('<caption>').html(section_title),
                            tbody = $('<tbody>')
                        ).appendTo(summary_section);
                        $('label', $(this)).each(function(){
                            var me = $(this).parents('.multi_entry');
                            if(me.length){
                                if($(this).hasClass('hideme')){
                                    $(tbody).append(
                                        $('<tr>').append(
                                            $('<td class="multi_summary" colspan="2">').append(
                                                subtable = $('<table>').append(
                                                    $('<thead>').append($('<tr>')),
                                                    $('<tbody>')
                                                )
                                            )
                                        )
                                    );
                                    $('.entry:first label', me).each(function(){
                                        $('thead tr', subtable).append($('<th>').text($(this).text().replace(' *', '')));
                                    });
                                    $('.entry', me).each(function(){
                                        var row = $('<tr>');
                                        $(':input', this).each(function(){
                                            var value = $.fn.forms.value(this);
                                            row.append($('<td>').text(value));
                                        });
                                        $('tbody', subtable).append(row);
                                    });
                                }
                            }
                            else {
                                var value = $.fn.forms.value('#'+$(this).attr('for'));
                                if(value.length){
                                    $(tbody).append(
                                        $('<tr>').append(
                                            $('<th>').text($(this).text().replace(' *', '')),
                                            $('<td>').text(value)
                                        )
                                    );
                                }
                            }
                        });
                    });
                }
            }
        }

        // Update contactinfos on change email receiver
        $.fn.forms.updateReceiver = function(form){
            $('#secure_target', form).change(function(){
                var contactID = $(':selected', $(this)).attr('id');
                if(contactID.length){
                    $('.locations_data .'+contactID+' span', form).each(function(){
                        $('input[name=to_'+$(this).attr('title')+']').val($(this).text());
                    });
                }
            }); 
        }

        //Multiple Inputs init
        $.fn.forms.multiInput = function(form){
            $('.multi_entry', form).each(function(i){
                var me = $(this);
                var meid = $('.multi_title', this).attr('id')+'_multi';
                $(this).append(
                    $('<p>').html(
                        $('<a>').attr('href', '#').text(add_entry).click(function(){
                            count = '_'+$('.entry', me).length;
                            clonekrieger = $('.entry:first', me).clone();
                            clonekrieger.addClass('clone');
                            $('label', clonekrieger).each(function(){
                                $(this).attr('for', $(this).attr('for')+count);
                            });
                            $(':input', clonekrieger).each(function(){
                                $(this).attr({ 'id': $(this).attr('id')+count, 'name': $(this).attr('name')+count }).val('');
                            });
                            clonekrieger.insertBefore($(this).parent());
                            multiInputBinding(me);
                            return false;
                        })
                    ).addClass('add'),
                    $('<input>').attr({ 'type': 'hidden', 'name': meid, 'id': meid }),
                    $('<label>').attr('for', meid).html($('legend', this).html()).addClass('hideme')
                );
                multiInputBinding(me);
            });
            //Update on Unfocus
            function multiInputBinding(me){
                $(':input', me).unbind().blur(function(){
                    var v = ''
                    $('.entry :input', me).each(function(){
                        v += $('label[for='+$(this).attr('id')+']').text().replace(' *', '')+": ";
                        v += $.fn.forms.value(this)+"\n";
                    })
                    $('input[name='+$('legend', me).attr('id')+'_multi]', me).val(v); 
                });
            }
        }

        // Send message and load confirm text with ajax
        $.fn.forms.confirm = function(form, settings){
            $('button[name=send] span', form).text(wait).attr('disabled', 'disabled');
            $.ajax({
                'type': 'GET',
                'url': $(form).attr('action'),
                'data': $(form).serialize(),
                'cache': false,
                'success': function(){
                    var confirm = $('<div>').addClass('confirmpage').load($('input[name=next]').val() + ' #confirm'),
                        print_link = $('<a>').attr({ 'href': '#', 'title': 'Zusammenfassung drucken' }).text('Zusammenfassung drucken'),
                        print_cointainer = $('<p>').addClass('print').append(print_link);
                    $(form).after(confirm).remove();
                    if(settings.summarypage){
                        confirm.after(
                            print_cointainer,
                            summary_section.clone()
                        );
                        print_link.click(function(){
                            window.print();
                            return false; 
                        });
                    }
                    $('html, body').scrollTop($(settings.scrolltop).offset().top-10);
                }
            });
        }
    })(jQuery);


/*-- display elements --*/

    (function($){
        $.fn.showElement = function(options){
            var SE_Settings = {
                handler: 'toggle',
                destination: '',
                animate: false
            };
            var SE_Settings = $.extend(SE_Settings, options);

            // hide href anchor destination
            if($(this).length){
                if($(this).is('a')){
                    var destination = ($(SE_Settings.destination).length) ? $(SE_Settings.destination) : $('#'+$(this).attr('href').split('#').pop());
                }
                else{
                    $(this).wrapInner('<a href="#" />');
                    var destination = $(SE_Settings.destination);
                }
                destination.hide();
                // show destination
                if(SE_Settings.handler == 'toggle'){
                    // toogle destination
                    $(this).toggle(
                        function(){ (SE_Settings.animate) ? destination.animate(SE_Settings.animate, { duration: 'slow' }) : destination.show(); },
                        function(){ (SE_Settings.animate) ? destination.animate(SE_Settings.animate, { duration: 'slow' }) : destination.hide(); }
                    );
                }
                else if(SE_Settings.handler == 'mouseover'){
                    // show destination on mouseover
                    $(this).bind({
                        click: function(){ return false; },
                        mouseover: function(){ (SE_Settings.animate) ? destination.animate(SE_Settings.animate, { duration: 'slow' }) : destination.show(); },
                        mouseout: function(){ (SE_Settings.animate) ? destination.animate(SE_Settings.animate, { duration: 'slow' }) : destination.hide(); }
                    });
                }
            }
        };
    })(jQuery);













function topdivheight(){
            var minusheight = 116 -15; /*Abstand top - Borderbottom */
             var contentheight=$('#content').outerHeight();
             if(contentheight >= 415){
                      var contentheight= contentheight + minusheight;
                      $('#topdiv').css('min-height', contentheight);
                }
    }


/**
* 	Really Simple™ Slideshow jQuery plug-in 1.3.1
*	---------------------------------------------------------
*	Introduction, demos, docs, license, downloads, etc:
* 	http://reallysimpleworks.com/slideshow
*/

(function($){var methods={init:function(options){return this.each(function(){var slideshow=this,$slideshow=$(this),data=$slideshow.data('rsf_slideshow');if(!data){var settings=$.extend(true,{},$.rsfSlideshow.defaults);if(typeof options==='object'){$.extend(true,settings,options);};$slideshow.data('rsf_slideshow',{slides:Array(),this_slide:0,effect_iterator:{this_effect:-1,direction:1},settings:settings,interval_id:false,loaded_imgs:Array(),queued:0});}
$slideshow.rsfSlideshow('getSlidesFromMarkup');if(settings.slides.length){$slideshow.rsfSlideshow('addSlides',settings.slides);settings.slides=Array();}
if(typeof settings.eventHandlers==='object'){$.each(settings.eventHandlers,function(evnt,fn){$slideshow.bind(evnt,function(e){fn($slideshow,e);});});}
if(settings.controls.playPause.auto){$slideshow.rsfSlideshow('addControl','playPause');}
if(settings.controls.previousSlide.auto){$slideshow.rsfSlideshow('addControl','previousSlide');}
if(settings.controls.index.auto){$slideshow.rsfSlideshow('addControl','index');}
if(settings.controls.nextSlide.auto){$slideshow.rsfSlideshow('addControl','nextSlide');}
if(settings.autostart){$slideshow.rsfSlideshow('startShow');}});},addSlides:function(slides){if(slides instanceof Array){for(var i=0,len=slides.length;i<len;i++){private._addSlide(this,slides[i]);}}
else{private._addSlide(this,slides);}
return this;},startShow:function(interval,instant){var $slideshow=this;var data=$slideshow.data('rsf_slideshow');if(!data.interval_id){if(instant){$slideshow.rsfSlideshow('nextSlide');}
if(!interval){interval=data.settings.interval;}
data.interval_id=setInterval(function(){$slideshow.rsfSlideshow('nextSlide');},interval*1000);private._trigger($slideshow,'rsStartShow');}
return this;},stopShow:function(){var data=this.data('rsf_slideshow');if(data.interval_id){clearInterval(data.interval_id);data.interval_id=false;private._trigger(this,'rsStopShow');}
return this;},toggleShow:function(){if(this.rsfSlideshow('isRunning')){this.rsfSlideshow('stopShow');}
else{this.rsfSlideshow('startShow');}},isRunning:function(){if(this.data('rsf_slideshow').interval_id){return true;}
return false;},currentSlideKey:function(){var data=this.data('rsf_slideshow');return data.this_slide;},totalSlides:function(){var data=this.data('rsf_slideshow');return data.slides.length;},getSlidesFromMarkup:function(options){var data=this.data('rsf_slideshow');if(!options){options={};}
if(!options.data_container){options.data_container=data.settings.data_container;}
if(options.data_container.charAt(0)==='#'){var $cntnr=$(options.data_container);}
else{var $cntnr=$(this).children(options.data_container);}
if(!$cntnr.length){return false;}
if(!options.slide_data_container){options.slide_data_container=data.settings.slide_data_container;}
var slide_data_selectors=$.extend(true,{},data.settings.slide_data_selectors);if(options.slide_data_selectors){$.extend(true,slide_data_selectors,options.slide_data_selectors);}
options.slide_data_selectors=slide_data_selectors;var self=this;$cntnr.children(options.slide_data_container).each(function(){var slide=private._findData($(this),options.slide_data_selectors);$(self).rsfSlideshow('addSlides',slide);});return this;},nextSlide:function(){var data=this.data('rsf_slideshow');data.this_slide++;if(data.this_slide>=data.slides.length){if(data.settings.loop){data.this_slide=0;}
else{data.this_slide=data.slides.length-1;this.rsfSlideshow('stopShow');return this;}}
this.rsfSlideshow('showSlide',data.slides[data.this_slide]);return this;},previousSlide:function(){var data=this.data('rsf_slideshow');data.this_slide--;if(data.this_slide<0){if(data.settings.loop){data.this_slide=data.slides.length-1;}
else{data.this_slide=0;this.rsfSlideshow('stopShow');return this;}}
this.rsfSlideshow('showSlide',data.slides[data.this_slide]);return this;},goToSlide:function(key){var data=this.data('rsf_slideshow');if(typeof data.slides[key]==='object'){data.this_slide=key;this.rsfSlideshow('showSlide',data.slides[data.this_slide]);}
return this;},showSlide:function(slide,_queue_id){var $slideshow=this,data=$slideshow.data('rsf_slideshow');if(!_queue_id){data.queued+=1;_queue_id=data.queued;private._trigger($slideshow,'rsPreTransition');}
else if(_queue_id!=data.queued){return;}
var containerWidth=$slideshow.width();var containerHeight=$slideshow.height();$slideshow.children('img:first').css('z-index',0);var newImg=new Image();newImg.src=slide.url;var whenLoaded=function(img){var width=img.width;var height=img.height;if(!width||!height){setTimeout(function(){$slideshow.rsfSlideshow('showSlide',slide,_queue_id);},200);return;}
if($.inArray(slide.url,data.loaded_imgs)<0){data.loaded_imgs.push(slide.url);}
private._trigger($slideshow,'rsImageReady');$(img).addClass('rsf-slideshow-image');$slideshow.prepend($(img));width=$(img).outerWidth();height=$(img).outerHeight();$(img).detach();var leftOffset=Math.ceil((containerWidth/2)-(width/2));var topOffset=Math.ceil((containerHeight/2)-(height/2));$(img).css({left:leftOffset});$(img).css({top:topOffset});if(slide.link_to){var $img=$('<a href="'+slide.link_to+'"></a>').append($(img));}
else{$img=$(img);}
var $slideEl=$('<div></div>');$slideEl.addClass(data.settings.slide_container_class);$slideEl.append($img).css('display','none');if(slide.caption){var $capt=$('<span>'+slide.caption+'</span>');$capt.addClass(data.settings.slide_caption_class);$capt.appendTo($slideEl);}
var effect=data.settings.effect;if(slide.effect){effect=slide.effect;}
$slideEl.appendTo($slideshow);private._transitionWith($slideshow,$slideEl,effect);return true;};if($.inArray(slide.url,data.loaded_imgs)<0){if(newImg.width){whenLoaded(newImg);}
else{$(newImg).bind('load',function(){whenLoaded(newImg);});}}
else{whenLoaded(newImg);}
return this;},addControl:function(type){return this.each(function(){var $slideshow=$(this),settings=$slideshow.data('rsf_slideshow').settings;$control=settings.controls[type].generate($slideshow);private._controlsContainer($slideshow);settings.controls[type].place($slideshow,$control);bind_method='bind'+type.substr(0,1).toUpperCase()+type.substr(1,type.length);$slideshow.rsfSlideshow(bind_method,$control);});},bindPlayPause:function($playPause){return this.each(function(){var $slideshow=$(this);var data=$slideshow.data('rsf_slideshow');$playPause.bind('click.rsfSlideshow',function(e){e.preventDefault();$slideshow.rsfSlideshow('toggleShow');});});},bindPreviousSlide:function($prev,autostop){return this.each(function(){var $slideshow=$(this);var data=$slideshow.data('rsf_slideshow');if(!autostop){autostop=data.settings.controls.previousSlide.autostop;}
$prev.bind('click.rsfSlideshow',function(e){e.preventDefault();$slideshow.rsfSlideshow('previousSlide');if(autostop){$slideshow.rsfSlideshow('stopShow');}});});},bindNextSlide:function($next,autostop){return this.each(function(){var $slideshow=$(this);var data=$slideshow.data('rsf_slideshow');if(!autostop){autostop=data.settings.controls.nextSlide.autostop;}
$next.bind('click.rsfSlideshow',function(e){e.preventDefault();$slideshow.rsfSlideshow('nextSlide');if(autostop){$slideshow.rsfSlideshow('stopShow');}});});},bindIndex:function($index,autostop){return this.each(function(){var $slideshow=$(this),settings=$slideshow.data('rsf_slideshow').settings;if(!autostop){autostop=settings.controls.index.autostop;}
$indexLinks=settings.controls.index.getEach($slideshow);$indexLinks.bind('click.rsfSlideshow',function(e){e.preventDefault();var slide_key=settings.controls.index.getSlideKey($(this));if(slide_key){$slideshow.rsfSlideshow('goToSlide',slide_key);if(autostop){$slideshow.rsfSlideshow('stopShow');}}});private._bindActiveIndex($slideshow);});}};$.fn.rsfSlideshow=function(method){if(!this.length){return this;}
if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}
else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}
else{$.error('Method '+method+' does not exist on jQuery.rsfSlidehow');}};var private={_findData:function($slideData,slide_data_selectors){var slide={};var slide_attr;for(var key in slide_data_selectors){var $slideDataClone=$.extend(true,{},$slideData);if(slide_data_selectors[key].selector){$slideDataClone=$slideDataClone.children(slide_data_selectors[key].selector);}
if(slide_data_selectors[key].attr){slide_attr=$slideDataClone.attr(slide_data_selectors[key].attr);}
else{slide_attr=$slideDataClone.text();}
slide[key]=slide_attr;}
return slide;},_addSlide:function($slideshow,slide){var data=$slideshow.data('rsf_slideshow');if((typeof slide)=='string'){url=$.trim(slide);data.slides.push({url:url});}
else if(slide.url){for(var key in slide){slide[key]=$.trim(slide[key]);}
data.slides.push(slide);}},_transitionWith:function($slideshow,$slide,effect){var data=$slideshow.data('rsf_slideshow');var $previousSlide=$slideshow.children('div.'+data.settings.slide_container_class+':first');var effect_iteration='random';if(typeof effect==='object'&&effect.iteration&&effect.effects){effect_iteration=effect.iteration;effect=effect.effects;}
if(effect instanceof Array){switch(effect_iteration){case'loop':data.effect_iterator.this_effect++;if(data.effect_iterator.this_effect>effect.length-1){data.effect_iterator.this_effect=0;}
break;case'backAndForth':data.effect_iterator.this_effect+=data.effect_iterator.direction;if(data.effect_iterator.this_effect<0){data.effect_iterator.this_effect=1;data.effect_iterator.direction=data.effect_iterator.direction*-1;}
if(data.effect_iterator.this_effect>effect.length-1){data.effect_iterator.this_effect=effect.length-2;data.effect_iterator.direction=data.effect_iterator.direction*-1;}
break;default:data.effect_iterator.this_effect=Math.floor(Math.random()*effect.length);break;}
effect=effect[data.effect_iterator.this_effect];}
switch(effect){case'none':$slide.css('display','block');private._endTransition($slideshow);break;case'fade':$slide.fadeIn(data.settings.transition,function(){private._endTransition($slideshow);});break;case'slideLeft':var left_offset=$slide.outerWidth();private._doSlide($slideshow,$slide,$previousSlide,left_offset,0);break;case'slideRight':var left_offset=(0-$slide.outerWidth());private._doSlide($slideshow,$slide,$previousSlide,left_offset,0);break;case'slideUp':var top_offset=$slide.outerHeight();private._doSlide($slideshow,$slide,$previousSlide,0,top_offset);break;case'slideDown':var top_offset=(0-$slide.outerHeight());private._doSlide($slideshow,$slide,$previousSlide,0,top_offset);break;}},_doSlide:function($slideshow,$slide,$previousSlide,left_offset,top_offset){var data=$slideshow.data('rsf_slideshow');$slide.css({top:top_offset,left:left_offset});$slide.css('display','block');$slide.stop().animate({top:0,left:0},data.settings.transition,data.settings.easing,function(){private._endTransition($slideshow);});$previousSlide.stop().animate({top:(0-top_offset),left:(0-left_offset)},data.settings.transition,data.settings.easing);},_endTransition:function($slideshow){var data=$slideshow.data('rsf_slideshow');$slideshow.children('div.'+data.settings.slide_container_class+':not(:last-child)').remove();private._trigger($slideshow,'rsPostTransition');if($slideshow.rsfSlideshow('currentSlideKey')==$slideshow.rsfSlideshow('totalSlides')-1){private._trigger($slideshow,'rsLastSlide');}
else if($slideshow.rsfSlideshow('currentSlideKey')==0){private._trigger($slideshow,'rsFirstSlide');}},_bindActiveIndex:function($slideshow){var indexSettings=$slideshow.data('rsf_slideshow').settings.controls.index;$slideshow.bind('rsPreTransition',function(){var current_slide_key=$(this).rsfSlideshow('currentSlideKey');indexSettings.getEach($slideshow).removeClass(indexSettings.active_class);indexSettings.getSingleByKey($slideshow,current_slide_key).addClass(indexSettings.active_class);});},_controlsContainer:function($slideshow){var settings=$slideshow.data('rsf_slideshow').settings;if(!settings.controls.container.get($slideshow).length){$container=settings.controls.container.generate($slideshow);settings.controls.container.place($slideshow,$container);}},_trigger:function($slideshow,e,event_data){var data=$slideshow.data('rsf_slideshow');if(typeof event_data!=='object'){event_data={};}
$.extend(event_data,{slide_key:data.this_slide,slide:data.slides[data.this_slide]});$slideshow.trigger(e,event_data);}};$.rsfSlideshow={defaults:{interval:5,transition:1000,effect:'fade',easing:'swing',loop:true,autostart:true,slides:Array(),slide_container_class:'slide-container',slide_caption_class:'slide-caption',data_container:'ol.slides',slide_data_container:'li',slide_data_selectors:{url:{selector:'a',attr:'href'},caption:{selector:'a',attr:'title'},link_to:{selector:'a',attr:'data-link-to'},effect:{selector:'a',attr:'data-effect'}},eventHandlers:{rsStartShow:function(rssObj,e){var controlSettings=$(rssObj).data('rsf_slideshow').settings.controls.playPause;var $playPause=controlSettings.get($(rssObj));$playPause.html('Pause').addClass(controlSettings.playing_class);},rsStopShow:function(rssObj,e){var controlSettings=$(rssObj).data('rsf_slideshow').settings.controls.playPause;var $playPause=controlSettings.get($(rssObj));$playPause.html('Play').addClass(controlSettings.paused_class);}},controls:{playPause:{generate:function($slideshow){return $('<a href="#" class="rs-play-pause" data-control-for="'
+$slideshow.attr('id')+'">Pause</a>');},place:function($slideshow,$control){$container=$slideshow.data('rsf_slideshow').settings.controls.container.get($slideshow);$container.append($control);},get:function($slideshow){return $('.rs-play-pause[data-control-for="'+$slideshow.attr('id')+'"]');},playing_class:'rs-playing',paused_class:'rs-paused',auto:false},previousSlide:{generate:function($slideshow){return $('<a href="#" class="rs-prev" data-control-for="'
+$slideshow.attr('id')+'">&lt;</a>');},place:function($slideshow,$control){$container=$slideshow.data('rsf_slideshow').settings.controls.container.get($slideshow);$container.append($control);},get:function($slideshow){return $('.rs-prev[data-control-for="'+$slideshow.attr('id')+'"]');},autostop:true,auto:false},nextSlide:{generate:function($slideshow){return $('<a href="#" class="rs-next" data-control-for="'
+$slideshow.attr('id')+'">&gt;</a>');},place:function($slideshow,$control){$container=$slideshow.data('rsf_slideshow').settings.controls.container.get($slideshow);$container.append($control);},get:function($slideshow){return $('.rs-next[data-control-for="'+$slideshow.attr('id')+'"]');},autostop:true,auto:false},index:{generate:function($slideshow){var slide_count=$slideshow.rsfSlideshow('totalSlides'),$indexControl=$('<ul class="rs-index-list clearfix"></ul>');$indexControl.attr('data-control-for',$slideshow.attr('id'));for(var i=0;i<slide_count;i++){var $link=$('<a href="#"></a>');$link.addClass('rs-index');$link.attr('data-control-for',$slideshow.attr('id'));$link.attr('data-slide-key',i);$link.append(i+1);if(i===$slideshow.rsfSlideshow('currentSlideKey')){$link.addClass('rs-active');}
$li=$('<li></li>');$li.append($link);$indexControl.append($li);}
return $indexControl;},place:function($slideshow,$control){$container=$slideshow.data('rsf_slideshow').settings.controls.container.get($slideshow);$container.append($control);},get:function($slideshow){return $('.rs-index-list[data-control-for="'+$slideshow.attr('id')+'"]');},getEach:function($slideshow){return $('.rs-index[data-control-for="'+$slideshow.attr('id')+'"]');},getSingleByKey:function($slideshow,slide_key){return $('.rs-index[data-control-for="'+$slideshow.attr('id')
+'"][data-slide-key="'+slide_key+'"]');},getSlideKey:function($controlItem){return $controlItem.attr('data-slide-key');},active_class:'rs-active',autostop:true,auto:false},container:{generate:function($slideshow){return $('<div class="rs-controls clearfix" id="rs-controls-'+$slideshow.attr('id')+'"></div>');},place:function($slideshow,$control){$slideshow.after($control);},get:function($slideshow){return $('#rs-controls-'+$slideshow.attr('id'));}}}}};})(jQuery);





/*-- DOM -- */

    $(function(){
        
             $('<li id="nav_aktuelles" class="lasti"><a class="popup" href="http://mandanteninformationen.de/?w3cb/5ElZ2Y/K4L7LDvjRT+3vjFj0LcMFXtI9nNnl4x+Wmw6KQ==" title="Aktuelles"  rel="900,600">Aktuelles</a></li>').insertBefore('#nav > li.last')
    $('#nav > li.last').remove();

    


        // IE6nomore
        $.IE6nomore();
        // Forms
        $('form.contact').forms({ 'multipage': false });

        // Show elements
        $('.show_disclaimer').showElement();


        // Iframe popup
        $('.popup').IframePopup();

        // Table
        $('.downloads td').clickable();

             if ( $('.center #topdiv').length > 0 ) {      
          topdivheight();
          };
          
    });

