jQuery(document).ready(function(){
	
	$('.accordion').hide();
	$('.accordion_button').live('click', function(e) {
		$(this).closest('.accordion_container').find('.accordion').slideToggle('fast');
		e.preventDefault();
	});
	
        $('div.fslider_control a.fslider_button:not(.active)')
	.live('mouseover', function() {
		$(this).fadeTo(250,1);
	})
	.live('mouseout', function() {
		$(this).fadeTo(250,0.8);
	})
	.live('click', function() {
		$('div.fslider_control a.active').removeClass('active').fadeTo(250,0.8);
		$(this).addClass('active').fadeTo(250,1);
		var getrel = $(this).attr('rel');
		$('div.fslider_content').empty();
		$('div.fslider_content').html('<img src="' + getrel + '" width="928px" height="300px" alt="" id="fslider_mainpicture" />');
		$('#fslider_mainpicture').fadeTo(250,0.8);
		$('#fslider_mainpicture').fadeTo(250,1);
	});
	
	$('ul.gallery_pics li a img').mouseover(function() {
		$(this).animate({opacity:0.8},{duration:50,queue:true});
		$(this).animate({opacity:1},{duration:250,queue:true});
	});
	/*
	if ( $('div.media_thcontainer ul li').length > 5 ) { $('div.media_thcontainer a.thcontainer-right').show(); }
	var left_pos = -4;
	
	$('div.media_thcontainer a.thcontainer-left').live('click', function(e) {
		if ( left_pos < -124 ) {
			$(this).parent().find('a.thcontainer-left').show();
			$(this).parent().find('a.thcontainer-right').show();
		} else {
			$(this).parent().find('a.thcontainer-left').hide();
			$(this).parent().find('a.thcontainer-right').show();
		}

		$(this).closest('div.media_thcontainer').find('ul').animate(
			{ left: '+=120' },
			500,
			"linear",
			function(){
				//hmm
			});
		left_pos += 120;

		e.preventDefault();
	});
	$('div.media_thcontainer a.thcontainer-right').live('click', function(e) {
		if ( left_pos > ( -4 - ( $(this).parent().find('ul li').length - 6 ) * 120 ) ) {
			$(this).parent().find('a.thcontainer-right').show();
			$(this).parent().find('a.thcontainer-left').show();
		} else {
			$(this).parent().find('a.thcontainer-right').hide();
			$(this).parent().find('a.thcontainer-left').show();
		}

		$(this).closest('div.media_thcontainer').find('ul').animate(
			{ left: '-=120' },
			500,
			"linear",
			function(){
				//hmmm
			});
		left_pos -= 120;

		e.preventDefault();
	});
	*/
	/*$('a.link_gmaps').live('click', function(e) {
		e.preventDefault();
	}); 
	$('a.link_gmaps').live('mouseover', function() {
		var tooltip_offset = $(this).offset();
		var tooltip_content = $(this).find('span').html();
		$('#tooltip_content').html(tooltip_content);
		$('#tooltip_gmaps')
			.hide()
			.css('left',tooltip_offset.left-266)
			.css('top',tooltip_offset.top-238)
			.fadeIn('normal');
	}); 
	$('a.link_gmaps').live('mouseout', function() {
		$('#tooltip_gmaps')
			.hide()
			.css('left','-9999px')
			.css('top','-9999px');
	});*/

        $("a[rel=fooldal]").live("mouseover", function(){
              $(this).fancybox({
                'transitionIn'		: 'none',
                'transitionOut'		: 'none',
                'titlePosition' 	: 'over',
                'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                        return '<span id="fancybox-title-over">Kép ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                        }
                });
        });


        $("a[rel=fooldal]").fancybox({
        'transitionIn'		: 'none',
        'transitionOut'		: 'none',
        'titlePosition' 	: 'over',
        'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                return '<span id="fancybox-title-over">Kép ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                }
        });

        $("div#makeMeScrollable").smoothDivScroll({scrollingSpeed: 5, mouseDownSpeedBooster: 2, autoScrollDirection: "endlessloop", autoScrollSpeed: 2, startAtElementId: "startAtMe"});

  
});


