var animation_speed = 250;

/* Almenü alelemeinek kezelése */
function show_ss(id) {
	$('#ssm_' + id).toggle(animation_speed);
}

/* Nagy képeken alsó feljövő szürke szövegbubi */
function show_bottom_text(id) {
	var my_string = $('#s_' + id).html();
	if(my_string.length > 2) {
		$('#s_' + id).animate({bottom: "0px"}, animation_speed);
	}
}
function hide_bottom_text(id) {
	var my_string = $('#s_' + id).html();
	if(my_string.length > 2) {
		$('#s_' + id).animate({bottom: "-40px"}, animation_speed);
	}
}

/* több infó megjelenítése-elrejtése */
function more_info() {
	$('#more_info').toggle(animation_speed);
}

/* mover vezérlő */
var mover_pos = 0;
function init_mover(count) {
	$('#mover').css('left', '0px');
	$('#mover').css('width', (count * 480) + 'px');
	$('#mover').children('[class!=flash]').css('visibility', 'visible');
}
function mover(toPos) {
	$('#mover').animate(
					{left: '-' + (toPos * 480) + 'px'},
					Math.sqrt(Math.abs((toPos - mover_pos)*(toPos - mover_pos)/2)) * animation_speed,
					'swing',
					function() {
						$('[class=flash]').each(
							function() {
								if(this.id != 'i480x385_' + toPos) {
									$(this).css('visibility', 'hidden');
								}
							}
						)
					}
					);
	$('#i480x385_' + toPos).css('visibility', 'visible');
	mover_pos = toPos;
}
/* felirat megjelenítés - eltűntetés */
function show_felirat(id) {
	my_string = $('#kepfelirat_' + id).html();
	if(my_string.length > 32) {
		$('#kepfelirat_' + id).css('opacity', 0);
		$('#kepfelirat_' + id).css('display', 'block');
		$('#kepfelirat_' + id).animate({
									opacity: 1,
									top: '-20px',
									left: '-5px'
								}, animation_speed);
	}
}
function hide_felirat(id) {
	my_string = $('#kepfelirat_' + id).html();
	if(my_string.length > 32) {
		left = (id % 7 - 3) * 5 - 5;
		$('#kepfelirat_' + id).animate({
									opacity: 0,
									top: '-30px',
									left: left + 'px'
								}, animation_speed);
	}
}
