Bfa = window.Bfa || {};


(function($) {
$(function() { // document ready!
    
    /**
     * Draw next/prev buttons.
     */
     

    var _drawedButton = function($btn,dir,inactiveClr) {
        
        if (!inactiveClr) inactiveClr = '#555555'
        
        var clr     = $btn.css('color');
        var _btn    = Raphael($btn.get(0),60,120);
        
        var _circle = null;
        var _arrow = null;
        
        var arr = null;
        if (dir == 1) {
            arr = ["23 57","31 57","31 53","38 60","31 67","31 63","23 63"];
        }
        else {
            arr = ["37 57","29 57","29 53","22 60","29 67","29 63","37 63"];
        }

        _circle = _btn.circle(30,60,14).attr('stroke-width','3').attr('stroke',inactiveClr);
        _arrow = _btn.path("M"+arr.join("L")+"Z").attr('stroke-width','1').attr('stroke',inactiveClr).attr('fill',inactiveClr);
        
        var _draw = function() {
            _circle.attr('stroke',inactiveClr);
            _arrow.attr('stroke',inactiveClr).attr('fill',inactiveClr);
        }

        var _drawHover = function() {
            _circle.attr('stroke',clr);
            _arrow.attr('stroke',clr).attr('fill',clr);
        }

        _draw();
        $btn.hover(
            function() { _drawHover(); },
            function() { _draw(); }
        );
    }
            
    

    /**
     * Navigation item decoration.
     */
    var clr = null;
    $('#navigation>ul>li').each(function() {
        var $li = $(this);
        var $edge = $("<span/>").addClass('edge').appendTo($li);
        if (!clr) {
            clr = $li.css('background-color');
        }
        
        var edge = Raphael($edge.get(0),10,10).path("M0 0L0 10L10 10")
        edge.attr('fill', clr);
        edge.attr('stroke', 'tansparent');
    });
    
    
    /**
     * Subnavigation
     */
    // var $subnav = $('#navigation>ul>li.selected>.child-menu');
    // if ($subnav.length > 0) {
    //     $('.paragraph-standard-subnav .subnavigation').each(function() {
    //         var $nav = $("<ul/>").addClass('subnav').html($subnav.html());
    //         $(this).append($nav);
    //     });
    // }
    
    /**
     * Open external teaser links in new window.
     */
     
    $('.paragraph-teaser .teaser-link').click(function() {
        var $a = $(this);
        if ($a.attr('href').substring(0,7) == 'http://') {
            window.open($a.attr('href'));
            return false;
        }
    });
    
    
    $('.paragraph-teaser .teaser-link').each(function() {
        
        var timerID = 0;
        var left = 0;
        var $t = $(this);
        $t.hover(
            function() {
                timerID = setInterval(function() {
                    left = (left+1)%85;
                    $t.css('background-position', left+'px 0px');
                },25);
            },
            function() {
                clearInterval(timerID);
            }
        );
        
    });
    
    
    
    
    
    /**
     * Content dropdown (append)
     */
    
    $.fn.inplaceContentAppender = function() {
        
        return this.each(function() {
            
            var $obj = $(this);
                
            var animDurationOpen = 400;
            var animDurationClose = 300;
        
            var $intro = $obj.find('.intro');
            var $body = $obj.find('.body');
            var $content = $body.find('.body-content');
                
            var expanded = false;
            var _toggle = function() {
                expanded = !expanded;
                if (expanded) {
                    $intro.addClass('bfa-expanded');
                    $body.animate({
                        height: $content.height()+'px'
                    }, animDurationOpen);
                }
                else {
                    $intro.removeClass('bfa-expanded');
                    $body.trigger('willCollapse');
                    $body.animate({
                        height: 0
                    }, animDurationClose, function() {
                        $body.trigger('didCollapse');
                    });
                }
            }
                
            var $_close = null;            
            var $close = function() {
                if (!$_close) {
                    $_close = $("<a/>").attr('href','#close').addClass('close-button').appendTo($intro).click(function() {
                        _toggle();
                        $(this).hide();
                        return false;
                    });

                    var clr = $_close.css('color');
                    var _btn = Raphael($_close.get(0),32,32);
                    
                    var btn = _btn.set();
                    btn.push(
                        _btn.circle(16,16,14).attr('stroke-width','3'),
                        _btn.path("M10 10L22 22").attr('stroke-width','5'),
                        _btn.path("M22 10L10 22").attr('stroke-width','5')
                    );
                    
                    var _draw = function() {
                        btn.attr('stroke', '#555555');
                    }
                    
                    var _drawHover = function() {
                        btn.attr('stroke', clr);
                    }

                    _draw();
                    $_close.hover(
                        function() { _drawHover(); },
                        function() { _draw(); }
                    );
                    
                    $_close.hide();

                }

                setTimeout(function() {
                    $_close.fadeIn(200);
                },150);
                return $_close;
            }
            
                
            $intro.click(function() {
                
                $close();
                if (!expanded) {
                    _toggle();
                }
                
                return false;
                
            })
            
            
        });
        
    }
    
    
    
    /**
     * Content dropdown (replace)
     */
    
    $.fn.inplaceContentLoader = function() {
        
            return this.each(function() {
                var $obj    = $(this);
                var $intro  = $obj.find('.intro');
                var $detail = $obj.find('.detail');

                var introHeight = 0;
                var detailHeight = 0;
                
                var animDurationOpen = 400;
                var animDurationClose = 300;
                
                var $_close = null;            
                var $close = function() {
                    if (!$_close) {
                        $_close = $("<a/>").attr('href','#close').addClass('close-button').appendTo($detail).click(function() {
                            $intro.fadeIn(animDurationClose);
                            $detail.fadeOut(animDurationClose);
                            $obj.animate({
                                height: introHeight+'px'
                            },animDurationClose);
                            return false;
                        });

                        var clr = $_close.css('color');
                        var _btn = Raphael($_close.get(0),32,32);
                        
                        var btn = _btn.set();
                        btn.push(
                            _btn.circle(16,16,14).attr('stroke-width','3'),
                            _btn.path("M10 10L22 22").attr('stroke-width','5'),
                            _btn.path("M22 10L10 22").attr('stroke-width','5')
                        );
                        
                        var _draw = function() {
                            btn.attr('stroke', '#555555');
                        }
                        
                        var _drawHover = function() {
                            btn.attr('stroke', clr);
                        }

                        _draw();
                        $_close.hover(
                            function() { _drawHover(); },
                            function() { _draw(); }
                        );

                    }
                    return $_close;
                }
                                
                $intro.click(function() {
                    if (introHeight == 0) {
                        introHeight = $intro.outerHeight();
                        $detail.show();
                        detailHeight = $detail.outerHeight();
                        $detail.hide();
                    }
                    
                    $intro.fadeOut(animDurationOpen);
                    $detail.fadeIn(animDurationOpen);
                    
                    $obj.animate({
                        height: detailHeight+'px'
                    },animDurationOpen);
                    
                    // Make sure the close button is added to $detail
                    $close();
                    
                    return false;
                });
            });
    }
    
    
    
    
    /**
     * User Gallery Upload
     */
    
    $.fn.userGalleryUpload = function() {
        
        return this.each(function() {
           
            var $container  = $(this);
            
            var $form       = $container.find('form');
            var $next       = $container.find('.next');
            
            $form.submit(function() {
                
                var valid = true;
                
                $form.find('.error').removeClass('error');
                
                $form.find('.required').each(function() {
                    
                    var $obj = $(this);
                    
                    var val = $obj.find('input').val();
                    if ($.trim(val) == '') {
                        $obj.addClass('error');
                        valid = false;
                    }
                    
                });
                

                if (valid) {
                    
                    $form.attr('method','post');
                    
                    setTimeout(function() {
                        $form.get(0).reset();
                        $container.hide();
                    },200);
                    
                    return true;
                    
                }
                
                return false;
            });
            
            $next.click(function() {
                
                $form.submit();
                
                return false;
                
            });
                
        });
        
    }
    
    
    
    
    /**
     * Gallery strip
     */
        
    $.fn.strip = function() {
        
        return this.each(function() {
            
            var $container = $(this);
            
            var $next = $("<span/>").addClass('next').appendTo($container).hide();
            var $prev = $("<span/>").addClass('prev').appendTo($container).hide();




            var imagesPerRow    = 4;
            var $images         = $container.find('li');
            var index           = 0;
            var $list           = $container.find('ul');

            var _validate = function() {
                if (index > 0) $prev.show();
                else $prev.hide();
                if (index+imagesPerRow < $images.length) $next.show();
                else $next.hide();
            }
            
            _validate();
            
            
            var _slide = function(dir) {

                var w = $images.eq(0).outerWidth();

                var indexBefore = index;

                index += dir*4;

                if (index < 0) index = 0;
                if (index >= $images.length-4) index = $images.length - 4;
                
                var left = index * -1 * w;
                                
                $list.animate({
                    left: left+'px'
                },500);
                
                _validate();

            }

            $next.click(function() {
               _slide(1);
               return false; 
            });
            
            $prev.click(function() {
                _slide(-1);
                return false;
            });
            
            /// drawed button
            _drawedButton($prev,-1, '#999999');
            _drawedButton($next, 1, '#999999');
            
            
        });
        
    }
    
    /**
     * Gallery
     */
         
    $.fn.gallery = function() {
            
        return this.each(function() {
                                    
            var $container  = $(this);
            
            if ($container.find('.bfa-gallery-login').length > 0) return;

            
            var $overview   = $container.find('.gallery-overview');
                         
            var containerHeight = $overview.height();
            var containerWidth = $container.width();
            
            var padding = 60;
            
                                                
            var index = 0;
            var $images = $container.find("[data-src]");

            var $next = $("<span/>").addClass('next').appendTo($container).hide();
            var $prev = $("<span/>").addClass('prev').appendTo($container).hide();
            var $back = $("<span/>").addClass('close').appendTo($container).hide();
            
            
                        
            /**
             * Back/Close button drawing.
             */
             
            (function() {
                var clr = $back.css('color');
                var _btn = Raphael($back.get(0),60,60);
            
                var btn = _btn.set();
                btn.push(
                    _btn.circle(30,30,14).attr('stroke-width','3'),
                    _btn.path("M24 24L36 36").attr('stroke-width','5'),
                    _btn.path("M36 24L24 36").attr('stroke-width','5')
                );
            
                var _draw = function() {
                    btn.attr('stroke', '#555555');
                }
            
                var _drawHover = function() {
                    btn.attr('stroke', clr);
                }

                _draw();
                $back.hover(
                    function() { _drawHover(); },
                    function() { _draw(); }
                );
            })();
            
            
            /**
             * Draw next/prev buttons.
             */
             
            (function() {

                var _drawedButton = function($btn,dir) {
                    var clr     = $btn.css('color');
                    var _btn    = Raphael($btn.get(0),60,120);
                    
                    var _circle = null;
                    var _arrow = null;
                    
                    var arr = null;
                    if (dir == 1) {
                        arr = ["23 57","31 57","31 53","38 60","31 67","31 63","23 63"];
                    }
                    else {
                        arr = ["37 57","29 57","29 53","22 60","29 67","29 63","37 63"];
                    }

                    _circle = _btn.circle(30,60,14).attr('stroke-width','3').attr('stroke','#555555');
                    _arrow = _btn.path("M"+arr.join("L")+"Z").attr('stroke-width','1').attr('stroke','#555555').attr('fill','#555555');
                    
                    var _draw = function() {
                        _circle.attr('stroke','#555555');
                        _arrow.attr('stroke','#555555').attr('fill','#555555');
                    }

                    var _drawHover = function() {
                        _circle.attr('stroke',clr);
                        _arrow.attr('stroke',clr).attr('fill',clr);
                    }

                    _draw();
                    $btn.hover(
                        function() { _drawHover(); },
                        function() { _draw(); }
                    );
                }
                
                _drawedButton($prev,-1);
                _drawedButton($next, 1);
                
                
            })();
            
            
            $next.click(function(){
                index++;
                if (index >= $images.length) index = 0;
                dir = 1;
                $images.eq(index).click();
                return false;
            });
            $prev.click(function() {
                index--;
                if (index < 0) index = $images.length - 1;
                dir = -1;
                $images.eq(index).click();
                return false;
            });
            
            $back.click(function() {
                
                dir = 1;
                $prev.hide();
                $next.hide();
                $back.hide();
                
                $container.animate({
                    height: containerHeight+'px'
                });
                
                $overview
                    .css({left: '-1000px'})
                    .animate({
                        left: 0
                    }, function() {
                        $overview.css({
                            top: 'auto',
                            bottom: 0
                        })
                    });
                
                if ($current) {
                    $current.animate({
                        left: '1000px'
                    }, function() {
                        $(this).remove();
                    })
                }
                
                $current = null;
                return false;
            });
            
                
            
            var $current = null;
            
            var dir = 1;
            var _slide = function(img) {
                
                var $div = $("<div/>").addClass('gallery-viewer').append(img);
                $(img).css({
                    margin: padding+'px auto'
                });
                
                $div
                    .css({
                        left: (dir*1000)+'px'
                    })
                    .appendTo($container)
                    .animate({
                        left: 0
                    });
                
                if ($current) {
                    $current.animate({
                        left: (dir*-1000)+'px'
                    }, function() {
                        $(this).remove();
                    })
                }
                else {
                    $overview
                        .css({
                            top: 0,
                            bottom: 'auto'
                        })
                        .animate({
                            left: (dir*-1000)+'px'
                        });
                }
                
                $current = $div;
            }
            
            
            $images.click(function(e) {
                
                if ($(e.target).hasClass('oi-button')) return;
                                
                index = $images.index($(this));
                
                var $obj    = $(this);
                var src     = $obj.attr('data-src');
                var height  = parseInt($obj.attr('data-height')) + 2*padding;

                var img = new Image();
                
                
                img.onload = function() {

                    var mov = $obj.attr('data-mov');
                    
                    if (mov) {
                        _slide($("<a/>")
                            .attr('href',mov)
                            .addClass('img')
                            .addClass('click-to-flowplayer')
                            .append(img)
                            .append($("<span/>").addClass('legend').html($obj.attr('data-legend')))
                            .css({width: img.width+'px', height: img.height+'px'})
                            .playbutton()
                        );
                    }
                    else {
                        _slide($("<span/>")
                            .addClass('img')
                            .css('width',img.width+'px')
                            .append(img)
                            .append($("<span/>").addClass('legend').html($obj.attr('data-legend')))
                        );
                    }

                    $next.fadeIn();
                    $prev.fadeIn();
                    $back.fadeIn();

                    $container.animate({
                        height: height+'px'
                    });
                }
                img.src = src;
                
                

            });
            
            
            $container.bind('willCollapse', function() {
                if ($current) {
                    $current.css({
                        top: 'auto',
                        bottom: '-1px'
                    });
                }
            });
            $container.bind('didCollapse', function() {
                if ($current) {
                    $current.remove();
                    $current = null;
                }
                dir = 1;
                $prev.hide();
                $next.hide();
                $back.hide();
                $overview.css({left:0,top:'auto',bottom:0});
            });
            
            
        });
    }   
    
    
    
    
    /**
     * Text/Image image viewer.
     */
    
    $.fn.textimage = function() {
            return this.each(function() {
               
               var $obj = $(this);
               var $loader = $obj.find('.image-loader');
               
               if ($loader.length == 0) return;
               
               
               $loader.click(function() {


                   var isVideoOnly = ($loader.attr('href') == '');
                   
                   var $img     = null;
                   var $text    = null;

                   var textHeight   = 0;
                   var imageHeight  = 0;
                   
                   $loader.trigger('mouseout');
                   
                   if (!$img) {
                       $text = $obj.find('.text');
                       $img = $("<div/>").addClass('image');
                       $obj.append($img);
                       
                       textHeight = $obj.height();
                                              
                       
                   }
                   
                   $img.css({
                       left: '1000px'
                   }).hide();

                    
                    
                   var img = null;
                   
                   var _did_load = function() {
                       
                       var mov = $loader.attr('data-mov');
                    
                       var $imgOrMov = null;
                       
                       if (isVideoOnly) {
                           $imgOrMov = $("<a/>")
                               .attr('href',mov)
                               .addClass('img')
                               .attr('data-flowplayer-controls','true')
                               //.append('<span>hoho<\/span>')
                               //.append($("<span/>").addClass('legend').html($loader.attr('data-legend')))
                               .css({width: '320px', height: $obj.outerHeight()+'px'})
                           ;
                           
                           setTimeout(function() {
                               $imgOrMov.video(function(clip) {
                                                                      
                                   var w = clip.metaData.width;
                                   var h = clip.metaData.height;
                                   
                                   $imgOrMov.css({
                                       width: w+'px',
                                       height: (h+24)+'px'
                                   });
                                   
                                   
                                   $obj.animate({
                                       height: ($img.outerHeight())+'px'
                                   });
                               });
                               
                               
                           },500);
                       }
                       else if (mov) {
                           $imgOrMov = $("<a/>")
                               .attr('href',mov)
                               .addClass('img')
                               .addClass('click-to-flowplayer')
                               .append(img)
                               .append($("<span/>").addClass('legend').html($loader.attr('data-legend')))
                               .css({width: img.width+'px', height: img.height+'px'})
                           ;
                           
                           $imgOrMov.playbutton();
                           
                       }
                       else {
                           $imgOrMov = $("<span/>")
                               .addClass('img')
                               .css('width',img.width+'px')
                               .append(img)
                               .append($("<span/>").addClass('legend').html($loader.attr('data-legend')))
                           ;
                       }
                       
                       $img.append($imgOrMov);
                                              
                       
                       
                       imageHeight = $img.outerHeight();
                        

                       $obj.css({
                           height: textHeight+'px'
                       });

                       $text.animate({
                           left: '-1000px'
                       });
                       
                       if (!isVideoOnly) {
                           $obj.animate({
                               height: imageHeight+'px'
                           })
                       }


                       var $_close = null;            
                       var $close = function() {
                           if (!$_close) {
                               $_close = $("<a/>").attr('href','#close').addClass('close-button').appendTo($img).click(function() {
                                   
                                   $img.animate({
                                       left: '1000px'
                                   },function() {
                                       $img.empty().hide();
                                   });
                                   
                                   $text.animate({left:0});
                                   $obj.animate({height:textHeight+'px'},function() {
                                       $obj.css('height','auto');
                                   });
                                   
                                   $(this).fadeOut();
                                   
                                                                      
                                   return false;
                               });

                               var clr = $_close.css('color');
                               var _btn = Raphael($_close.get(0),32,32);

                               var btn = _btn.set();
                               btn.push(
                                   _btn.circle(16,16,14).attr('stroke-width','3'),
                                   _btn.path("M10 10L22 22").attr('stroke-width','5'),
                                   _btn.path("M22 10L10 22").attr('stroke-width','5')
                               );

                               var _draw = function() {
                                   btn.attr('stroke', '#555555');
                               }

                               var _drawHover = function() {
                                   btn.attr('stroke', clr);
                               }

                               _draw();
                               $_close.hover(
                                   function() { _drawHover(); },
                                   function() { _draw(); }
                               );

                               $_close.hide();

                           }

                           return $_close;
                       }


                       $close().hide();
                       $img.show().animate({
                           left: 0
                       }, function() {
                           $close().fadeIn();
                       });

                   }
                   
                   if (isVideoOnly) {
                        setTimeout(function() {
                            _did_load();
                        },10);
                   }
                   else {
                       var img = new Image();
                       img.onload = function() {
                          _did_load();
                       }
                       img.src = $loader.attr('href');
                   }

                   
                   
                   return false;
                   
               });
                
            });
            
    }
    
    
    
    $('.paragraph-event').each(function() {
        
        var $c = $(this).find('.content');
        
        if ($c.attr('data-image') != '') {
            
            var $btn =  $("<a/>")
                    .attr('href',$c.attr('data-image'))
                    .addClass('image-loader')
                    .appendTo($c);
                                        
            _drawedButton($btn, 1);
            
        }
        
    });
    
    $('.paragraph-text-image').each(function() {

        var $c = $(this).find('.content');
        
        if ($c.find('.fulltext').length > 0) {
            
            var $btn =  $("<a/>")
                    .attr('href','#')
                    .addClass('full-loader')
                    .appendTo($c);
                                        
            _drawedButton($btn, 1);
            
            var $intro = $c.find('.intro');
            var $full = $c.find('.fulltext');
            var $text = $c.find('.text');
            
            $btn.click(function() {
                
                $btn.fadeOut();
                                                                            
                var introHeight = $intro.outerHeight();
                
                $text.css('height',introHeight+'px');
                
                var fullHeight = $full.css({visibility:'hidden',display:'block'}).outerHeight();
                
                
                $full.css({visibility:'visible',display:'none'});
                
                $text.animate({height: fullHeight+'px'});
                
                
                $full.css({
                    position: 'absolute',
                    top: 0,
                    left: 0,
                    width: $intro.width()+'px'
                }).fadeIn();
                $intro.fadeOut();
               
               
               
                $_close = $("<a/>").attr('href','#close').addClass('close-button').appendTo($text.parent()).click(function() {

                    $intro.fadeIn();
                    $full.fadeOut();
                    $text.animate({height:introHeight+'px'});
                    $btn.fadeIn();

                    $(this).fadeOut(function() {
                        $(this).remove();
                    });
                                                                           
                    return false;
                });

                var clr = $_close.css('color');
                var _btn = Raphael($_close.get(0),32,32);

                var btn = _btn.set();
                btn.push(
                    _btn.circle(16,16,14).attr('stroke-width','3'),
                    _btn.path("M10 10L22 22").attr('stroke-width','5'),
                    _btn.path("M22 10L10 22").attr('stroke-width','5')
                );

                var _draw = function() {
                    btn.attr('stroke', '#555555');
                }

                var _drawHover = function() {
                    btn.attr('stroke', clr);
                }

                _draw();
                $_close.hover(
                    function() { _drawHover(); },
                    function() { _draw(); }
                );

                $_close.hide();
                
                setTimeout(function() {
                    $_close.fadeIn();
                },200);


                return false;
            });
            
            
        }
        
    });

    
    
    
    
    // Init plugins
    $('.inplace-content-loader').inplaceContentLoader();
    $('.inplace-content-appender').inplaceContentAppender();
    $('.gallery-images').gallery();
    $('.paragraph-gallery-strip .gallery-overview').strip();
    $('.paragraph-text-image, .paragraph-event').textimage();
    
    $('.paragraph-user-gallery .upload').userGalleryUpload();
    
    
})
})(jQuery);





