var bStaging
if (location.host.indexOf('sgweb') != -1)
{
	bStaging = true
}
else
{
	bStaging = false
}

var menuPos=40;
var nMenu=0




var menuList=new Array();
menuList['0a']="HomeTours";
menuList['0b']="NeighborhoodTours";
if (! blnAgent) {
	menuList['0c']="OfficeTours";
	menuList['0d']="AboutFirstTeam";
	menuList['0e']="Detours";
	menuList['0f']="Relocation";
} else {
	menuList['0c']="AboutFirstTeam";
	menuList['0d']="Detours";
}
menuList['2a']="Feature";
menuList['3a']="Article";
menuList['4a']="QuickSearch";
if (!blnAgent) {
	menuList['6a'] = "Job";
}

HomeTours_content = "";
NeighborhoodTours_content = "";
OfficeTours_content = "";
AboutFirstTeam_content = "";
Detours_content = "";
Relocation_content = "";
Feature_content = "";
Article_content = "";
QuickSearch_content = "";
Job_content = "";

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function replaceDHTML(){
	replaceContent('HomeTours',HomeTours_content);
	replaceContent('NeighborhoodTours',NeighborhoodTours_content);
	replaceContent('AboutFirstTeam',AboutFirstTeam_content);
	replaceContent('Detours',Detours_content);
	if (!blnAgent) {
		replaceContent('OfficeTours',OfficeTours_content);
		replaceContent('Relocation',Relocation_content);
	}
	replaceContent('Feature',Feature_content);
	replaceContent('Article',Article_content);
	replaceContent('QuickSearch',QuickSearch_content);
	if (!blnAgent) {
		replaceContent('Job',Job_content);
	}

}

var HomeToursMenu=new Array();
HomeToursMenu['numItems']=4;
HomeToursMenu['I1']="Property Search";
HomeToursMenu['I1href']=cLink+"homes/propertysearchcontents.asp";
HomeToursMenu['I2']="Open Houses";
HomeToursMenu['I2href']=cLink+"homes/openhouses.asp";
HomeToursMenu['I3']="Estate Properties";
HomeToursMenu['I3href']=cLink+"homes/estateproperties.asp";
HomeToursMenu['I4']="Virtual Tours";
HomeToursMenu['I4href']=cLink+"homes/virtualtours.asp";
var yAxis = 57; 
createMenu("HomeTours",125,(yAxis)+navAdjustor,225);
nMenu++;

var NeighborhoodToursMenu=new Array();
NeighborhoodToursMenu['numItems']=1;
NeighborhoodToursMenu['I1']="Neighborhood Search";
NeighborhoodToursMenu['I1href']=cLink+"neighborhoods/neighborhoods.asp";
var yAxis = 81; 
createMenu("NeighborhoodTours",125,(yAxis)+navAdjustor,225);
nMenu++;

