	$(function() {
		$('.paginacao').parent('a').wrap('<div class="post grad sectiontitle nextprev"></div>')
		$('#artists').change(function() {
			if ($(this).val() != '')
				location = ($(this).val());
		});


//$('.timex').each(function(){
//	words = $(this).text().split(' ');
//	if (words[0].length == 1)
//		words[0] = '0'+words[0]
//	$(this).html('<h1>'+words[0]+'</h1> ' +words[1]+' '+words[2] );
//})


		html = ''
		//body[id!=FEED] 
		$('.page, .singlepost').each(function(i, item) {
			neue = $(this).html().split('<!--more-->')
			//if (neue.length > 1) 
			{
				$(this).after('<table cellpadding=0 cellspacing=0 width="100%" border=0><tr><td width=603 valign="top"><div class="c0"></div><td width="468" valign="top"><div class="c1"></div></table>')
				
				$.each(neue,function(n, nn) {
					target = '.c'+n%2
					target = '.c'+parseInt(n/neue.length*2.0)
					$(target).append('<div class="post ">'+nn+'</div>')
				})
				$(this).after(html).remove();
			}
		})


		
		
		$('ul').find('.page_item:last').addClass('last_item') //.css('backgroundColor','red')
		$('#nav').css('top', $('#bigtop').offset().top + 220 ).css('left', $('#bigtop').offset().left + 940)
		
		$('#bigtop').show().cycle({
			fx:     'scrollHorz',
		    speed:   400,
//		    nowrap: 1,
		    timeout: 5000, //5000
			pager:  '#nav',
		    pagerAnchorBuilder: function(idx, slide) { 
	       		return '<a href="#">&#149;</a> ';
		    } 					
		});
	
//&#149;	
	
		html = '';
		hasgallery = false;
		$('.gallery').each(function(i){
			hasgallery = true;
			$(this).find('a').each(function(i){
				html += '<img src="'+$(this).attr('href')+'">';
			})
			$(this).after('<div class="thumbs"></div><div class="gal">'+html+'</div>').remove();
		})

		if (hasgallery)
		$('.gal').cycle({ 
			fx:      'fade',
			speed:   140, 
			timeout: 0,
			pager: '.thumbs', 
			pagerAnchorBuilder: function(idx, slide) {
				var arquivo = $(slide).attr('src');
				return '<a href="#"><img src="' + arquivo.substring(0,arquivo.length-4) +'-150x150'+ arquivo.substring(arquivo.length-4, arquivo.length)+ '" width="90" height="90" class="thumbnail"></a> ';
			}
		})	

		// isso aqui vai ter q ser fixado depois
		$('.category-videos:last').after($('.nextprev'))


		$('.multiple object,.multiple embed,.multiple img').each(function() {
			nw = $(this).parents('div').width(); //170

			if (nw < $(this).attr('width')) {
				height = $(this).attr('height') * nw  / $(this).attr('width')
				$(this).attr('width', nw).css('width', nw).css('max-width', nw)
				$(this).attr('height', height).css('height', height).css('max-height', height)
			}
			$(this).show();
		})		
	


		$('.euvou').bind('click', function() {
			$('#emails #noite').val($(this).parents('.post').find('.time').text())
			$('#emails #permalink').val($(this).attr('permalink'));
			$.blockUI({ 
				message: $('#emails')
				,
				css: { 
					border: 'none', 
					padding: '15px', 
					backgroundColor: '#333',
					color: 'white',
					width: '500px'
				} 
			});
			$('.blockOverlay').click($.unblockUI);//.attr('title','Click to unblock')
		});


		$('#emails #enviar').click(function() {
			$.post(root+"_lista.php", $('#emails form').serialize(), function(msg) {
				if (msg == 'yes')
					$('#emails').html('Enviado com sucesso');
			});
		})

		$('.post').wrapInner("<div></div>");
		
		$('body').show();
		
	});