/**
 * Sling: Custom dialogs
 */
 
(function($){
$(function() { // document ready
    
    
    /**
     * Bfa file uploader
     */
    $('.gallery-add-images').each(function() {
       
        var $a = $(this);
        
        var clr = $(this).css('color');
        
        $a.hover(
            function() {
               $(this).css({
                   color: '#fff',
                   backgroundColor: clr
               });
            },
            function() {
                $(this).css({
                    color: clr,
                    backgroundColor: 'rgba(0,0,0,0.5)'
                });
            }
        );
        
        
        $a.click(function() {

            window.open('/repository/proxy'+$a.attr('href')+'.oi.upload.html','oi-sling-uploader','width=848,height=500');
            return false;
        });
        
    });
    
    
    
    


    
    if (window.OI) {
        
        Bfa.Dialog = {};
        Bfa.Dialog.Control = {};
        
        Bfa.Dialog.Control.topnavicon = OI.Dialog.Control.extend({
        
        
            input: function() {
            
                var titleKeys = ['title'];
                if (this.conf('itemLabel')) {
                    titleKeys = this.conf('itemLabel').split(',');
                }
            
                var $ref = $("<div/>");
            
                this._input = $("<select/>").attr('name','./'+this.name());
            
            
                var that = this;
                $.each({
                   b1: 'Home',
                   b2: 'Sprechblase',
                   b3: 'Weltkarte' 
                },function(val,title) {
                    var $o = $("<option/>").attr('value',val).html(title);
                
                    if (that.value() == val) $o.attr('selected','selected');
                
                    that._input.append($o);
                });
            
                        
                $ref.append(this._input);
                return $ref;
            
            }
        
        });
    }    
    
    
    /**
     * Protected Galleries
     */
     
    $('.paragraph-gallery-strip [data-needs-login]').click(function() {
                
        var $img = $(this);
        
        if ($img.attr('data-needs-login') != 'true') return;
        
        var idx = $img.parent().children().index($img);
        
        var $strip = $img.parents('.paragraph-gallery-strip').eq(0);
        
        $strip.data('idx', idx);
        
        var $body = $strip.find('.bfa-gallery-login');
        
        $body.show().animate({height: '50px'});
        
        return false;
    });
    
    $('.bfa-gallery-login-gallery form').submit(function() {

        var $form = $(this);
        
        $form.find('.error').hide();
        
        var $gallery = $form.parents('.paragraph-gallery').eq(0);
        var action = $form.attr('action');
        
        $.get(action, $form.serialize(), function(html) {

            var $ret = $(html);
            
            if ($ret.find('.bfa-gallery-login').length == 0) {
                
                $gallery.find('.close-button').eq(0).click();
                
                setTimeout(function() {                
                    var $container = $form.parents('.gallery-overview').eq(0);
                    $container.html($ret.find('.gallery-overview').html());
                    setTimeout(function() {
                        $gallery.find('.gallery-images').gallery();
                        $gallery.find('.intro').click();
                    }, 100);
                }, 300);
            }
            else {
                $form.find('.error').fadeIn();
            }
            
        });
        
       return false; 
    });

    $('.bfa-gallery-login-gallery-strip form').submit(function() {

        var $form = $(this);
        
        $form.find('.error').hide();
        
        var $gallery = $form.parents('.paragraph-gallery-strip').eq(0);
        var action = $form.attr('action');
        
        $.get(action, $form.serialize(), function(html) {

            var $ret = $(html);
                        
            if ($ret.find('.bfa-gallery-login').length == 0) {
                
                $form.parent().find('.close-button').click();
                
                
                //var $loaded = $ret.find('.gallery-overview li');
                
                var $images = $form.parents('.gallery-images').eq(0).find('.gallery-overview li');
                var $loaded = $ret.find('.gallery-overview li');
                                
                $images.attr('data-needs-login','false');
                
                var i = 0;
                $images.each(function() {
                    var $img = $(this);
                    var $load = $loaded.eq(i);

                    if ($load.get(0).hasAttribute('data-mov')) {
                        $img.attr("data-mov", $load.attr("data-mov"));
                    }
                    
                    $img.attr("data-src"    , $load.attr("data-src"));
                    $img.attr("data-height" , $load.attr("data-height"));
                    $img.attr("data-legend" , $load.attr("data-legend"));
                    
                    i++;
                });
                
                setTimeout(function() {
                    $gallery.find('.bfa-gallery-login').remove();
                    $gallery.find('.gallery-images').gallery();
                    
                    $images.eq($gallery.data('idx')).click();
                    
                },300);


            }
            else {
                $form.find('.error').fadeIn();
            }
            
        });
        
       return false; 
    });
    
    $('.bfa-gallery-login .close-button').each(function() {
        
        var $_close = $(this);
                
        var clr = $_close.css('color');
        var _btn = Raphael($_close.get(0),32,32);
        
        var btn = _btn.set();
        btn.push(
            _btn.circle(16,16,14).attr('stroke-width','3'),
            _btn.path("M10 10L22 22").attr('stroke-width','5'),
            _btn.path("M22 10L10 22").attr('stroke-width','5')
        );
        
        var _draw = function() {
            btn.attr('stroke', '#555555');
        }
        
        var _drawHover = function() {
            btn.attr('stroke', clr);
        }

        _draw();
        $_close.hover(
            function() { _drawHover(); },
            function() { _draw(); }
        );    
        
        $_close.click(function() {
            if ($_close.parents('.paragraph-gallery-strip').length > 0) {
                $_close.parents('.bfa-gallery-login').eq(0).animate({height: 0}, function() {
                    $(this).hide();
                });
            }
            else {
                $_close.parents('.paragraph-gallery').eq(0).find('.intro .close-button').click();
            }
            
            return false;
            
        });
        
    });
    
        
});
})(jQuery);


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



