_dynarch_menu_url = "hmenu/";
var linker = function (nev,celDiv,onClickEvent) {
	this.nev = nev || 'linkto[]';
	this.celDiv = celDiv || document.body;
	this.onClickEvent = onClickEvent;
	this.magyarazo = 'Ha a látogató rákattint, akkor ez történjen:';
	this.tipus = new Array(	"Ne történjen semmi",
					"Ugorjon egy szöveges cikkre",
					"Ugorjon egy termékcsoportra",
					"Ugorjon egy termékre",
					"Ugorjon egy oldalra",
					"Ugorjon egy másik weboldalra");
	this.cel =	new Array()
	this.cel[0] = new Array();
	this.cel[1] = new Array (	"",
			"&Uuml;zemanyag fel&aacute;r bevezet&eacute;se",
			"A GEP&Aacute;RD FUT&Aacute;R",
			"K&ouml;sz&ouml;nj&uuml;k a megkeres&eacute;st",
			"Fut&aacute;rszolg&aacute;lat azonnali k&ouml;rzet d&iacute;jas k&eacute;zbes&iacute;t&eacute;ssel",
			"Fut&aacute;rszolg&aacute;lat azonnali fix d&iacute;jas k&eacute;zbes&iacute;t&eacute;ssel",
			"Fut&aacute;rszolg&aacute;lat m&aacute;snapi k&eacute;zbes&iacute;t&eacute;ssel",
			"GEP&Aacute;RD FUT&Aacute;R &Aacute;RUBIZTOS&Iacute;T&Aacute;S, GARANCIA",
			"El&eacute;rhet&otilde;s&eacute;g",
			"Adatv&eacute;delmi &eacute;s Jogi Nyilatkozat",
			"Webshop &eacute;s Csomagk&uuml;ld&eacute;s T&aacute;j&eacute;koztat&oacute;",
			"Fogyaszt&oacute;i Jogok T&aacute;j&eacute;koztat&oacute;",
			"Fut&aacute;rszolg&aacute;lat ISO min&otilde;s&iacute;t&eacute;s",
			"&Uuml;zletszab&aacute;lyzat",
			"Fut&aacute;rszolg&aacute;lat informatikai h&aacute;tt&eacute;r",
			"Referenci&aacute;k",
			"FUT&Aacute;R &Aacute;LL&Aacute;S");
	this.cel[2] = new Array ();
	this.cel[3] = new Array ();
	this.cel[4] = new Array('Főoldal',
							'Hírlevél feliratkozó oldal',
							'Hírlevél leiratkozó oldal',
							'Ajánlom az ismerősömnek oldal',
							'A felhasználók saját adatait módosító oldal',
							'Véleményküldő oldal',
							'Blog főoldala');
	this.cel[5] = new Array();

	this.azon =	new Array()
	this.azon[0] =	new Array()
	this.azon[1] = new Array (	"szoveg_410",
			"szoveg_411",
			"szoveg_32",
			"szoveg_409",
			"szoveg_36",
			"szoveg_38",
			"szoveg_37",
			"szoveg_39",
			"szoveg_400",
			"szoveg_401",
			"szoveg_402",
			"szoveg_403",
			"szoveg_33",
			"szoveg_34",
			"szoveg_41",
			"szoveg_44",
			"szoveg_23");
	this.azon[2] = new Array ();
	this.azon[3] = new Array ();
	this.azon[4] =	new Array('oldal_6','oldal_32','oldal_29','oldal_31','oldal_30','oldal_33','oldal_21')
	this.azon[5] =	new Array();
}

function kiir(obj,param)
{
	var liObj=obj.params;
	var parent=liObj.parentNode;
	while (parent.parentNode.nodeName != 'DIV' && parent.parentNode.nodeName != 'BODY') {
		parent=parent.parentNode;
	}
	linkObj=parent.objAzon;
	linkObj.setUrl(param);
}

linker.prototype.Create = function ()
{
	var i=0;
	hSzUl = Builder.node('ul');
	hSzUl.objAzon = this;
	hSzLi = Builder.node ('li',this.magyarazo);
	menuUl = Builder.node('ul');
	for (i=1;i<this.tipus.length;i++) {
		menuLi = Builder.node ('li',this.tipus[i]);
		if (i>0) {
			if (this.cel[i].length) {
				var alMenuUl = Builder.node('ul');
				for (j=0;j<this.cel[i].length;j++) {
					alMenuLi = Builder.node ('li',{onclick:"kiir(this,'"+this.azon[i][j]+"')"},this.cel[i][j]);
					alMenuUl.appendChild(alMenuLi);
				}
				menuLi.appendChild(alMenuUl);
			}
		}
		menuUl.appendChild(menuLi);
	}
	hSzLi.appendChild(menuUl);
	hSzUl.appendChild(hSzLi);
	this.celDiv.appendChild(hSzUl);
	hSzUl.objAzon = this;
	this.menuObj=hSzUl;
	this.celDiv.style.textAlign='left';
	DynarchMenu.setup(hSzUl, { horizontal: true });
}

linker.prototype.setUrl = function (url)
{
	this.kodoltUrl = url;
	var segedUrl = url.split("_");
	this.directUrl = '?oldal=' + segedUrl[1] 
	if (typeof(segedUrl[2]) != "undefined")
		this.directUrl += '&' + segedUrl[2] + '=' + segedUrl[3];
	eval(this.onClickEvent(this));
}

