
');
var f = function ()
{
var el = $(this);
if(el.data('iterator'))
{
el.removeClass('bgcolor');
}
else
{
el.addClass('bgcolor');
}
el.data('iterator', !el.data('iterator'));
}
el.data('timer', setInterval($.proxy(f, el), 700));
}
}
}
function IDunread(clear)
{
var all = $('#idlastcom table');
unread = all.filter(function (){var id=$(this).attr('id');return (readen.indexOf(id)==-1)});
if(clear=='clear' || unread.length==all.length || !unread.length)
{
if($(document).attr('default-title'))
{
document.title = $(document).attr('default-title');
}
all.map(function ()
{
var id = $(this).attr('id');
if(readen.indexOf(id)==-1)
{
readen.push(id);
}
});
return 0;
}
else
{
window['last_messages'] = unread;
return unread.length;
}
}
function IDupdate()
{
if(!preference('livestats')) return;
$.getScript('http://st'+'atic.minilua.com/live/id.js');
}
function striptags(str){return str.replace(/<\/?[^>]+>/gi, '')}
function tray_pos()
{
// Top tray
if(!window['jQuery']) return 0;
var t = document.getElementById('tray');
var s = parseInt(t.style.top.replace('px',''));
if(window['isNaN'] && isNaN(s)) s = 0;
if(getScrollTop()>=13)
{
if(s<=-43)
{
t.style.top = '0px';
}
}
else
{
if(s==0 && !IDunread())
{
s = tray_pos;
tray_pos = function (){};
t.style.top = '-43px';
IDclose();
tray_pos = s;
}
}
}
function _time()
{
return ((new Date()).getTime()/1000);
}
function luvUpdate()
{
if(!preference('livestats')) return;
if(luvUpdatingTimeout) clearTimeout(luvUpdatingTimeout);
luvUpdating = _time();
luvUpdatingTimeout = setTimeout(function (){luvUpdating=0}, 10000);
$.getScript('http://st'+'atic.minilua.com/live/raw.js');
}
function loadPWhere()
{
if(loadPCur.indexOf('/page/')!=-1)
{
loadPCur = (loadPCur.split('/page/')[0]+'/page/'+(parseInt(loadPCur.split('/page/')[1])+1)+'/');
}
else
{
if(loadPCur.indexOf('/categor')!=-1)
{
loadPCur = loadPCur+'page/2/';
}
else if(loadPCur.indexOf('/search/')!=-1)
{
loadPCur = loadPCur+'page/2/';
}
else
{
loadPCur = loadPCur.split('#')[0].split('?')[0]+'page/2/';
}
}
return loadPCur;
}
function loadPNext(url)
{
if(!url||typeof url!='string') url = loadPWhere();
loadPLastURL = url;
var o = $('#content div.radiusbottom').eq(0);
if(o.html().indexOf('Voltar para a ')==-1)
{
o.html('
').css('cursor','progress');
$.ajax({url:url, cache:true, complete:loadPComplete});
}
}
function loadPComplete(req, state)
{
if(!req || req.status!=200 || req.responseText.indexOf('server_error.html')!=-1)
{
return setTimeout(function (){loadPNext(loadPLastURL)}, 1500);
}
var data = req.responseText;
var tpl = '
', 'Suba rapidamente para o topo da página', function (){window.scrollTo(0,0)}, false, 'topo');
var busca = tray('Pesquisar
', 'Faça uma pesquisa', function (){$('#idlastcom #q').get(0).focus()}, false, 'pesquisa');
var papo = tray('Papo
', 'Acompanhe ao vivo os comentários dos leitores no site!', function (){if(!$('.idlastcomblock').length)IDupdate();return IDshow();}, false, 'papo');
$('#idlastcom').add(papo).add(busca).hover(show_idc, hide_idc);
connect_tray(preference('livestats'));
/* Lazy elements */
$('.lazy').lazy();
/* Background for higher resolutions */
if($(window).width()>1100)
{
var b = $('html,body').css('background-color').toLowerCase();
if(b.indexOf('fff')!=-1||b.indexOf('255')!=-1)
{
$('#mainbody').css('background','transparent url('+m_uri+'imagens/bgmark.png) no-repeat fixed center bottom');
}
}
/* "atload" events */
if(window['atload'])
{
window['atload'] = getUnique(window['atload']);
for(var i=0;iCopyright© 2011 Modificado por APETTE FORN GAMES