(function($) {
    

$.fn.playbutton = function() {
    
    return this.each(function() {
        
        var $container = $(this);
        
        var $btn = $("<span/>").css({
            position: 'absolute',
            height: '100px',
            width: '100px',
            top: '50%',
            left: '50%',
            marginLeft: '-50px',
            marginTop: '-50px'
        });
        
        $container.append($btn);
        
        
        var _btn = Raphael($btn.get(0),100,100);
        
        var clr = '#ffffff';
        var _circle = _btn.circle(50,50,45).attr('stroke-width','8').attr('stroke',clr).attr('fill','#999999').attr('opacity',0.5);
        var _arrow  = _btn.path("M38 32L38 68L68 50Z").attr('stroke-width','1').attr('stroke',clr).attr('fill',clr).attr('opacity',0.5);
        
        
        
    });
    
}    

    
$.fn.video = function(callback) {
    return this.each(function() {
        
        var pathToPlayer = themeDisplay.getPathThemeRoot()+'javascript/flowplayer/flowplayer-3.1.5.swf';

        var $fp = $(this);
        $fp.css({height:'300px'});

        var fw = $fp.width();

        $fp.removeClass('flowplayer-load');
        
        
        var hasControls = ($fp.attr('data-flowplayer-controls') == 'true');
        
        var opt = {};
        
        opt.clip = {
		    onMetaData: function() { 
		        var w = this.getClip().metaData.width;
		        var h = this.getClip().metaData.height;

                // fh/fw = h/w
                var fh = Math.floor(fw * h / w);
                $fp.css({height: fh+'px'});
                
                if (callback) {
                    callback(this.getClip());
                }
                
            },
			autoPlay: true,
			scaling: 'fit'
		};
		
		opt.canvas = {
		    background: '#000000',
			backgroundGradient: 'none'
		};
		
		if (!hasControls) {
		    opt.plugins = { 
                controls: null 
            };
		}


        $fp.flowplayer(pathToPlayer, opt);
        
    });
}
    
$(function() { // document ready

    var pathToPlayer = themeDisplay.getPathThemeRoot()+'javascript/flowplayer/flowplayer-3.1.5.swf';
    
    /**
     * Flowplayer
     */
     
    $('.click-to-flowplayer').livequery('click', function() {
        
        $(this).removeClass('click-to-flowplayer');

        $(this).empty().css({height:($(this).height()+24)+'px'});
        var $vid = $(this);
        $vid.flowplayer(pathToPlayer, {
			clip: {
			    onMetaData: function() {
			    },
				autoPlay: true,
				scaling: 'fit'
			}
        });
        
        return false;
        
    });
    
    
    $('.flowplayer-load').video();
    // $('.flowplayer').css({height:'300px'}).each(function() {
    //     
    //     var $fp = $(this);
    //     var fw = $fp.width();
    //     
    //     $fp.removeClass('flowplayer');
    //     
    //     $fp.flowplayer(pathToPlayer, {
    //      clip: {
    //          onMetaData: function() { 
    //              var w = this.getClip().metaData.width;
    //              var h = this.getClip().metaData.height;
    //                 
    //                 // fh/fw = h/w
    //                 var fh = Math.floor(fw * h / w);
    //                 $fp.css({height: fh+'px'});
    //             },
    //          autoPlay: true,
    //          scaling: 'fit'
    //      },
    //         plugins: { 
    //             controls: null 
    //         }
    //     });
    // });
    
});   
})(jQuery);




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


