var FirstName = readCookie('BB_FirstName')

browser = navigator.appName;

os = navigator.platform;
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;

//AOL fix
var agtAOL = navigator.userAgent.toLowerCase();


var fullVersion = parseFloat(nVer);
var majorVersion = parseInt(nVer);

var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);


var is_aol   = (nAgt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);
var is_aol5  = (nAgt.indexOf("aol 5") != -1);
var is_aol6  = (nAgt.indexOf("aol 6") != -1);


if (!is_aol){

	if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
		fullVersion = parseFloat(nAgt.substring(verOffset+5,nAgt.length));
		majorVersion = parseInt(''+fullVersion);
	}
	if (browser == 'Netscape' ) {
		majorVersion = parseFloat(nVer);
	}
	if (majorVersion < 5) {
		window.location="http://www.brooksbrothers.com/browser.tem";
	}
}


if (location.hostname == "affiliates.brooksbrothers.com") {
	window.location="http://www.brooksbrothers.com/affiliates/landing_affiliates.tem";
}


///////////////////////////////////////////////////////////////////////////////////////////////////
//  memory variables used to control application status.
//
//	acceptable values are "up" or "down".
//
//
//  BB = Brooks brothers
//  memLuxury = membership for Luxury Brands web application status.
//  memValue = membership for Value Brands web application status.
//  memBoys = membership for Brooks Boys web application status.
//
///////////////////////////////////////////////////////////////////////////////////////////////////

BB = "up";
memLuxury = "up";
memValue = "up";
memBoys = "up";


///////////////////////////////////////////////////////////////////////////////////////////////////
//  do not change the logic below.  change the memory variable values above only.
///////////////////////////////////////////////////////////////////////////////////////////////////

if (location.hostname == "membership.brooksbrothers.com") {
	if (memLuxury == "up") {
		window.location="http://65.215.52.17/MemEnrollment/jsp/LuxurySplash.jsp"; }
	else {
		window.location="http://www.brooksbrothers.com/404.tem";
   	}
}

if (location.hostname == "boys.brooksbrothers.com") {
	if (memBoys == "up") {
		window.location="http://65.215.52.17/MemEnrollment/jsp/BBBoysSplash.jsp"; }
	else {
		window.location="http://www.brooksbrothers.com/404.tem";
   	}
}

if (location.hostname == "brooksbrothers.com" || location.hostname == "http://brooksbrothers.com") {
  	window.location = "http://www.brooksbrothers.com/";
}

<!-- Detect platform -->
Mac = navigator.userAgent.indexOf("Mac") > -1;


rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd()
{
	rnd.seed = (rnd.seed*9301+49297) % 233280;
	return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

function unInstallCookies() {
		deleteCookie('BB_FirstName');
		deleteCookie('BB_User');
		window.location = "https://www.brooksbrothers.com/Members.tem";
}

function chk_l()
{
	var user_l = (navigator.language) ? navigator.language : navigator.userLanguage;
	var bbhm = get_c("BBHM");
	var bbjr = get_c("BBJR");
	if (bbhm === "001")
	{
		if (bbjr != "001")
		{
			if (pref_l.indexOf("ja") != -1)
			{
				if (user_l.indexOf("ja") != -1)
				{
				set_c('BBJR','001')
				window.location = "http://www.brooksbrothers.com/japan.tem"
				}
			}
		}
	}
}

function setupPage() {
	setFooterEmailTextToLongVersion()
	set_c('BBHM','001')
	chk_l()
}
function nsReload(init) {
	//nsReload(true);
}
