$(function() {



//	$('body.home .entry-content object, .entry-content embed').width($(this).parent('div').width()).height(120)
	$('body.home .entry-content object, .entry-content embed').each(function(){
//		console.log($(this).parents('div').width())
		$(this).width($(this).parents('div').width())	
		$(this).height($(this).parents('div').width() * .6)	
	})

//	console.log($('.gal').offset().top)
//
//	$('.second').css('position','absolute').css('left',106)
//
//	$('.customtext').draggable();
//
//	$('.info').click(function() {
//		$('.customtext').each(function(i){
//			$(this).show().css('top',$('.gal').position().top).css('left', $('.gal').position().left + (i)*320)
//		});
//	})
//
//	$('.post object,.post embed,.post 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();
//	})
	
	var thumbsdimension = 150;
//	var thumbsdimension = 50;
	
	$('.gal').cycle({ 
		fx:      'fade',
		speed:   140, 
		timeout: 0,
		pager: '.thumbs_all',
		prev: '.prev',
		
		pagerAnchorBuilder: function(idx, slide) {
			var arquivo = $(slide).attr('src');
			return '<a href="#"><img src="' + arquivo.substring(0,arquivo.length-4) +'-'+thumbsdimension+'x'+thumbsdimension+ arquivo.substring(arquivo.length-4, arquivo.length)+ '" width="50" height="50" class="thumbnail" style="border:0px;margin-right:1px"></a> ';
		},
		
		next:   '.gal,.next' 
	})		


//	
//	$('div.topo').prepend('<span class="close"></span>');
//	
//	$('.close').live('click',function() {
//		$(this).parents('.customtext').hide()
//	})	
});
 