if (! blnAgent) {
	var OfficeToursMenu=new Array();
	OfficeToursMenu['numItems']=2;
	OfficeToursMenu['I1']="Office/Agent Search";
	OfficeToursMenu['I1href']=cLink+"offices/officeagent.asp";
	OfficeToursMenu['I2']="Careers at First Team";	
	OfficeToursMenu['I2href']="http://careers.firstteam.com";
	var yAxis = 107; 
	createMenu("OfficeTours",125,(yAxis)+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
	nMenu++;
}



if (! blnAgent) 
{
	var AboutFirstTeamMenu=new Array();
	AboutFirstTeamMenu['numItems']=6;
	AboutFirstTeamMenu['I1']="First In Our Hearts Foundation";
	AboutFirstTeamMenu['I1href']=cLink+"aboutfirsteam/aboutfirsteamcontents.asp";
	AboutFirstTeamMenu['I2']="About First Team Real Estate";
	AboutFirstTeamMenu['I2href']=cLink+"aboutfirsteam/aboutfirsteam.asp";
	AboutFirstTeamMenu['I3']="Meet the Founder & President";
	AboutFirstTeamMenu['I3href']=cLink+"aboutfirsteam/meettheteam.asp";
	AboutFirstTeamMenu['I4']="Careers at First Team";
	AboutFirstTeamMenu['I4href']="http://careers.firstteam.com";
	AboutFirstTeamMenu['I5']="News @ First Team";
	AboutFirstTeamMenu['I5href']=cLink+"aboutfirsteam/newsatft.asp";
	AboutFirstTeamMenu['I6']="Request for Info";
 }
 else
{
	var AboutFirstTeamMenu=new Array();
	AboutFirstTeamMenu['numItems']=5;
	AboutFirstTeamMenu['I1']="First In Our Hearts Foundation";
	AboutFirstTeamMenu['I1href']=cLink+"aboutfirsteam/aboutfirsteamcontents.asp";
	AboutFirstTeamMenu['I2']="About First Team Real Estate";
	AboutFirstTeamMenu['I2href']=cLink+"aboutfirsteam/aboutfirsteam.asp";
	AboutFirstTeamMenu['I3']="Meet the Founder & President";
	AboutFirstTeamMenu['I3href']=cLink+"aboutfirsteam/meettheteam.asp";
	AboutFirstTeamMenu['I4']="News @ First Team";
	AboutFirstTeamMenu['I4href']=cLink+"aboutfirsteam/newsatft.asp";
	AboutFirstTeamMenu['I5']="Request for Info";

 }

var Path_contactus;

//alert("blnAgent:" + blnAgent + "\n" + "bTeam:" + bTeam + "\n" + "bStaging:" + bStaging + "\n" + "jsAgent_nm:" + jsAgent_nm + "\n" + "jsAgent_id:" + jsAgent_id + "\n")

if (blnAgent) //this is an agent site
{
	var jsAgent_nm = document.getElementById("jsAgentName").value;
	var jsAgent_id = document.getElementById("jsAgentId").value;
	if (!bTeam) //this is a single agent
	{
		if (bStaging)
		{
			Path_contactus = "JavaScript:openRegistration(\"http://sgregistration.firstteam.com/registration.aspx?target=comment&confText=Thank%20you%20for%20your%20request.%20%20I%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20my%20site.%20%20You%20may%20also%20call%20me%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20I%20will%20contact%20you%20soon.&szOptOut=I%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20I%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20my%20site.&szOptOutHL=Thank%20you%20for%20visiting%20my%20web%20site.&agentName=" + jsAgent_nm + "&agentID=" + jsAgent_id + "\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"

		}
		else
		{ 	
			Path_contactus = "JavaScript:openRegistration(\"http://registration.firstteam.com/registration.aspx?target=comment&confText=Thankyou%20for%20your%20request.%20%20I%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20my%20site.%20%20You%20may%20also%20call%20me%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20I%20will%20contact%20you%20soon.&szOptOut=I%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20I%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20my%20site.&szOptOutHL=Thank%20you%20for%20visiting%20my%20web%20site.&agentName=" + jsAgent_nm + "&agentID=" + jsAgent_id + "\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"
			
		} // end of platform evaluation for a single agent
	}
	else // is a team 
	{
		if (bStaging)
		{ 
			Path_contactus = "JavaScript:openRegistration(\"http://sgregistration.firstteam.com/registration.aspx?target=comment&confText=Thank%20you%20for%20your%20request.%20%20We%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20our%20site.%20%20You%20may%20also%20call%20us%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20We%20will%20contact%20you%20soon.&szOptOut=We%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20We%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20our%20site.&szOptOutHL=Thank%20you%20for%20visiting%20our%20web%20site.&agentName=" + jsAgent_nm + "&agentID=" + jsAgent_id + "\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"
		}
		else
		{	
			Path_contactus = "JavaScript:openRegistration(\"http://registration.firstteam.com/registration.aspx?target=comment&confText=Thank%20you%20for%20your%20request.%20%20We%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20our%20site.%20%20You%20may%20also%20call%20us%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20We%20will%20contact%20you%20soon.&szOptOut=We%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20We%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20our%20site.&szOptOutHL=Thank%20you%20for%20visiting%20our%20web%20site.&agentName=" + jsAgent_nm + "&agentID=" + jsAgent_nm + "\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"
		} // end of platform evaluation for a team
	} // end of team evaluation
}
else //this is a corporate site
{
		if (bStaging)
		{ 
			Path_contactus = "JavaScript:openRegistration(\"http://sgregistration.firstteam.com/registration.aspx?target=comment&confText=Thank%20you%20for%20your%20request.%20%20We%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20our%20site.%20%20You%20may%20also%20call%20us%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20We%20will%20contact%20you%20soon.&szOptOut=We%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20We%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20our%20site.&szOptOutHL=Thank%20you%20for%20visiting%20our%20web%20site.\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"
		}
		else
		{	
			Path_contactus = "JavaScript:openRegistration(\"http://registration.firstteam.com/registration.aspx?target=comment&confText=Thank%20you%20for%20your%20request.%20%20We%20will%20contact%20you%20promptly%20via%20e-mail%20or%20telephone.%20%20For%20specific%20information%20about%20loan%20approvals,%20market%20trends,%20information%20about%20a%20specific%20property,%20or%20other%20valuable%20real%20estate%20services,%20please%20click%20on%20the%20links%20throughout%20our%20site.%20%20You%20may%20also%20call%20us%20directly%20at%20the%20numbers%20listed%20below.%20%20Thanks%20again.%20%20We%20will%20contact%20you%20soon.&szOptOut=We%20hope%20you%20find%20this%20site%20useful%20during%20your%20home%20buying%20or%20selling%20experience.%20We%20would%20be%20happy%20to%20assist%20you%20with%20any%20of%20your%20real%20estate%20needs%20and%20welcome%20your%20comments%20regarding%20our%20site.&szOptOutHL=Thank%20you%20for%20visiting%20our%20web%20site.\",\"Registration\",270,240,\"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0\",-1);"
		} // end of platform evaluation for a team

}//end of agent vs. corporate evaluation


var Title_contactus;
Title_contactus="Registration";
var Features_contactus;
Features_contactus="toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0";

if (! blnAgent) {
	AboutFirstTeamMenu['I6href']=Path_contactus
	yAxis = 137;
}
else
{
	AboutFirstTeamMenu['I5href']=Path_contactus
	yAxis = 110;
}



createMenu("AboutFirstTeam",125,(yAxis)+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
nMenu++;

var cDisc = getCookie("pass");


var PathDetour_contactus;

if (bStaging)
{
	PathDetour_contactus="http://sgregistration.firstteam.com/registration.aspx?target=contactus&szOptOut=This is the opt out text for some menu based Request for Info&szOptOutHL=some Menu Request for Info&agentName="+ agentName ;	
} 	
else 		
{
	PathDetour_contactus="http://registration.firstteam.com/registration.aspx?target=contactus&szOptOut=This is the opt out text for some menu Request for Info&szOptOutHL=Some menu Headline&agentName="+ agentName ;	
}

var TitleDetour_contactus;
TitleDetour_contactus="Registration";
var FeaturesDetour_contactus;
FeaturesDetour_contactus="toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=0";


if (cDisc == "1") {
	var DetoursMenu=new Array();
	DetoursMenu['numItems']=3;
	DetoursMenu['I1']="Articles";
	DetoursMenu['I1href']=cLink+"re_info/realestateinfo.asp";
	DetoursMenu['I2']="Discussions";
	DetoursMenu['I2href']=cLink+"re_info/discussions.asp";
	//DetoursMenu['I3']="Enter Our Drawing";
	DetoursMenu['I3']="";
	DetoursMenu['I3href']="JavaScript:openRegistration(PathDetour_contactus,TitleDetour_contactus,270,240,FeaturesDetour_contactus,-1);";	
			
	createMenu("Detours",125,(menuPos+31*nMenu)+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
	
} else {
	var DetoursMenu=new Array();
	DetoursMenu['numItems']=1;
	DetoursMenu['I1']="Articles";
	DetoursMenu['I1href']=cLink+"re_info/realestateinfo.asp";
	//DetoursMenu['I2']="Enter Our Drawing";	
	//DetoursMenu['I2']="";	
	//DetoursMenu['I2href']="JavaScript:openRegistration(PathDetour_contactus,TitleDetour_contactus, 270, 240, FeaturesDetour_contactus,-1);";	
	
	createMenu("Detours",125,(menuPos+31*nMenu)+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
}
nMenu++;

if (! blnAgent) {
	var RelocationMenu=new Array();
	RelocationMenu['numItems']=5;
	RelocationMenu['I1']="About First Team Relocation";
	RelocationMenu['I1href']=cLink+"relocation/aboutrelo.asp";
	RelocationMenu['I2']="Relocation Services";
	RelocationMenu['I2href']=cLink+"relocation/reloservices.asp";
	RelocationMenu['I3']="REO Services";
	RelocationMenu['I3href']=cLink+"relocation/reoservices.asp";
	RelocationMenu['I4']="Service Areas";
	RelocationMenu['I4href']=cLink+"relocation/relooffices.asp";
	RelocationMenu['I5']="Request for Info";
	
	
	var RegistrationPagePath_RELO;
	if (bStaging)
	{
		RegistrationPagePath_RELO="http://sgregistration.firstteam.com/registration.aspx?target=contactus&szOptOut=Whether you are moving around the block, city to city or state to state First Team Relocation offers free information such as Buyers Guides, area packages, relocation services and more!&szOptOutHL=Relocation Services";	
	} 	
	else 		
	{
		RegistrationPagePath_RELO="http://registration.firstteam.com/registration.aspx?target=contactus&szOptOut=Whether you are moving around the block, city to city or state to state First Team Relocation offers free information such as Buyers Guides, area packages, relocation services and more!&szOptOutHL=Relocation Services";	
	}

	var RegistrationPageTitle_RELO;
	RegistrationPageTitle_RELO="Registration";
	var RegistrationPageFeatures_RELO;
	RegistrationPageFeatures_RELO="toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0";
	
	RelocationMenu['I5href']="JavaScript:openRegistration(RegistrationPagePath_RELO,RegistrationPageTitle_RELO,270,240,RegistrationPageFeatures_RELO,-1);";	
	yAxis = 185;
	createMenu("Relocation",125,(yAxis)+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
	nMenu++;
}

var FeatureMenu=new Array();
FeatureMenu['numItems']=1;
FeatureMenu['I1']="View featured properties <A HREF=\"featuredproperties.asp\"><FONT COLOR=\"#000000\">here</FONT></A>.";
FeatureMenu['I1href']="null";
FeatureMenu['I1height']="1";
createMenu("Feature",125,(menuPos+(blnAgent ? 115 : 160))+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);

var ArticleMenu=new Array();
ArticleMenu['numItems']=1;
ArticleMenu['I1']="View 360 Degree Panoramic Virtual Tours <A HREF=\"homes\/virtualtours.asp\">here.<\/A>.";
ArticleMenu['I1href']="null";
ArticleMenu['I1height']="2";
createMenu("Article",125,(menuPos+(blnAgent ? 150 : 190))+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);

var QuickSearchMenu=new Array();
QuickSearchMenu['numItems']=1;
QuickSearchMenu['I1']="To search for a property by newspaper ID#, enter it in the box below and click the <B>search</B> button:";
QuickSearchMenu['I1href']="null";
QuickSearchMenu['I1height']="2";
createMenu("QuickSearch",125,(menuPos+(blnAgent ? 240 : 290))+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);

if (! blnAgent) {
	var JobMenu=new Array();
	JobMenu['numItems']=1;
	JobMenu['I1']="View current job opportunities at First Team <A HREF=\"careers\/jobboard.asp\">here.<\/A>.";	
	JobMenu['I1href']="null";
	JobMenu['I1height']="2";
	createMenu("Job",125,(menuPos+(blnAgent ? 350 : 390))+navAdjustor,255);     //function createMenu(menuName,originX,originY,height);
}