(function($) {
    
    $(function() {
        
        var $items = $('#topnavigation .topnavigation-item a.nav');
        $items.each(function() {
            var $item = $(this);
            var $icon = $("<div/>").addClass('icon').appendTo($item.parent());
            
            
            var size = 116;
            
            var scale = 0.3;
            
            var icon = $(this).attr('data-icon');
            if (icon == 'undefined') {
                icon = 'b1';
            }
                        
        
            var _btn = Raphael($icon.get(0), size, size/2);
            
            var btn = _btn.set();
            btn.push(
                _btn.path(Bfa.buttons.circle),
                _btn.path(Bfa.buttons[icon])
            );
            
            var clr = $item.css('color');
            btn.scale(scale,scale,0,0).attr('fill',clr).attr('stroke','transparent');
            
            $item.hover(
                function() {
                    btn.attr('fill',$item.css('color'));
                },
                function() {
                    btn.attr('fill',clr);
                }
            );
            
            
        });
        
    });
    
})(jQuery);

// // BUTTON TEST...
// (function($) {
//     
//     $(function() {
//         
//         var size = 115;
//         
//         var scale = 0.3;
//         
//         var $test = $("<div/>").css({
//             width: Math.ceil(size*scale)+'px',
//             height: Math.ceil(size*scale)+'px',
//             border: '1px solid red'
//         }).appendTo('body');
//         
//     
//         var _btn = Raphael($test.get(0), size, size);
//         
//         var btn = _btn.set();
//         btn.push(
//             _btn.path(Bfa.buttons.circle),
//             _btn.path(Bfa.buttons.b3)
//         );
//         
//         btn.scale(0.3,0.3,0,0).attr('fill','#ff0000').attr('stroke','transparent');
//     
//     });
//     
// })(jQuery);





