// jQuery

$(function(){
	
	$('ul.abandu-ads li:odd').addClass('odd') // Add the odd class to every 2nd banner
	
	$('.widget:last').css('border-bottom', 'none') // Remove the border on the last sidebar widget
	$('.related-posts-thumbs li:last').css('margin-right', '0') // Remove the right margin on the last related post thumbnail
	
	
	
	// Hover effect in sidebar on list elemets without the <img> tag within
	/**
	$("#sidebar li:not(:has(img))").hover(function(){
		$(this).stop().animate({
			paddingLeft: "25px"
		}, 400);
	}, function() {
		$(this).stop().animate({
			paddingLeft: "15px"
		}, 400);
	});
	**/
   
	// Add the current class to the menu parent when it have children and you rollover it 
	
	$("ul#menu li:has(ul)").hover(function(){
		$(this).addClass('current')
		
	}, function() {
		$(this).removeClass('current');
	});

	// add click to top image in post
	$("img.wr-top").click(function(){
		if ($('body.single').is('body'))
			$(this).removeClass('wr-top');
		else
			location.href = $(this).closest('div.post').find('a:first').attr('href');
	});
	
	if ($('#lays_banner').is('img'))
	{
		var laysImage = 0;
		setInterval(function(){
			var current =  $('#lays_banner').attr('src').replace('_'+laysImage, '_');
			laysImage++;
			if (laysImage == 4)
				laysImage = 0;			
			$('#lays_banner').attr('src', current.replace('_.', '_'+laysImage+'.'));
		}, 5000);
	}
	// style archive select
	//$("select[name='archive-dropdown']").sSelect({ddMaxHeight: '300px'});
});