
function MemberLogin(sMainDir)
{
//	alert('Coming soon to a theatre near you!');
//	return;

	var nWidth = 620;
	var nHeight = 420;
	if (screen)
	{
		nWidth = screen.availWidth - 40;
		nHeight = screen.availHeight - 80;
	}

	wndMemberSect = window.open("", "MemberSection", "width=" + nWidth + ",height=" + nHeight
		+ ",resizable=yes,scrollbars=yes,status=yes");
	wndMemberSect.moveTo(0, 0);
//alert('2');

//	var nLoginWndCt = GetCookieVal("loginWndCt");
//alert('3');
//	if (nLoginWndCt == 0)
//	{
//alert('4');
		wndMemberSect.location.href = (sMainDir + "members/memli.php");
//alert('5');
		//SetSessionCookieVal("loginWndCt", ++nLoginWndCt);
//alert('6');
//	}

	wndMemberSect.focus();
}

function GetCookieVal(cookieName)
{
	if (document.cookie == "")
		return 0;

	var wholeCookie = document.cookie.split("; ");
	var oneCookie;
	var i;
	for (i=0; i<wholeCookie.length; i++)
	{
		oneCookie = wholeCookie[i].split("=");
		if (cookieName == oneCookie[0])
		{
			return oneCookie[1];
		}
	}
	return 0;
}

function SetSessionCookieVal(name, value)
{
	document.cookie = (name + "=" + value + ";");
}

function DeleteSessionCookie(cookieName)
{
	if (document.cookie == "")
		return;

	var dtExpiry = new Date;
	dtExpiry.setDate(dtExpiry.getDate()-1);

	alert('setting value');
	//document.cookie = (cookieName + "=;expires=" + dtExpiry.toGMTString() + ";");
	document.cookie = (cookieName + "=;expires=" + dtExpiry.toGMTString() + ";");
}


var nTimerId = 0;
var nHide = 0;
var nInterval = 1000;
// the array variable menuNos will be created dynamically in pagetmpl.php
// Note: the variable needs to be created before calling these functions, so create the variable before
// including this file, to be sure


function ShowMenu(nMenu)
{
	if (nDHTML)
	{
		HideAllMenus();

		var domSMenu = GetDOMObject('menu' + nMenu, 1);
		domSMenu.visibility = 'visible';
		domSMenu.zIndex = '1';

		nTimerId = setInterval('StartHide()', nInterval);
		nHide = 0;
	}
}

function HideAllMenus()
{
	for (i=0; i<menuNos.length; i++)
	{
		var domSMenu = GetDOMObject('menu' + menuNos[i], 1);

		// hide menu
		domSMenu.visibility = 'hidden';
		domSMenu.zIndex = '0';
	}

	if (nTimerId)
		clearInterval(nTimerId);
}

function StartHide()
{
	if (nHide == 1)
		HideAllMenus();
}

function GoToArchive(field)
{
	if (!field || field.selectedIndex == -1 || field.options[field.selectedIndex].value == '')
	{
		//alert('Select a concert archive to view.');
		return;
	}

	window.location.href = field.options[field.selectedIndex].value;
}
