var banana = function(){
	// vars

	// funcs

	// return funcs
    return {
        start_home: function(){
			$('#slider').cycle({
		        fx: 'scrollLeft',
		        easing: 'easeOutElastic'
		    });

            $('#clients div.wrapper').cycle({
                fx: 'fade',
                timeout: 30000
            })
		},


		scrollable: function(){
            if($('#flowpanes').length > 0){
                $('#flowpanes').scrollable({
                    size: 1,
                    clickable: false
                }).circular().navigator({
                    activeClass: 'current',
                    navi: '#flowtabs',
                    naviItem: 'a'
                });
            }
		},


        slotmachine: function(){
            no_columns = $('#clients > div').length;
            height = parseInt($('#clients .col1').css('height'));
            size = new Array();

            for(i = 1; i <= no_columns; i++){
                size[i] = $('#clients div.col'+i+' div.wrapper > div').length;
            }

            $('#slotmachinebutton div.button').click(function() {
                if($("#clients :animated").length == 0) {
                    for(i = 1; i <= size.length; i++){
                        if(size[i] > 1){
                            speed = Math.floor((Math.random()*1000)) + 400;
                            current = $('#clients .col'+i+' .wrapper .current');
                            current_num = current.attr('id').replace('c'+i+'_', '');

                            next = current_num;
                            while(next == current_num) next = Math.floor(Math.random() * size[i]) + 1;

                            next = $('#clients .col'+i+' .wrapper #c'+i+'_'+next);
                            next.css('top', height).animate({'top': 0}, speed).addClass('current');
                            current.animate({'top': -height}, speed);
                            current.removeClass('current');
                        }
                    }
                }
            });
        },

        mailto: function(){
            var element = $('#eml');
            var email = element.html().replace(/\s*\(.+\)\s*/, "@");
            element.html(email);
        },
    };
}();