Bfa.buttons = {
    
    circle: "M57.312,0C25.66,0,0,25.66,0,57.312c0,31.655,25.66,57.313,57.312,57.313\
c31.654,0,57.314-25.658,57.314-57.313C114.627,25.66,88.967,0,57.312,0z M57.312,105.885c-26.825,0-48.572-21.746-48.572-48.573\
C8.74,30.487,30.487,8.74,57.312,8.74c26.826,0,48.573,21.747,48.573,48.572C105.886,84.139,84.139,105.885,57.312,105.885z",
    

    b1: "M83.178,52.786l-5.649-5.632v-14.15h-8.846v5.321l-9.287-9.27c-1.405-1.403-3.706-1.403-5.112,0\
l-23.781,23.73c-1.407,1.403-3.383,6.085,1.055,6.085l4.254-0.062v22.059c0,1.986,1.626,3.612,3.613,3.612H56.84V72.425\
c0-1.986,0.74-3.612,2.728-3.612h4.949c1.987,0,2.729,1.626,2.729,3.612v12.055h7.01c1.987,0,3.613-1.626,3.613-3.612v-22.06\
l4.254,0.063C87.873,58.871,84.584,54.189,83.178,52.786z",

    b2: "M85.923,55.715c0,13.133-12.606,23.778-28.158,23.778c-5.136,0-9.95-1.16-14.096-3.188l-14.03,7.814\
l6.357-13.32c-3.992-4.104-6.389-9.355-6.389-15.084c0-13.13,12.605-23.773,28.157-23.773S85.923,42.585,85.923,55.715z",

    b3: "M55.517,85.574c0.014-0.07,0.027-0.14,0.04-0.208c-0.202,0.098-0.373,0.147-0.525,0.17\
C55.192,85.551,55.354,85.562,55.517,85.574z M53.094,83.498c0.15-0.42,0.04-0.331,0.438-0.297\
c-0.166-1.306-0.758-2.336-1.269-3.297c0.1-0.398,0.199-0.798,0.298-1.197c-0.208-0.504-0.417-1.008-0.626-1.512\
c-0.193-1.047,0.168-3.271-0.436-4.706c-0.508-1.208-2.068-1.22-2.665-2.221c-0.221-0.715-0.441-1.431-0.661-2.147\
c-0.445-0.855-1.249-1.084-1.402-2.38c0.214-0.271,0.312-0.249,0.419-0.658c-1.109-0.569,0.623-2.48,0.848-2.865\
c-0.193-0.746-0.385-1.494-0.576-2.243c-0.031-0.027-0.063-0.057-0.096-0.084c-0.149,0.037-0.299,0.076-0.449,0.113\
c-0.073,0.341,0.035,0.238-0.156,0.465c-1.402-0.515-1.407-1.607-2.504-2.594c-1.189,0.299-1.057-0.808-1.787-1.086\
c-0.389,0.082-0.779,0.162-1.168,0.244c-0.787-0.563-1.576-1.127-2.365-1.69c0.121-0.88-1.18-4.413-1.813-4.995\
c-0.031,0.002-0.062,0.004-0.091,0.006c0.003,0.059,0.006,0.12,0.01,0.182c-0.27,0.861,0.717,2.543,0.815,3.32\
c-0.06,0.032-0.118,0.066-0.177,0.1c-0.441-0.531-0.854-1.451-1.201-2.026c0.117-0.098,0.232-0.194,0.349-0.292\
c-0.503-0.804-0.108-1.173-0.47-1.975c-0.256-0.229-0.51-0.458-0.765-0.688c-1.13-2.163,0.931-3.807,1.173-5.245\
c0.271-0.015,0.543-0.029,0.816-0.044c-0.008-0.121-0.014-0.242-0.02-0.363c-0.158-0.112-0.316-0.225-0.475-0.338\
c0.043,0.21,0.084,0.42,0.126,0.63c-0.299-0.132-0.39-0.147-0.569-0.425c-0.154-0.172-0.123-0.119-0.205-0.443\
c0.121-0.006,0.242-0.013,0.361-0.02c-0.043-0.815-0.088-1.632-0.131-2.447c-0.488-0.006-1.752-0.344-1.782-0.353\
c-3.652,4.788-5.825,10.765-5.825,17.251c0,14.744,11.206,26.871,25.566,28.328C53.859,85.238,53.896,83.747,53.094,83.498z\
 M83.803,47.561c0.071-0.566-0.037-1.309-0.146-1.732c-0.049-0.111-0.102-0.223-0.151-0.334c-0.621,0.223-1.577,0.343-2.001-0.082\
c-0.479-0.328-0.555-0.615-0.612-1.24c0.028-0.032,0.058-0.064,0.087-0.096c0.519-0.182,1.037-0.364,1.556-0.547\
c-0.288-0.525-0.596-1.037-0.915-1.541c-0.23,0.659-0.34,1.67-0.475,1.807c-0.371,0.232-1.059,0.406-1.437,0.35\
c0.214,0.749,0.481,0.656,0.351,1.436c-0.918-0.268-0.989-1.135-1.468-1.922c-0.69-0.416-1.379-0.834-2.068-1.252\
c-0.058,0.033-0.116,0.066-0.177,0.101c0.007,0.12,0.014,0.242,0.021,0.362c0.676,0.273,1.153,0.963,1.887,1.263\
c0.003,0.06,0.007,0.12,0.01,0.182c-0.324,0.212-0.336,0.583-0.592,0.85c-0.15-1.101-1.568-1.589-2.211-2.245\
c-0.691,0.121-1.142,0.347-1.79,0.552c-0.057,1.054-1.405,2.433-2.393,2.856c-0.381-0.23-0.519-0.332-1.198-0.299\
c0.026-0.093,0.051-0.185,0.075-0.277c-0.249-0.486-0.165-1.914,0.156-2.19c0.514-0.224,1.545-0.153,1.98-0.38\
c0.015-0.273,0.03-0.547,0.046-0.82c-0.349-0.285-0.698-0.569-1.047-0.854c0.984-0.047,3.037-1.517,3.524-2.1\
c-0.135-0.543-0.261-0.613-0.145-0.992c0.151-0.038,0.3-0.076,0.449-0.115c-0.042,0.66-0.119,0.676,0.15,1.084\
c0.061,0.026,0.123,0.053,0.186,0.08c0.841-0.137,1.683-0.271,2.524-0.408c0.153-0.742,0.344-0.783,0.79-0.847\
c-0.519-0.579-1.062-1.136-1.627-1.671c-0.203,0.164-0.364,0.334-0.349,0.762c0.386,0.098,0.286,0.035,0.472,0.339\
c-0.433,0.172-0.459,0.197-0.424,0.568c-0.183,0.47-0.306,0.634-0.963,0.688c-0.292-0.348-0.583-0.696-0.874-1.044\
c-0.3,0.249-0.304,0.372-0.792,0.497c-0.188-0.111-0.377-0.223-0.563-0.332c-0.031-0.506-0.021-0.359-0.136-0.812\
c0.973-0.736,1.669-1.35,2.373-1.795c-4.956-4.182-11.356-6.706-18.349-6.706c-7.847,0-14.951,3.175-20.103,8.309\
c0.008,0.001,1.502,0.13,2.161,0.2c0.644,0.069,1.155-0.438,1.698-0.546c0.723-0.144,1.434,0.018,2-0.018\
c1.27-0.075,5.53,0.881,6.623-0.265c-0.124-0.055-0.248-0.107-0.372-0.162c0.354-0.172,0.709-0.342,1.063-0.512\
c0.064,0.057,0.128,0.114,0.191,0.171c-0.089,0.288-0.113,0.276-0.062,0.55c0.638,0.001,0.336,0.063,0.649,0.237\
c0.404-0.364,0.698-0.484,1.34-0.437c0.008,0.121,0.014,0.242,0.021,0.363c-0.085,0.096-0.172,0.191-0.257,0.287\
c-1.879,0.293-4.352,1.148-5.047,2.545c0.002,0.03,0.004,0.06,0.006,0.09c0.738,0.245,1.428,0.742,2.324,0.967\
c-0.066,0.649,0.019,1.002,0.436,1.34c0.562-0.391,0.442-0.656,0.567-1.303c0.593-0.129,0.82-0.353,1.144-0.699\
c-0.223-0.693,0.326-1.316,0.628-1.852c0.843,0.193,1.327,0.035,1.853,0.627c-0.141,0.351-0.157,0.294-0.146,0.645\
c0.062,0.027,0.123,0.055,0.186,0.082c0.379-0.264,0.76-0.527,1.141-0.79c0.375,1.102,0.807,1.505,1.481,2.194\
c-0.781,1.383-3.073,0.804-4.174,1.861c0.002,0.03,0.003,0.061,0.005,0.092c0.505-0.146,0.799-0.36,1.351-0.256\
c-0.233,0.396-0.283,0.565-0.038,1.004c0.187,0.08,0.373,0.16,0.56,0.24c-0.027,0.062-0.054,0.125-0.081,0.188\
c-0.547,0.192-0.952,0.547-1.426,0.531c0.112-0.157,0.226-0.315,0.338-0.473c-0.031-0.029-0.064-0.057-0.096-0.086\
c-0.631,0.304-1.367,0.57-1.76,1.096c0.037,0.119,0.074,0.238,0.111,0.357c-1.062,0.191-1.712,0.875-1.999,1.744\
c-0.097-0.115-0.194-0.232-0.291-0.348c0.093,0.834,0.112,0.963-0.194,1.465c-0.861,0.395-1.469,1.128-2.088,1.749\
c0.124,1.036,0.652,2.623-0.336,2.2c-0.134-0.643-0.102-1.098-0.178-1.627c-0.629-0.154-1.38-0.225-2.006-0.073\
c-0.12,0.319-0.032,0.294-0.338,0.472c-2.707-1.023-3.024,2.942-2.385,4.677c1.067,0.315,1.451-0.247,1.84-1.282\
c0.363-0.02,0.727-0.039,1.089-0.059c0.005,0.09,0.01,0.182,0.015,0.273c-0.293,0.664-0.982,1.805-0.514,2.301\
c0.441-0.166,1.016-0.139,1.365,0.016c0.035,0.09,0.07,0.178,0.105,0.268c-0.259,0.861-0.329,2.097,0.409,2.523\
c0.252,0.099,1.714,0.164,1.914,0.079c0.112-0.865,0.872-1.392,1.64-1.634c-0.148,0.555-0.434,0.953-0.018,1.364\
c0.03-0.002,0.06-0.003,0.091-0.005c-0.107-0.609,0.103-0.684,0.3-1.199c1.071,0.232,1.195,0.57,2.472,0.323\
c0.62,1.687,2.451,1.849,3.688,2.62c0.269,0.502,0.538,1.003,0.807,1.504c-0.107,0.247-0.215,0.496-0.322,0.744\
c0.268-0.074,0.537-0.149,0.807-0.226c0.334,0.824,3.112,1.884,4.393,2.22c0.479,1.896-0.686,2.438-0.979,3.78\
c0.083,0.421,0.166,0.84,0.251,1.26c0.006,1.159-0.235,2.145-0.747,3.041c-1.947,0.186-1.485,2.228-1.891,3.74\
c-0.277,0.438-0.558,0.877-0.839,1.316c-0.396-0.039-0.79-0.077-1.188-0.117c0.378,0.401,0.697,0.57,0.884,1.225\
c-0.084,0.126-0.168,0.252-0.252,0.379c-0.388,0.111-0.775,0.223-1.164,0.336c-0.045,0.304-0.088,0.61-0.133,0.915\
c-0.212,0.012-0.424,0.022-0.635,0.034c0.219,0.343,0.502,0.584,0.418,0.979c-0.159,1.108-0.597,0.647,0.172,1.535\
c-0.188,0.514-0.472,0.772-0.479,1.209c0.069,0.178,0.14,0.356,0.21,0.534c0.051,0.022,0.101,0.044,0.15,0.065\
c0.543,0.031,1.089,0.051,1.64,0.051c9.014,0,17.043-4.193,22.262-10.729c-0.564-1.56-1.287-3.127-1.682-4.595\
c-0.329-1.226,0.405-2.132,0.573-2.851c0.401-1.716-1.313-4.19-2.082-4.889c0.441-0.719,0.419-1.653,0.05-2.458\
c-1.093,0.094-1.131-0.178-1.585-0.733c-0.936,0.075-1.057,0.587-1.69,0.728c-0.771,0.172-1.356-0.101-2.074,0.293\
c-0.918-0.322-1.528-0.956-2.203-2.064c-0.44-0.722-1.12-1.301-1.396-2.29c0.129-0.43,0.257-0.86,0.386-1.292\
c0.146-0.735-0.313-1.425-0.375-1.889c0.318-0.837,0.638-1.671,0.955-2.508c0.103-0.124,0.812-0.574,1.126-1.06\
c0.288-0.443,0.026-0.648,0.208-1.195c0.396-0.535,0.792-1.072,1.187-1.609c1.408,0.084,3.61-1.422,4.964-0.721\
c0.095,0.594,0.037,1.125,0.168,1.445c1.264,0.115,1.845,0.691,2.961,0.932c0.057-0.064,0.113-0.127,0.171-0.191\
c-0.013-0.241-0.026-0.482-0.039-0.725C81.059,47.26,82.249,47.98,83.803,47.561z M47.013,36.447\
c-0.662,0.098-1.324,0.193-1.985,0.289c-0.002-0.029-0.004-0.06-0.006-0.09c0.057-0.095,0.111-0.188,0.168-0.283\
c-0.034-0.059-0.066-0.116-0.101-0.176c0.06-0.003,0.12-0.006,0.181-0.01c0.674-0.554,1.967-0.172,2.697-0.6\
c0.162,0.234,0.328,0.469,0.49,0.701C47.981,36.473,47.574,36.743,47.013,36.447z M46.032,35.137\
c0.206-0.102,0.413-0.205,0.62-0.307c0.545,0.117,1.656,0.129,2.019,0.346c0.002,0.031,0.004,0.061,0.005,0.092\
C47.486,35.485,46.652,35.549,46.032,35.137z M48.084,54.668c-0.139-0.746-1.301-1.175-2.139-0.885\
c0.083-0.156,0.165-0.312,0.248-0.468c0.118-0.036,0.237-0.073,0.357-0.111c0.99,0.058,1.887,0.69,2.607,1.133\
c-0.088,0.065-0.176,0.132-0.264,0.196C48.625,54.578,48.354,54.623,48.084,54.668z M51.025,55.238\
c-0.557-0.063-1.174,0.299-1.909,0.01c-0.002-0.029-0.003-0.06-0.005-0.09c0.149-0.039,0.299-0.077,0.447-0.115\
c-0.009-0.181-0.019-0.362-0.028-0.544c0.836-0.048,1.079,0.173,1.57,0.462C51.075,55.053,51.051,55.145,51.025,55.238z\
 M55.318,33.637c1.037-0.29,2.268,0.052,2.981-0.342c0.184,0.02,0.366,0.04,0.55,0.061c0.032,0.059,0.066,0.117,0.1,0.176\
c-0.061,0.004-0.12,0.008-0.181,0.01c-0.693,0.569-5.44,1.245-5.765,1.039C53.002,34.549,53,34.519,53,34.488\
C53.883,34.274,54.602,33.837,55.318,33.637z M54.479,34.955c-0.058,0.062-0.114,0.127-0.172,0.191\
c-0.634-0.156-2.128,0.469-2.563-0.318C52.572,34.824,54.004,34.729,54.479,34.955z M57.201,36.535\
c-0.714,0.539-0.913,0.256-1.613,0.451c0.322,0.422,0.283,0.494-0.247,0.469c0.002,0.029,0.003,0.06,0.005,0.09\
c0.068,0.118,0.135,0.235,0.201,0.354c-0.182,0.01-0.362,0.02-0.544,0.029c-0.577-0.117-1.957-0.098-2.215-0.609\
c0.06-0.002,0.12-0.006,0.182-0.01c0.694-0.332,1.22-0.463,1.773-0.822c-0.097-0.116-0.194-0.231-0.292-0.349\
c-0.733-0.165-2.165-0.198-2.91-0.024c-0.006-0.121-0.014-0.242-0.02-0.363c0.086-0.095,0.172-0.19,0.258-0.287\
c0.148-0.037,0.299-0.076,0.447-0.113c0.092-0.006,0.182-0.01,0.273-0.016c0.007,0.151,0.015,0.303,0.023,0.453\
c1.477-1.133,3.693-0.189,4.859,0.738C57.323,36.529,57.262,36.532,57.201,36.535z M61.521,37.395\
c-0.058,0.435-0.091,0.797-0.574,1.123c-0.423-0.221-0.555-0.27-1.018-0.31c-0.239-0.503-0.479-1.005-0.718-1.508\
c0.309-0.301,0.302-0.345,0.867-0.774c-0.28-0.201-0.178-0.106-0.64-0.057c0.057-0.094,0.111-0.188,0.168-0.281\
c0.221-0.12,0.092,0.053,0.171-0.191c-0.305-0.152-0.148-0.229-0.221-0.715c-0.7-0.047-1.113-0.2-1.909,0.012\
c-0.002-0.03-0.003-0.061-0.003-0.091c0.024-0.093,0.049-0.185,0.074-0.276c0.781-0.361,3.468-0.395,4.409-0.875\
c2.038-0.111,4.494,0.029,6.079-0.236c-0.02,0.213-0.037,0.428-0.057,0.64c-0.767,0.294-0.589,0.56-1.599,0.724\
c-0.027,0.031-0.056,0.062-0.084,0.094c0.207,0.168,0.301,0.192,0.649,0.238c-0.028,0.062-0.056,0.125-0.081,0.188\
C65.741,35.315,61.841,37.037,61.521,37.395z M68.479,36.564c-0.537,0.15-1.074,0.301-1.612,0.451\
c-0.349-0.141-0.486-0.15-0.664-0.51c0.06-0.033,0.118-0.067,0.177-0.101c0.517-0.058,1.04,0.054,1.621-0.269\
c0.414,0.057,0.317,0.066,0.56,0.242C68.533,36.44,68.507,36.503,68.479,36.564z M71.207,38.236c0.12-0.006,0.241-0.013,0.361-0.02\
c0.176,0.707,0.82,1.168,1.383,2.018c-0.269,0.229-0.223,0.036-0.163,0.372c-0.569,0.122-1.139,0.243-1.708,0.364\
c0.056-0.093,0.112-0.188,0.167-0.281c0.089-0.035,0.178-0.07,0.267-0.105c-0.222-0.297-0.181-0.279-0.306-0.619\
c0.178-0.07,0.356-0.141,0.534-0.211c-0.377-0.436-0.621-0.301-0.698-1.145C71.099,38.485,71.153,38.361,71.207,38.236z\
 M69.872,40.491c-0.002-0.03-0.004-0.061-0.006-0.091c0.132-0.342,0.11-0.342,0.049-0.82c0.437-0.101,0.41-0.123,0.614-0.396\
c0.316,0.109,0.285,0.107,0.474,0.338c-0.084,0.34-0.084,0.538-0.323,0.744C70.411,40.341,70.142,40.416,69.872,40.491z\
 M77.057,45.561c-0.193-0.124-0.244-0.149-0.382-0.344c0.304,0.014,0.606,0.028,0.911,0.042c0.002,0.03,0.002,0.061,0.004,0.091\
C77.391,45.484,77.419,45.491,77.057,45.561z M85.05,49.824c-0.305-0.448-0.611-0.828-0.913-1.1\
c-0.029,0.002-0.06,0.004-0.089,0.006c0.006,0.12,0.013,0.24,0.02,0.362c-0.225-0.23-0.449-0.46-0.675-0.69\
c0.185,0.769,1.199,2.569,2.266,4.287C85.504,51.717,85.3,50.762,85.05,49.824z"
    
}