window.addEvent('domready',function(){
    ThumbHover();
    test3();
    var myMenu = new MenuMatic();
    HideShow();
    CaseStudyImgHover();


    //test();
    //test2();
});

function test3(){
    if($('pods')){
        $('pods').getElements('div.pod').each(function(e){
                //var fx = e.effect('height', {transition: Fx.Transitions.Quint.easeOut});
            e.addEvent('mouseenter',function(){
                e.tween("height",[220,280]);
            });

            e.addEvent('mouseleave',function(){
                e.tween("height",[280,220]);
            });
        });
    }
}

function HideShow(){
    if($('work-list')){
        var myid = $('bt-expander');
        myid.addEvent('click',function(e){
            var myFx = new Fx.Slide('thumb-list', {
                duration: 1000,
                transition: Fx.Transitions.Pow.easeOut
            });

            myFx.toggle();
            $('thumb-list').setStyle('display','block');
        });
    }
}

function CaseStudyImgHover(){
    if($('posts')){
        var myid = $('posts');
        myid.getElements('div.portfolio_crop').addEvent('mouseover',function(e){
            this.removeClass('portfolio_crop').addClass('portfolio_crop_hover');
        });

        myid.getElements('div.portfolio_crop').addEvent('mouseout',function(e){
            this.removeClass('portfolio_crop_hover').addClass('portfolio_crop');
        });
    }
}

function ThumbHover(){
    if($('thumbs')){
        var myid = $('thumbs');
        myid.getElements('a.thumb').addEvent('mouseover',function(e){
            this.removeClass('thumb').addClass('thumbHover');
        });

        myid.getElements('a.thumb').addEvent('mouseout',function(e){
            this.removeClass('thumbHover').addClass('thumb');
        });
    }
}


/*
function test2(){
    $('pods').getElements('div.pod').each(function(e){
            var fx = e.effect('height', {transition: Fx.Transitions.Quint.easeOut});
        e.onmouseover = function() {
        fx.stop();
        fx.setOptions({duration: 500});
        fx.start(280);
        };

        e.onmouseout = function() {
        fx.stop();
        fx.setOptions({duration: 2000});
        fx.start(180);
        };
    });
}

function test(){
        //var myEffect = new Fx.Morph('PodLeft', {duration: 1000, transition: Fx.Transitions.Quint.easeOut});
          /*$('PodLeft').addEvent('mouseover',function(e){
              myEffect.start({
              'height': [180, 280], //Morphs the 'height' style from 10px to 100px.
          });
        });
        $('pods').getElements('div.pod').each(function(e){
            //var myFx = e.effect('height', {transition: Fx.Transitions.Quint.easeOut});
            var myEffect = new Fx.Morph(e, {duration: 1000, transition: Fx.Transitions.Quint.easeOut});

            e.addEvent('mouseenter',function(){
                myEffect.start({
                    'height': [180, 280], //Morphs the 'height' style from 10px to 100px.
                });
                e.addClass('active');
                //ResetAll(myEffect);
            });

            e.addEvent('mouseleave',function(){
                if(e.hasClass('active')){
                    myEffect.start({
                    'height': [280, 180], //Morphs the 'height' style from 10px to 100px.
                    });
                    e.removeClass('active');
                }

            });
        });
    }

    function ResetAll(obj){
        $('pods').getElements('div.pod').each(function(e){
            if(!e.hasClass('active')){
                obj.start({
                'height': [280, 180], //Morphs the 'height' style from 10px to 100px.
                });
                e.removeClass('active');
            }
        })
    }
*/