var PictureShareCookie = document.cookie;
var today = new Date();
var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // plus 28 days

function getCookie(name)
{
	try
	{
		var index = PictureShareCookie.indexOf(name + "=");

		if (index == -1)
		{
			return null;
		}
		index = PictureShareCookie.indexOf("=", index) + 1;

		var endstr = PictureShareCookie.indexOf(";", index);

		if (endstr == -1)
		{
			endstr = PictureShareCookie.length;
		}
		return unescape(PictureShareCookie.substring(index, endstr));
	}
	catch(e)
	{
		throw e + " getCookie";
		throwErrors(e);
	}

}
function setCookie(name, value)
{
	if (value != null && value != "")
	{
		document.cookie = name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
	}

	PictureShareCookie = document.cookie;
}

function Login()
{
	if ( frmLogin.chkRememberPassword.checked )
	{
		// User has requested to save password info.
		setCookie("Remember","yes");
		setCookie("AccountName", document.forms[0].txtAccountName.value);
		setCookie("AccountPassword", document.forms[0].txtAccountPassword.value);
	}
	else
	{
		setCookie("Remember","no");
	}
}

function Logout()
{
    alert("test")
}

function CheckBoxClicked(oElement)
{
	oElement.value = oElement.checked;
}

function CheckEnterKey(btn, event)
{
    // IE
    if ( document.all )
    {
        if ( event.keyCode == 13 )
        {
            event.returnValue = false;
            event.cancel = true;
            btn.click();
        }
    }
    // Netscape 6+ and Mozilla
    else if ( document.getElementById )
    {
        if ( event.which == 13 )
        {
            event.returnValue = false;
            event.cancel = true;
            btn.click();
        }
    }
    // Netscape 4+
    else if ( document.layers )
    {
        if ( event.which == 13 )
        {
            event.returnValue = false;
            event.cancel = true;
            btn.click();
        }
    }
}

