//=============================================================
//functions
//=============================================================
function validateLogin(oForm)
{	var bError = false;
	var sLoginCode = oForm.logincode.value.toUpperCase();
	
	if (!validateCharacters(sLoginCode) || sLoginCode == "")
	{	bError = true;
	}
	
	if (bError)
	{	alert("The Login Code is invalid.  Please try again.");
	}
	else
	{	if (validateLoginCode(sLoginCode))
		{
			window.location = "https://programs.regweb.com/fidelity/BrokerDealerForum";
		}
		else
		{
			alert("The Login Code is invalid.  Please try again.");
		}
	}
}

function validateCharacters(sString)
{	var invalidChars = "'\"[]{}%@#!~`^*$+;:?><()|,\/";
	var nextChar = "-";
	
	for (var i = 0; i < invalidChars.length; i++)
	{	nextChar = invalidChars.charAt(i);
		if (sString.indexOf(nextChar, 0) > -1)
		{ return false;
		}
	}
	
	return true;
}

function validateLoginCode(sLoginCode)
{	
	//if you want an other code then use (sLoginCode == "WELCOME" || sLoginCode == "WHATEVER")
	if (sLoginCode == "CHICAGO") 
	{	
		return true;
	}	
	
	return false;
}
