
window.onload = function() {
	
	$('.popupClose').click(function(){
		$.colorbox.close()
		
		return false;
	});
	
	
	$('form').ajaxForm(function(result){
		
			//alert(result);
			
			if (result ){
				$.colorbox({html:'<p style="font-size: 18px; line-hight: 150%; margin-top: 40px; width: 500px; font-weight: bold; color: #990000; text-align: center;">'+result+'</p>'});
			}
			
		
	});
	
	
	$("#gyik").each(function() {
		//var open = false;
		$("dt", this).click(function(){
			
			$(this).next().slideToggle("fast");
			$(this).toggleClass('up');
			
			return false;
		});
	});
	$("#gyik dt").each(function() {
		
		$(this).next().slideToggle("fast");

		$(this).mouseover(function() {
			$(this).css({
				"cursor":"pointer",
				"color":"#3399cc"
			});
		});
		$(this).mouseout(function() {
			$(this).css({
				"cursor":"normal",
				"color":"#003366"
			});
		});
	});
	
	$(".userBox #open").click(function(){
		
		
		if ($(this).hasClass('down')) {
			$(".userBox").animate({'top': '0'}, 160);
			$(".userGate").animate({'height': '114px'}, 160);
			$(this).removeClass('down')
			$(this).addClass('up')
		} else {
			$(".userBox").animate({'top': '-89px'}, 160);
			$(".userGate").animate({'height': '25px'}, 160);
			$(this).removeClass('up')
			$(this).addClass('down')
		}
		
		return false;
		
		
		
	});
	$(".linked").each(function() {
		
		var link = $("a", this).attr("href");
		
		$(this).mouseover(function() {
			$(this).css({
				"cursor":"pointer",
				"border":"1px solid #003366"
			});
			$("a", this).css({
				"text-decoration":"underline"
			});
		});
		$(this).mouseout(function() {
			$(this).css({
				"cursor":"normal",
				"border":"1px solid #dedede"
			});
			$("a", this).css({
				"text-decoration":"none"
			});
		});
		$(this).click(function(){
			window.location = link;

		});
	});
	$(".searchOpen").each(function() {
		
		var link = $("a", this).attr("href");
		
		$(this).mouseover(function() {
			$(this).css({
				"cursor":"pointer",
				"border":"1px solid #003366"
			});
			$("a", this).css({
				"text-decoration":"underline"
			});
		});
		$(this).mouseout(function() {
			$(this).css({
				"cursor":"normal",
				"border":"1px solid #dedede"
			});
			$("a", this).css({
				"text-decoration":"none"
			});
		});
		$(".info",this).click(function(){
			$('#searchForm').slideToggle("fast");
		});
	});
	$(".userOpen").each(function() {
		
		var link = $("a", this).attr("href");
		
		$(this).mouseover(function() {
			$(this).css({
				"cursor":"pointer",
				"border":"1px solid #003366"
			});
			$("a", this).css({
				"text-decoration":"underline"
			});
		});
		$(this).mouseout(function() {
			$(this).css({
				"cursor":"normal",
				"border":"1px solid #dedede"
			});
			$("a", this).css({
				"text-decoration":"none"
			});
		});
		$(this).click(function(){
			if ($(".userBox #open").hasClass('down')) {
				$(".userBox").animate({'top': '0'}, 160);
				$(".userGate").animate({'height': '114px'}, 160);
				$(".userBox #open").removeClass('down')
				$(".userBox #open").addClass('up')
			} else {
				$(".userBox").animate({'top': '-89px'}, 160);
				$(".userGate").animate({'height': '25px'}, 160);
				$(".userBox #open").removeClass('up')
				$(".userBox #open").addClass('down')
			}
			window.location = link;
		});
	});
	
	$("#user").each( function() {
		this.checked = false;
	});

	$("#user").click(function() {
		if (this.checked == false) {
			$("#userfield").css({
				"display":"none"
			});
		}
		if (this.checked == true) {
			$("#userfield").css({
				"display":"block"
			});
		}
		
	});
}

function step2(){
	
	$('#step-1').css({"display":"none"});
	$('#step-2').css({"display":"block"});
	return false;
	
}
function step3(){
	
	$.colorbox({
		href:"/html/dialog-szerzodesi-feltetelek.php",
		scrolling: false,
		innerWidth: 500,
		innerHeight: 500
	});
	return false;
	
}

	
