function fecharModal(pagina) {	
	var url = pagina;
	//alert(url);
	window.top.location.href=url;
	window.parent.Shadowbox.close();
	
}

function abrirModal(id) {
    abrirSB('iframe', '', 'scraps.php', 520, 585, 520, 585, '');	
    return false;
}
function abrirSB(type, title, url, iframeHeight, iframeWidth, height, width, caminho) {

    var isIE6 = ((navigator.userAgent.indexOf("MSIE 6.") != -1) && (navigator.userAgent.indexOf("Opera") == -1));

    if (isIE6)
        iframeHeight = iframeHeight + 20;

    Shadowbox.iframeHeight = iframeHeight;
    Shadowbox.iframeWidth = iframeWidth;
    Shadowbox.caminho = caminho;

    Shadowbox.init({ skipSetup: false, iframeHeight: iframeHeight, iframeWidth: iframeWidth });
    Shadowbox.open({ type: type, title: title, content: url, width: width, height: height });
};

$( function()
{
    var sidebar = $("div#premios"),
        scroll = function()
        {
            var btNext = $( ".bt_next", sidebar ),
                btPrevious = $( ".bt_previous", sidebar ),
                ul = $('ul', sidebar),
                n = 0,
                p = 0,
                lis = $('li', ul),
                count = lis.length,
                page = Math.floor( count / 5 );
            
            btNext.click(function()
            {
                if(p == page)
                    return false;
                    
                n = n + 225;
                
                p = p + 1;
                
                ul.animate(
                {
                    top: '-' + n + 'px'
                }, 400 );

                return false; 
            });
            
            btPrevious.click(function()
            {
                if( p == 0 )
                    return false;
                    
                n = n - 225;
                
                p = p - 1;
                
                ul.animate(
                {
                    top: '-' + n + 'px'
                }, 400 );
                
                return false;
            }); 
        };   
        
     scroll();
});   
