
 var onMenu = 0;
 var constWidth = 0;
 var constHeight= 0;
 var trgWidth = 0;
 var trgHeight= 0;
 var inProgress=0;
 var isMenuOpen = 0;
 var loginInProgress = 0;
 var menuId = 'DIV_MemberPopup';
 var buttonId='BTN_MemberPopup';
 var popUpSpeed = 1;// Daha büyük daha çok bekler, ms cinsinden

 function showTheMenu()
 {
	 showModalLayer(menuId, menuTrgWidth, menuTrgHeight);
 }

 function hideTheMenu()
 {
 	if (loginInProgress == 0 )
 		closeModalLayer(menuId);
 }
 
 function showTheMenuOld()
 {
	if (inProgress == 0 && isMenuOpen == 0)
	{
		var o = document.getElementById(menuId);
		var b = document.getElementById(buttonId);

		if (parseInt(o.style.width) > 0 )
			return;

		if (o.getElementsByTagName('TABLE').length == 0 )
			return;

		inProgress = 1;
		onMenu = 1;

		doVisible(false);

		b.className = 'popup_a_hover';
		var coord = findPos(b);

		o.getElementsByTagName('TABLE')[0].style.display ='none';
		o.style.position = 'absolute';
		o.style.left = (coord[0] + b.offsetWidth - 2) +  'px';
		o.style.top = (coord[1] + b.offsetHeight - 2) + 'px';
		o.style.zIndex = '1000';
		o.style.display ='block';

		constWidth = 50;
		constHeight= 30;

		trgWidth = menuTrgWidth;
		trgHeight= menuTrgHeight;

		popOut(o, b);
	}
 }

 function hideTheMenuOld()
 {
	if (inProgress == 0 && loginInProgress == 0)
	{
		var o = document.getElementById(menuId);
		var b = document.getElementById(buttonId);

		o.getElementsByTagName('TABLE')[0].style.display ='none';

		constWidth = -50;
		constHeight= -30;
		trgWidth = 0;
		trgHeight= 0;
		popOut(o, b);
	}

 }

 function popOut(o, b)
 {
	var w = parseInt(o.style.width);
	var h = parseInt(o.style.height);

	var coord = findPos(o);
	if (coord[0] + trgWidth > window.screen.width - 3 && constWidth > 0)
		o.style.left = (coord[0] - constWidth ) + 'px';
	else if (constWidth < 0)
		o.style.left = (coord[0] - constWidth ) + 'px';

	// Boy
	if ((trgHeight == 0 && h > 0) || (trgHeight > 0 && h < trgHeight))
		h+= constHeight;

	// Genişlik
	if ((trgWidth == 0 && w > 0) || (trgWidth > 0 && w < trgWidth) )
	{
		if (w % constWidth == 0)
			o.style.border = '1px solid black';
		else
			o.style.border = '1px solid white';
		w+= constWidth;
	}
	else
	{
		isMenuOpen = (w > 0 ? 1:0);
		inProgress = 0;
	}

	o.style.width = w + 'px';
	o.style.height= h + 'px';

	if (inProgress == 0 && isMenuOpen == 0)
	{
		o.style.display = 'none';
		b.className = 'popup_a';
		doVisible(true);
	}
	else if (inProgress == 0)
	{
		o.getElementsByTagName('TABLE')[0].style.display ='inline';
	}


	setTimeout("popOut(document.getElementById('" + menuId + "'), document.getElementById('" + buttonId + "'))", popUpSpeed);
 }

 function preserveState(obj, st)
 {
	onMenu =  st;
	if (st == 0 )
		setTimeout('hideTheMenu()', 1000);
 }
