		var ker_helyseg_value;
		var ker_szallas_value;
		var slide_counter;
		var slide_max;
		var slidetimerid;
		var slidertime;

		function kereses_start(ker_orszag_id, ker_regio_id, ker_helyseg, ker_indulas, ker_szallas, ker_ellatas_id, ker_kategoria){
			var d = new Date();
			$.post('set_kereses.php', { ker_orszag_id: ker_orszag_id, ker_regio_id: ker_regio_id, ker_helyseg: ker_helyseg, ker_indulas: ker_indulas, ker_szallas: ker_szallas, ker_ellatas_id: ker_ellatas_id, ker_kategoria: ker_kategoria, time:d.getTime() }, function(data) {
				$.post('kereses.php', { lap: 1 }, function(data) {
					$('.content').html(data);
					window.scrollTo(0,0);
					$('.clear').html('');
					$('#act_country').removeClass('leftmenu_country leftmenu_act').addClass('leftmenu_country');
				});
			});
		}
		
		function kereses_lapoz(lap){
			var d = new Date();
			$.post('kereses.php', { lap: lap, time:d.getTime() }, function(data) {
				$('.content').html(data);
				window.scrollTo(0,0);
			});
		}
		
		function slideshow() {
			$("#kep"+slide_counter).fadeTo("slow", 0.0);

			number_norm(slide_counter);
			
			slide_counter++;
			if (slide_counter>slide_max)
				slide_counter = 1;
				
			number_over(slide_counter);
				
			$("#kep"+slide_counter).fadeTo("slow", 1.0);
		} 

		function number_over(counter){
			src = "image/slideshow/numbers/slide_"+counter+"_over.png"
			$("#m"+counter).attr("src",src);
		}
		
		function number_norm(counter){
			src = "image/slideshow/numbers/slide_"+counter+".png";
			$("#m"+counter).attr("src",src);
		}
		
		function aloldal_sorrend_change(sorrend_id){
			$.post('set_aloldal_sorrend.php', { aloldal_sorrend_id: sorrend_id}, function(data) {
				$('.content').html(data);
			});
		}
		
		function fooldal_sorrend_change(sorrend_id){
			$.post('set_fooldal_sorrend.php', { fooldal_sorrend_id: sorrend_id}, function(data) {
				$('.content').html(data);
			});
		}

		function kereses_sorrend_change(sorrend_id){
			$.post('kereses.php', { ker_sorrend_id: sorrend_id}, function(data) {
				$('.content').html(data);
			});
		}
		
		function akcios_sorrend_change(sorrend_id, oldal){
			$.post('set_akcios_sorrend.php', { akcios_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#akcios_ajanlatok').html(data);
			});
		}

		function lastminute_sorrend_change(sorrend_id, oldal){
			$.post('set_lastminute_sorrend.php', { lastminute_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#lastminute_ajanlatok').html(data);
			});
		}
		
		function egyiptom_2012_sorrend_change(sorrend_id, oldal){
			$.post('set_egyiptom_2012_sorrend.php', { egyiptom_2012_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#egyiptom_2012_ajanlatok').html(data);
			});
		}
		
		function torok_2012_sorrend_change(sorrend_id, oldal){
			$.post('set_torokorszag_2012_sorrend.php', { torok_2012_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#torok_2012_ajanlatok').html(data);
			});
		}
		
		function tunezia_2012_sorrend_change(sorrend_id, oldal){
			$.post('set_tunezia_2012_sorrend.php', { tunezia_2012_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#tunezia_2012_ajanlatok').html(data);
			});
		}
		
		function ett_2012_sorrend_change(sorrend_id, oldal){
			$.post('set_ett_2012_sorrend.php', { ett_2012_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('#ett_2012_ajanlatok').html(data);
			});
		}

		function slager7_sorrend_change(sorrend_id){
			$.post('set_slager7_sorrend.php', { slager7_sorrend_id: sorrend_id}, function(data) {
				$('.content').html(data);
			});
		}

		function dino_sorrend_change(sorrend_id,oldal){
			$.post('set_dino_sorrend.php', { dino_sorrend_id: sorrend_id, oldal: oldal}, function(data) {
				$('.content').html(data);
			});
		}
		
		$(document).ready(function(){
		
			slide_counter=1;
			/*slide_max=5;*/
			slidertime = 5500;
			ker_helyseg_value='Bármely helység';
			
			$("#ker_helyseg").focus( function(){
				if($(this).attr("value")==ker_helyseg_value){
					$(this).attr("value","");
				}
			});
			
			$("#ker_helyseg").blur( function(){
				if($(this).attr("value")==""){
					$(this).attr("value",ker_helyseg_value);
				}
			});
			
			ker_szallas_value='Bármely szállás';
			
			$("#ker_szallas").focus( function(){
				if($(this).attr("value")==ker_szallas_value){
					$(this).attr("value","");
				}
			});
			
			$("#ker_szallas").blur( function(){
				if($(this).attr("value")==""){
					$(this).attr("value",ker_szallas_value);
				}
			});
		
			$("#ker_orszag_id").change(function(){
				var ker_orszag_id = $(this).val();
				$('#ker_regio_id').attr('disabled', 'disabled');
				$.post('put_regio_options.php', { ker_orszag_id: ker_orszag_id}, function(data) {
					$('#ker_regio_id').html(data);
					$('#ker_regio_id').attr('disabled', '');
				});
			});
			
			$(".top_search").fadeTo("slow", 0.8); 
			
			$(".top_search").hover(function(){
				$(this).fadeTo("slow", 1.0); 
				$("#kep1").fadeTo("slow", 1.0);
				$("#kep2").fadeTo("slow", 0.0);
			},function(){
				$(this).fadeTo("slow", 0.8); 
				$("#kep1").fadeTo("slow", 0.0);
				$("#kep2").fadeTo("slow", 1.0);
		   	});
			
			$(".slidenumbers").hover(function() {
				number_over(this.id.replace("m", ""));
			}, function() {
				if (this.id.replace("m", "")!=slide_counter)
					number_norm(this.id.replace("m", ""));
			});
			
			$('.slidenumbers').click(function() {
				clearInterval(slidetimerid);
				$("#kep"+slide_counter).fadeTo("slow", 0.0);
				number_norm(slide_counter);
				
				slide_counter=this.id.replace("m", "");
				
				number_over(slide_counter);
				$("#kep"+slide_counter).fadeTo("slow", 1.0);
				slidetimerid = setInterval("slideshow()", slidertime); 
			});
			
			slidetimerid = setInterval("slideshow()", slidertime); 
			
			
			/* hirlevel */
			h_veznev = 'Vezetéknév';
			h_kernev = 'Keresztnév';
			h_email  = 'E-mail cím';
			$("#h_veznev").focus( function(){
				if($(this).attr("value")==h_veznev){
					$(this).attr("value","");
				}
			});
			$("#h_veznev").blur( function(){
				if($(this).attr("value")==""){
					$(this).attr("value",h_veznev);
				}
			});
			$("#h_kernev").focus( function(){
				if($(this).attr("value")==h_kernev){
					$(this).attr("value","");
				}
			});
			$("#h_kernev").blur( function(){
				if($(this).attr("value")==""){
					$(this).attr("value",h_kernev);
				}
			});
			$("#h_email").focus( function(){
				if($(this).attr("value")==h_email){
					$(this).attr("value","");
				}
			});
			$("#h_email").blur( function(){
				if($(this).attr("value")==""){
					$(this).attr("value",h_email);
				}
			});

			
		});
		
		function getpartners(lap){
			if ($("#kapcsolat_telepules_select").val()=='Budapest')
				$('#kapcsolat_keruletek').show();
			else	
				$('#kapcsolat_keruletek').hide();
			$.post('getpartners.php', { lap: lap, telepules: $("#kapcsolat_telepules_select").val(), kerulet:$("#kapcsolat_kerulet_select").val() }, function(data) {
				$('#partnerirodak').html(data);
			});
		}
		
		function hirlevel_fel(){
			if ($('#h_veznev').attr("value")==h_veznev){
				alert ('Töltse ki a vezetéknevét!');
			} else if ($('#h_kernev').attr("value")==h_kernev){
				alert ('Töltse ki a keresztnevét!');
			} else if ($('#h_email').attr("value")==h_email){
				alert ('Töltse ki az email címét!');
			} else {
				$.post('hirlevel_feliratkozas.php', { h_veznev: $("#h_veznev").val(), h_kernev: $("#h_kernev").val(), h_email:$("#h_email").val() }, function(data) {
					alert('Köszönjük érdeklődését! Hamarosan email-t kap, melyben megerősítheti hírlevelünkre történő feliratkozását!');
					$("#h_veznev").attr("value", h_veznev); 
					$("#h_kernev").attr("value", h_kernev); 
					$("#h_email").attr("value", h_email); 
				});	
			}
			return false;
		}

