$(function(){

    if( !$.browser.msie ){
        $('#label_bhb').each(function(){
            $(this).append('<div class="drop"><div class="drop_1"></div><div class="drop_2"></div><div class="drop_3"></div></div>');
            for( i=1; i<=3; i++ ){
                $('.drop_'+i).animate({ height: (i*10)+'px'}, 1500 );
            }
        });
        boxEffect();
    }

});

function boxEffect() {

    var boxNum = $('.box').size();

    $('.box').each(function(){
        $(this).css('z-index',(boxNum));
        boxNum--;
        var a = new Array(1,2,3,4,5);
        num = a.shuffle();
        $(this).append('<div class="drop"><div class="drop_'+num[0]+'"></div><div class="drop_'+num[1]+'"></div><div class="drop_'+num[2]+'"></div></div>');
        $(this).find('div.drop').attr('id',$(this).css('border-top-color')).find('div').css('background',$(this).css('border-top-color'));
        for( i=0; i<=5; i++ ){
            $('.drop_'+i).animate({ height: (i*10)+'px'}, 1500 );
        }
    }).hover(function(){
        $(this).find('div.drop div').css('background-color','#D831AE');
    }, function(){
        $(this).find('div.drop div').css('background-color',$(this).find('div.drop').attr('id'));
    });

}

function slowdownScroll() {

    if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
        sctop = document.body.parentNode.scrollTop;
    }else if(window.pageYOffset){
        sctop = window.pageYOffset;
    } else {
        sctop = document.body.scrollTop;
    }

    if(sctop){
        scup = Math.ceil(sctop*.2);
        scrollBy(0,-scup);
        if (sctop-scup) setTimeout("slowdownScroll()",15);
    }
}

Array.prototype.shuffle = function(){
    var i = this.length;
    while(i){
        var j = Math.floor(Math.random()*i);
        var t = this[--i];
        this[i] = this[j];
        this[j] = t;
    }
    return this;
}
