$(document).ready(function() {

	//Skitter
	$('.box_skitter_large').skitter({
		velocity: 1,			//sebesség
		interval: 2500,			//váltás közti idő
		//animation: null,		//animáció
		numbers: false,			//szám kijelzés
		navigation: true,		//navigáció
		label: true,			//feliratozás
		//easing_default: null,	//mozgatás típusa
		thumbs: true			//kisképek
	});
	
	$('.more_link').corner('4px');
	$('.rounded').corner('4px');
	$('.sidebar_blog_footer .arrows').corner('keep 16px');
	$('#menu ul li a').corner('4px');
	$('#footer_menu ul li a').corner('4px');
	
	$('.main_show_menu ul li').click(function() {
		if (!$(this).hasClass('nopadding')) {
			$('div.show_tartalom').css('display','none');
			$('div.main_show_'+$(this).find('div').attr('class')).css('display','block');
			$('.main_show_menu ul li').removeClass('active');
			$(this).addClass('active');
		}
	});
	
	$('#trail').append($('#trailtext').html());
	$('#trailtext').remove();
	
	//setTimeout('skitterSize()', 2000);
	
	
	/*$('.box_skitter_large .image a').click(function() {
		CB_Open("href="+$(this).attr('href')+",,title="+$(this).attr('title'));
		return false;
	});
	$('.box_skitter_large .box_clone a').click(function() {
		CB_Open("href="+$(this).attr('href')+",,title="+$(this).attr('title'));
		return false;
	});*/
	
	$('.ajanlatkeres_box input, .ajanlatkeres_box textarea').focus(function() {
		$(this).addClass('active');
	});
	$('.ajanlatkeres_box input, .ajanlatkeres_box textarea').focusout(function() {
		$(this).removeClass('active');
	});
	
	/*$(".ajanlatkeres_box input[name='field[1]']").focus();
	$(window).scrollTop('0');*/
	
	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});

function skitterSize() {
	var width_image = 0;
	
	$('.info_slide_thumb').find('.image_number').each(function(){
		width_image += $(this).width() 
					+ parseInt($(this).css('marginLeft')) 
					+ parseInt($(this).css('marginRight')) 
					+ parseInt($(this).css('paddingLeft')) 
					+ parseInt($(this).css('paddingRight'));
	});
	
	$('.info_slide_thumb').css('width', width_image+'px');
	$('.info_slide_thumb').css('left', '0px');
}
