function Cikk(ci)	{
	/*new Ajax.Updater('main', '/index.php', {
		//parameters: 'p=article&entire=' + ci
		parameters: 'index.php/?p=main&entire=' + ci
	});*/
	top.location = 'index.php/?p=main&entire=' + ci
}

function AddComment(ci)	{
	//alert($('kommentform').serialize(false))
	//new Ajax.Updater('main', '/index.php', {
	new Ajax.Request('/index.php', {
		parameters: $('kommentform').serialize(true),
		onSuccess: function (transport) {
			if (parseInt(transport.responseText) > 0) CommentError()
			else CommentOK(ci)
		}
	});
}

function CommentError() {}
function CommentOK(ci) { Cikk(ci) }

function LoginDoboz()	{
	$('login').style.display = "block"
}

function Login()	{
	//new Ajax.Updater('loginerr', '/index.php', {
	new Ajax.Request('/index.php', {
		parameters: $('loginf').serialize(true),
		onSuccess: function (transport) {
			if (transport.responseText.substr(0,3) == 'Sik')	{
				$('loginerr').update(transport.responseText)
			} else {
				top.location = '?a=' + transport.responseText
			}
		}
	})
}

function Impresszum()	{
	//new Ajax.Updater('main', '/impresszum.html');
	top.location = '/?p=impresszum'
}

function Fooldal()	{
	/*new Ajax.Updater('main', '/index.php', {
		parameters: 'p=article&fooldal=1'
	});*/
	top.location = '/?p=page&fooldal=1'
}

function Rovat(r)	{
	/*new Ajax.Updater('main', '/index.php', {
		parameters: 'p=page&rovat=' + r
	});*/
	top.location = '/?p=page&rovat=' + r
}

function Szerzo(r)	{
	/*new Ajax.Updater('main', '/index.php', {
		parameters: 'p=page&szerzo=' + r
	});*/
	top.location = '/?p=page&szerzo=' + r
}

function Keresoszo(r)	{
	/*new Ajax.Updater('main', '/index.php', {
		parameters: 'p=page&szo=' + r
	});*/
	top.location = '/?p=page&szo=' + r
}

function Ajanlo()	{
	$('ajanlo').style.display = "block"
}

function JSendAjanlo()	{
	new Ajax.Request('/index.php', {
		parameters: $('ajanlof').serialize(true),
		onSuccess: function (transport) {
			if (!transport.responseText) ContactError()
			else AjanloClosing(transport.responseText)
		}
	});
}

function AjanloClosing(str)	{
	$('ajanloerr').update(str)
	setTimeout(function () {
		$('ajanlo').style.display = 'none'
		$('ajanloerr').update()
	}, 10000)
	/*new PeriodicalExecuter(function(pe) {
  		pe.stop();
  		ContactClose();
	}, 2);*/
}

function Hirlevel()	{
	new Ajax.Request('/index.php', {
		parameters: $('hirlevelf').serialize(true),
		onSuccess: function (transport) {
			if (!transport.responseText) ContactError()
			else HirlevelClosing(transport.responseText)
		}
	});
}

function HirlevelClosing(str)	{
	$('hirlevel-form').style.display = 'none'
	$('hirlevelerr').update(str)
	setTimeout(function () {
		//$('hirlevel-form').style.display = 'none'
		$('hirlevelerr').update()
	}, 3000)
}

