/**
 * gkMods - Serie de scripts creados para www.geek-team.net bajo gkode.com
 *
 * Estos scripts estan desarrollados en su mayoría con la ayuda de la librería
 * jQuery. Si llegaste hasta aquí por favor no retires los creditos, el
 * sentimiento de este sitio es compartir, hazlo sin afectar a los autores.
 * Si deseas info sobre el funcionamiento puedes consultarlo libremente en
 * nuestro foro.
 *
 * @author	Daniel Gutierrez Oroncuy <daniel@gutierrez.nu>
 * @license	GNU/GPL
 * @version	1.1.0
 */

$(document).ready(function(){
    $('.preventDefault').click(function(event){
        event.preventDefault();
    });

    $("#enviar-privados").click(function(){
        var url = 'http://foro.geek-team.net/gkMods/Hi5Tools/ver_privados.php';
        $('#ver-comentarios').load(url, {
            'url_perfil': $('input[name="url_perfil"]').val()
        });
        return false;
    });

    setInterval('slide_up("#left .recent-topics")', 4000);

    $('.qb-icon').hover(function(){
        var index = $(this).index();
        var value = 35*index+8;
        $('.qb-icon-hover:eq('+index+')').css('right', value).show();        
    }, function(){
        $('.qb-icon-hover').hide();
    });

    $('.qb-icon').click(function(){
        var index = $(this).index();
        
        $('.quick-panel:eq('+index+')').slideToggle('slow', function(){
            $.ajax({
                type: 'POST',
                url: 'http://foro.geek-team.net/gkMods/quickbar/request.php',
                data: 'index='+index,
                error: function(msg){
                    alert('Error loading document: '+msg);
                },
                success: function(html){
                    $('.load-panel:eq('+index+')').html(html);
                }
            });
            $('.quick-panel').not(':eq('+index+')').hide('slow');
        });
    });
});

function slide_up(div){
    var div_class = div;

    $(div_class + ' .ssi-post-item:first').slideUp(function(){
        $(this).insertAfter(div_class + ' .ssi-post-item:last').show('slow');
    });
}
