function message(m)
{
	$("#layer").append("<div style=\"color:#ffffff;margin:30px auto;width:700px;height:"+($(window).height()-60)+"px;overflow:auto;overflow-x:hidden;font-size:16px;\">"+m+"</div>");
	$("#layer").height($(document).height());
	$("#layer").fadeIn();
}

function _insertImg(src,width,height)
{
	img = "<a href=\"" + src + "\" class=\"img-parent\">"
		+ "<div class=\"shadow\" style=\"width:" + (width-20) + "px; height:" + (height-20) + "px;\"></div>"
		+ "<img src=\"" + src + "\" style=\"width:" + (width) + "px; height:" + (height) + "px;\"/>"
		+ "</a>"
		+ "<div class=\"clear\"></div>";

		document.write(img);

}

function CheckForm_1()
{
	if (summarize() == 0)
	{
		alert("Kérem, az előfizetés megrendeléséhez válasszon egy csomagot!");
		return false;
	}

	if ($("#firstname").val() == "") 
	{
		$("#firstname").css({background:"#ffbbbb"});
		alert("A vezetéknév megadása kötelező!");
		$("#firstname").focus();
		return false;
	}
	else
	{
		$("#firstname").css({background:"#ffffff"});
	}
	
	if ($("#lastname").val() == "") 
	{
		$("#lastname").css({background:"#ffbbbb"});
		alert("A keresztnév megadása kötelező!");
		$("#lastname").focus();
		return false;
	}
	else
	{
		$("#lastname").css({background:"#ffffff"});
	}

	if ($("#email").val() == "") 
	{
		$("#email").css({background:"#ffbbbb"});
		alert("Az e-mail cím megadása kötelező!");
		$("#email").focus();
		return false;
	}
	else
	{
		$("#email").css({background:"#ffffff"});
	}
	
	if ($("#email2").val() != $("#email").val()) 
	{
		$("#email2").css({background:"#ffbbbb"});
		alert("A két e-mail cím nem egyezik!");
		$("#email2").focus();
		return false;
	}
	else
	{
		$("#email2").css({background:"#ffffff"});
	}
	
	if ($("#address").val() == "") 
	{
		$("#address").css({background:"#ffbbbb"});
		alert("A város (település) megadása kötelező!");
		$("#address").focus();
		return false;
	}
	else
	{
		$("#address").css({background:"#ffffff"});
	}
	
	if ($("#username").val() == "") 
	{
		$("#username").css({background:"#ffbbbb"});
		alert("A felhasználónév megadása kötelező!");
		$("#username").focus();
		return false;
	}
	else
	{
		$("#username").css({background:"#ffffff"});
	}
	
	if ($("#password1").val() == "") 
	{
		$("#password1").css({background:"#ffbbbb"});
		alert("A jelszó megadása kötelező!");
		$("#password1").focus();
		return false;
	}
	else
	{
		$("#password1").css({background:"#ffffff"});
	}
	
	if ($("#password1").val() != $("#password2").val())
	{
		$("#password2").css({background:"#ffbbbb"});
		alert("A két jelszó nem egyezik!");
		$("#password2").focus();
		return false;
	}
	else
	{
		$("#password2").css({background:"#ffffff"});
	}

	if (!$("#f1").attr("checked"))
	{
		alert("A Jogi nyilatkozat és a Felhasználói szabályzatot elfogadása kötelező!");
		return false;
	}
}

order = function(o)
{
	product = o.parent().parent();
	line = product.parent();
	selectable = true;
	
	$("input[type='hidden']",line).each(function()
	{
		if ($(this).val() == "1")
		{
			selectable = false;
		}
	});
	
	s = $(".right > [rel='select']",product).val();
	
	if (s == "1")
	{
		$(".right > [rel='select']",product).val("0");
		$(".right > input[type='button']",product).val("Ez kell nekem");
		product.removeClass("selected");
	}
	else
	{
		if (selectable)
		{
			$(".right > [rel='select']",product).val("1");
			$(".right > input[type='button']",product).val("Mégsem");
			product.addClass("selected");	
		}
	}
	
	summarize();
}

summarize = function()
{
	var sp = "";
	var price = 0;
	
	$(".product").each(function()
	{
		if ($(".right > [rel='select']",$(this)).val() == "1")
		{
			sp = $(".right input[type='radio']:checked",$(this)).val();
			a = GetProductPrice(sp);
	
			if ($(this).attr("rel").substr(1,1) == "a") { price += a[0]; }
			if ($(this).attr("rel").substr(1,1) == "h") { price += a[1]; }
			if ($(this).attr("rel").substr(1,1) == "p") { price += a[2]; }
		}
	});

	$("#totalprice > strong").html(price);
	
	return price;
}

		var src_1 = "";
		
		$(document).ready(function()
		{
			w1 = $("#ml0").width()+$("#ml1").width()+$("#ml2").width()+$("#ml3").width()+$("#ml4").width()+$("#ml5").width()+$("#ml6").width();
			w2 = $("#ml7").width()+$("#ml8").width()+$("#ml9").width()+$("#ml10").width()+$("#ml11").width();
			
			p1 = (1000-w1)/2;
			p2 = (1000-w2)/2;
			
			$("#m1").css({paddingLeft:p1 + "px"});
			$("#m1").css({paddingRight:p1 + "px"});
			$("#m1").css({width:1000-(p1*2) + "px"});
			$("#m2").css({paddingLeft:p2 + "px"});
			$("#m2").css({paddingRight:p2 + "px"});
			$("#m2").css({width:1000-(p2*2) + "px"});
			
			if ($("#helps1"))
			{
				src_1 = $("#helps1").attr("src");
				
				$("#helps1").attr("style","background:url("+$("#helps1").attr("src")+")");
				$("#helps1").attr("src","");
				$("#helps1").attr("alt","");
				$("#helps1").css({cursor:"pointer"});
				$("#helps1").css({display:"block"});
				$("#helps1").css({height:"225px"});
				$("#helps1").css({width:"695px"});
				$("#helps1").click(function(){ShowImages()});
			}
			if ($("#helps2"))
			{
				src_2 = $("#helps2").attr("src");

				$("#helps2").attr("style","background:url("+$("#helps2").attr("src")+")");
				$("#helps2").attr("src","");
				$("#helps2").attr("alt","");
				$("#helps2").css({cursor:"pointer"});
				$("#helps2").css({display:"block"});
				$("#helps2").css({height:"225px"});
				$("#helps2").css({width:"695px"});
				$("#helps2").click(function(){ShowImages()});
			}
			
			$("#vr").css({height:$("#_content").height()+"px"});
		});
		
		function ShowImages()
		{
			$("#layer").fadeIn();
			$("#layer").css({height:$(document).height()+"px"});
			
			var close = "<div onclick='$(\"#layer\").fadeOut();' style='font-size:20px;color:#666666;font-weight:bold;height:20px;padding:10px;cursor:pointer;margin-left:888px;background:#ffffff;position:absolute;' title='Bezárás...'>X</div>";
			
			$("#layer").html("<div style='margin:auto;width:920px;' id='container'>" + close + "<img src='"+src_1+"' /><br /><br /><img src='"+src_2+"' /></div>");
			$("#container").css({paddingTop:($(window).height()-$("#container").height())/2});
		}

