var toX = 0;
var toY = 0;


function almenu(text, href)
{
	this.text = text;
	this.href = href;
}

var almenulist;

function init_almenu()
{
    almenulist = new Array(
	"",
	
	new Array(
	new almenu("Eladó kislány malackák", "google.hu"),
	new almenu("Eladó fiú malackák",  "myvip.hu"),
	new almenu("Beszélgessünk a tengerimalacokról",  "?page_id=41&mingleforumaction=viewforum&f=1.0")
	),
	
	new Array(
	new almenu("Tenyésztörpesünok", "google.hu"),
	new almenu("Jázmin babái",  "gmail.com"),
	new almenu("Beszélgessünk a sünökről",  "?page_id=41&mingleforumaction=viewforum&f=2.0")
	),
	
	new Array(
	new almenu("Törpenyuszik", "google.hu"),
	new almenu("Beszélgessünk a nyuszikról",  "?page_id=41&mingleforumaction=viewforum&f=5.0")
	),
	
	new Array(
	new almenu("Csincsilla", "google.hu"),
	new almenu("Beszélgessünk a csincsillákról",  "?page_id=41&mingleforumaction=viewforum&f=6.0")
	),
	
	new Array(
	new almenu("Deguk", "google.hu"),
	new almenu("Beszélgessünk a degukról",  "?page_id=41&mingleforumaction=viewforum&f=7.0")
	),
	
	new Array(
	new almenu("Mongol futóegér", "google.hu"),
	new almenu("Tüskés egér",  "gmail.com"),
	new almenu("Japán táncoló egér",  "gmail.com"),
	new almenu("Beszélgessünk az egerekről",  "?page_id=41&mingleforumaction=viewforum&f=9.0")
	),
	
	new Array(
	new almenu("Csuklyás patkány", "google.hu"),
	new almenu("Beszélgessünk a patkányokról",  "?page_id=41&mingleforumaction=viewforum&f=10.0")
	),
	
	new Array(
	new almenu("Elevenszülők", "google.hu"),
	new almenu("Lazacfélék",  "gmail.com"),
	new almenu("Labirinthalak",  "gmail.com"),
	new almenu("Márnák, dániók, razbórák",  "gmail.com"),
	new almenu("Harcsafélék",  "gmail.com"),
	new almenu("Sügerek",  "gmail.com"),
	new almenu("Akváriumi aranyhalak",  "gmail.com"),
	new almenu("Kalászhalak",  "gmail.com"),
	new almenu("Más halak",  "gmail.com"),
	new almenu("Más akváriumi élőlények",  "gmail.com"),
	new almenu("Beszélgessünk a halakről",  "?page_id=41&mingleforumaction=viewforum&f=3.0")
	),
	
	new Array(
	new almenu("Hullámos papagáj", "google.hu"),
	new almenu("Nimfa papagáj", "google.hu"),
	new almenu("Énekes papagáj", "google.hu"),
	new almenu("Kanárik", "google.hu"),
	new almenu("Rizspinty", "google.hu"),
	new almenu("Zebrapinty és sirálykapitány", "google.hu"),
	new almenu("Beszélgessünk a madarakkról",  "?page_id=41&mingleforumaction=viewforum&f=4.0")
	),
	
	new Array(
	new almenu("Vadászgörény", "google.hu"),
	new almenu("Beszélgessünk a kisragadozókról",  "gmail.com")
	),
	
	new Array(
	new almenu("Görög teknős", "google.hu"),
	new almenu("Viziteknősök", "google.hu"),
	new almenu("Kínai lágyhéjú teknős", "google.hu"),
	new almenu("Kaméleon", "google.hu"),
	new almenu("Leopárd gekkó", "google.hu"),
	new almenu("Zöld leguán", "google.hu"),
	new almenu("Császárskorpió", "google.hu"),
	new almenu("Kaliforniai királysikló", "google.hu"),
	new almenu("Beszélgessünk a hüllőkről",  "?page_id=41&mingleforumaction=viewforum&f=12.0")
	),
	
	new Array(
	new almenu("Eleségállatok", "google.hu"),
	new almenu("Beszélgessünk a eleségállatokról",  "gmail.com")
	),
	
	new Array(
	new almenu("Ajánlott állatorvos", "google.hu")
	),
	
	new Array(
	new almenu("Dzsungáriai törpehörcsög", "google.hu"),
	new almenu("Roborovszki törpehörcsög",  "gmail.com"),
	new almenu("Aranyhörcsög",  "gmail.com"),
	new almenu("Kínai törpehörcsög",  "gmail.com"),
	new almenu("Beszélgessünk a hörcsögökről",  "?page_id=41&mingleforumaction=viewforum&f=8.0")
	)
	
	);
	
}

function showmenu(menuid)
{
    toDiv = "";
	h = 0;
	//toDiv += "<table>";
	 for(i = 0; i < almenulist[menuid].length; i++)
	 {
	 	//toDiv += "<tr>";
	 	 toDiv += "<a href='"+almenulist[menuid][i].href+"'>"+almenulist[menuid][i].text+"</a><br />";
		 h++;
	 	//toDiv += "</tr>";
		
	 }
	//toDiv += "</table>";
	
	if(event.toElement)
	{
		toX = event.toElement.style.offsetLeft;
		toY = event.toElement.style.offsetTop;
	}
	else
	{
		toX = event.srcElement.offsetLeft;
		toY = event.srcElement.offsetTop;
	}
    
    document.getElementById('almenudiv').innerHTML=toDiv;
    document.getElementById('almenudiv').style.display = "block";
    document.getElementById('almenudiv').style.position = "absolute";
    /*document.getElementById('almenudiv').style.left = toX+"";
    document.getElementById('almenudiv').style.top = (toY+20)+"";*/
	
	document.getElementById('almenudiv').style.left = toX+"";
    document.getElementById('almenudiv').style.top = (toY+20)+"";
	//document.getElementById('almenudiv').style.width = "auto";
    //document.getElementById('almenudiv').style.height = "auto";
	
}

function menuout(toX, toY)
{
    wtop = document.getElementById('almenudiv').offsetTop;
    wleft = document.getElementById('almenudiv').offsetLeft;
    wwidth = document.getElementById('almenudiv').offsetWidth;
    wheight = document.getElementById('almenudiv').offsetHeight;
	
	d =0;
	
	wtop = parseInt(wtop);
	wleft = parseInt(wleft);
	wwidth = parseInt(wwidth);
	wheight = parseInt(wheight);

	if((toX <= wleft + d)
	|| (toY <= wtop + d )
	|| (toX >= wleft + wwidth - d)
	|| (toY >= wtop + wheight - d)
	)
	{
		document.getElementById('almenudiv').style.display = "none";
	}
}
