$(document).ready(function() {
	$("ul#shownews-view").cycle({
		fx: 'blindY',
		pager: 'ul#shownews-preview',
		pagerAnchorBuilder: function(idx, slide){
			return 'ul#shownews-preview li:eq(' + idx + ') a'; 
		},
		speed: 'slow',
		before: function(){
			$(this).parent().find('li.current').removeClass();
		},
		after: function(){
			$(this).addClass('current');
			$('ul#shownews-preview li.current').removeClass();
			$('ul#shownews-preview li:eq(' + $(this).index() + ')').addClass('current');
		}
	});
	$('ul#shownews-preview li:eq(0)').addClass('current');
	
	$('a#showtop').click(function(){
	     $('html, body').animate({scrollTop: '0px'}, 300);
	     return false;
	});
	
	/*$('li.primary ul.sub-menu li.current-post-parent').closest('ul').show();
	$('li.primary a.primary').mouseover(function(){
		$('li.primary ul.sub-menu li.current-post-parent').closest('ul').hide();
	});*/
	
	/*	
	$('img.captchahelp').mouseenter(function(){
		$('div.captchahelpcontent')
			.show()
			.css('left', $(this).offset().left - 22)
			.css('top', $(this).offset().top - 40)
		;
	});
	
	$('img.captchahelp').mouseout(function(){
		$('div.captchahelpcontent').hide();
	});*/
	
	$('input#querysearch').focus(function(){
		if($(this).attr('rel') === $(this).attr('value')){
			$(this).attr('value', '');
		}
	});
	
	$('input#querysearch').blur(function(){
		if($(this).attr('value') == ''){
			$(this).attr('value', $(this).attr('rel'));
		}
	});
	
});


