
function HideShow(melyik) 
	{
	if (document.getElementById  && !document.all)	// NS6+, MSIE 5+, Mozilla, Opera 6 in Opera (W3C) mode 
		{
		obj = document.getElementById(melyik); 
		obj.style.display = (obj.style.display == 'block') ? 'none' : 'block'; 
		}
	if (document.all)	// MSIE (all versions) and Opera 6 in MSIE 5 mode
		{
		document.all[melyik].style.display = (document.all[melyik].style.display == 'block') ? 'none' : 'block'; 
		}
	if (document.layers)			// NS 4
		{
		document.layers[melyik].display = (document.layers[melyik].display == 'block') ? 'none' : 'block'; 
		}
	}
function GetCheckedValue(RadioObj)
	{
	var RadioLength = RadioObj.length;
	
	for(var i=0; i<RadioLength; i++)
		{
		if(RadioObj[i].checked)
			{
			return RadioObj[i].value;
			}
		}
	}
function JelolonegyzetAlapjanMegjelenites(CheckBoxObj,DivObjID)
	{
	var megjelenjen=0;
		
	if(CheckBoxObj.checked)
		{
		megjelenjen=1;
		}
	 divelrejtes_megmutatas(DivObjID,megjelenjen);
	}
function divelrejtes_megmutatas(mit,tipus)
	{
	if(tipus==1)
		{
		stilus='block';
		}
	else
		{
		stilus='none';
		}
	if (document.getElementById  && !document.all)	// NS6+, MSIE 5+, Mozilla, Opera 6 in Opera (W3C) mode 
		{
		obj = document.getElementById(mit); 
		obj.style.display = stilus; 
		}
	if (document.all)	// MSIE (all versions) and Opera 6 in MSIE 5 mode
		{
		document.all[mit].style.display =  stilus; 
		}
	if (document.layers)			// NS 4
		{
		document.layers[mit].display =  stilus;
		}
	}
function ujablak(url)
	{
	var uj=window.open(url,"","");
	}
function uresCheck(ertek)
	{
	if (ertek != "") 
		{
		return true;
	}
	else
		{
		return false;
		}
	}
function teszt(ertek,minta)
	{
	for (var i=0; i<ertek.length; i++)
		{
		if(minta.indexOf(ertek.charAt(i)) == -1)
			{
			return false;
			}
		}
	return true;
	}

function numerikusCheck(ertek)
	{
	if (!uresCheck(ertek))
		{
		return false;
		}
	if(ertek.search(',')>0)
		{
		ujertek=ertek.replace(',','.')
		ertek=ujertek;
		}
	if (!teszt(ertek,"1234567890."))
		{
		return false;
		}
	else
		{
		return (ertek);
		}
	}

function idozito_tovabbkuldo(url)
	{
	if(url=="index.php")
		{
		setTimeout('tovabbkuldo("index.php")', 5000);
		}
	}
function tovabbkuldo(url)
	{
	document.location = url;
	}


jQuery(function(){
	
	
	// nyelvválasztó --------------------------------------------------------------------------------------//
	
	$("#nyelvvalaszto").hover(
		function(){$(this).find("ul").slideDown(100);},
		function(){$(this).find("ul").delay(200).slideUp(100);}
	);
	
	// kedvencek összecsukás, kinyitás --------------------------------------------------------------------//
	
	var kedvencek_h3_margin_bottom = $("#kedvencek h3").css('margin-bottom');
	$("#kedvencek_openclose").live("click", function(){
		var duration = 200;
		if($(this).hasClass("closed"))
			{
			$("#kedvencek .ajanlat_wrap").stop().slideDown(duration);
			$("#kedvencek h3").css('margin-bottom', kedvencek_h3_margin_bottom);
			$(this).removeClass("closed").addClass("opened").html("Összecsukás");
			}
		else
			{
			$("#kedvencek .ajanlat_wrap").stop().slideUp(duration, function(){
				$("#kedvencek h3").css('margin-bottom', '0px');
				});
			$(this).removeClass("opened").addClass("closed").html("Kinyitás");
			}
	});
	
	// szállás értékelés diagram --------------------------------------------------------------------------//
	
	$(".ertekeles .szazalek").each(function(i,o){
		var szazalek = parseInt($(this).text().replace('\%', ''));
		var pd = $('<span></span>');
		$(this).before(pd);
		pd.progressbar({value: 0});
		pd.find('.ui-progressbar-value').animate({width: szazalek+'%'}, 1000);
	});
	
	$(".velemenyek").quickPager({pageSize: 5});
	$("#online_foglalhato .szallaslista").quickPager({pageSize: 10});
	
	$('.preview').each(function(index, element){
		$(element).attr('href','#null');
	});

	  
});


