$(document).ready(function() {

	$("#id_header").fadeSlideShow({
		width: 1000,
		height: 280,
		speed: "slow",
		interval: 6000,
		PlayPauseElement: false,
		NextElement: false,
		PrevElement: false,
		ListElement: false
	});

	$(".menu_icon").mouseenter(function() {

		//var header_image = $(this).children().first();
		var header_image = $(this);
		var dot_pos = header_image.attr("src").indexOf(".");
		var new_src = header_image.attr("src").substr(0, dot_pos) + "_over.png";
		header_image.attr("src", new_src);
		$(this).parent().animate({
			height: "+=100"
		}, 500, 'linear', function() {

		});
		$(this).next().animate({
				height: "+=100"
		}, 500, function() {

		});
		$(this).next().next().animate({
			top: "+=100"
		}, 500, function() {

		});

	});

	$(".menu_icon").mouseleave(function() {
		var header_image = $(this);
		var dot_pos = header_image.attr("src").indexOf(".");
		var new_src = header_image.attr("src").substr(0, dot_pos - 5) + ".png";
		header_image.attr("src", new_src);
		$(this).parent().animate({
			height: "-=100"
		}, 500, function() {

		});
		$(this).next().animate({
				height: "-=100"
		}, 500, function() {

		});
		$(this).next().next().animate({
			top: "-=100"
		}, 500, function() {

		});

	});

	// header képek láthatóvá
	$("#id_header").children("img").css("display", "block");


	// page peel
	$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
			.animate({
				width: '307px',
				height: '319px'
			}, 500);
		} , function() {
		$("#pageflip img").stop()
			.animate({
				width: '110px',
				height: '114px'
			}, 220);
		$(".msg_block").stop()
			.animate({
				width: '110px',
				height: '110px'
			}, 200);
	});

	// aloldal inicializálás
	page_init();

});


function set_submenu() {

	$(".submenu").mouseover(function() {
		var header_image = $(this).children().first();
		var dot_pos = header_image.attr("src").indexOf(".");
		var new_src = header_image.attr("src").substr(0, dot_pos) + "_over.png";
		header_image.attr("src", new_src);
		//var more_image = $(this).children().last().children();
		//more_image.attr("src", "images/menu_bovebben_over.png");
	});
	$(".submenu").mouseout(function() {
		var header_image = $(this).children().first();
		var dot_pos = header_image.attr("src").indexOf(".");
		var new_src = header_image.attr("src").substr(0, dot_pos - 5) + ".png";
		header_image.attr("src", new_src);
		//var more_image = $(this).children().last().children();
		//more_image.attr("src", "images/menu_bovebben.png");
	});

}
