function breadCrumb()
{
primary = new Array()
for (i = 0; i < 9; i++) {
	primary[i] = new Array(20)
	for (j = 0; j < 20; j++) {
		primary[i][j] = new Array(20)
		for (k = 0; k < 20; k++) {
			primary[i][j][k] = new Array(20)}}}
	primary[0][0][0][0] = "welcome,http://www.statefarm.com/homepage.htm";
	primary[1][0][0][0] = "welcome,http://www.statefarm.com/homepage.htm";
	primary[1][1][0][0] = "login,http://www.statefarm.com/account.htm";
	primary[1][2][0][0] = "register,http://www.statefarm.com/signup.htm";
	primary[1][3][0][0] = "getting started,http://www.statefarm.com/getstart.htm";
	primary[1][4][0][0] = "sitemap,http://www.statefarm.com/sitemap.htm";
	primary[1][5][0][0] = "contact us,http://www.statefarm.com/email.htm";
	primary[2][0][0][0] = "my account,http://www.statefarm.com/account.htm";
	primary[2][1][0][0] = "login,http://www.statefarm.com/account.htm";
	primary[2][2][0][0] = "access email,https://secure.sfimail.statefarm.com/Gram/GramWeb.dll?GramWebRouteCustomer&";
	primary[2][3][0][0] = "change layout,https://my.statefarm.com/apps/portal/portallayout.asp";
	primary[2][4][0][0] = "change password,https:\\online.statefarm.com\apps\sessionMgmt\ChangePassword.asp?returnURL=https://my.statefarm.com/apps/portal/Portal.asp";
	primary[2][5][0][0] = "edit my profile,https://my.statefarm.com/apps/portal/editprofile.asp";
	primary[2][6][0][0] = "contact us,http://online.statefarm.com/mycontact.asp";
	primary[2][7][0][0] = "logoff,https://my.statefarm.com/apps/SessionMgmt/logoff.asp";
	primary[3][0][0][0] = "insurance,http://www.statefarm.com/insuranc/insuranc.htm";
	primary[3][1][0][0] = "access my policies,http://www.statefarm.com/insuranc/accespol.htm";
	primary[3][2][0][0] = "learn about insurance,http://www.statefarm.com/insuranc/insuranc.htm";
	primary[3][2][1][0] = "auto,http://www.statefarm.com/insuranc/auto/auto.htm";
	primary[3][2][2][0] = "homeowners,http://www.statefarm.com/insuranc/homeown/homeown.htm";
	primary[3][2][3][0] = "condo owners,http://www.statefarm.com/insuranc/homeown/condo.htm";
	primary[3][2][4][0] = "renters,http://www.statefarm.com/insuranc/renters/renters.htm";
	primary[3][2][5][0] = "life &amp; annuities,http://www.statefarm.com/insuranc/life/life.htm";
	primary[3][2][6][0] = "health &amp; disability,http://www.statefarm.com/insuranc/health/health.htm";
	primary[3][2][7][0] = "long-term care,http://www.statefarm.com/insuranc/ltc/ltc.htm";
	primary[3][2][8][0] = "business,http://www.statefarm.com/insuranc/business/business.htm";
	primary[3][2][9][0] = "boat,http://www.statefarm.com/insuranc/boat/boat.htm";
	primary[3][2][10][0] = "other insurance,http://www.statefarm.com/insuranc/addins/addins.htm";
	primary[3][3][0][0] = "get a rate quote,http://www.statefarm.com/quote/quote.htm";
	primary[3][3][1][0] = "auto,http://www.statefarm.com/quote/arq.htm";
	primary[3][3][3][0] = "condo owners,http://www.statefarm.com/quote/condo.htm";
	primary[3][3][4][0] = "renters,http://www.statefarm.com/quote/renters.htm";
	primary[3][3][5][0] = "life,http://www.statefarm.com/quote/life.htm";
	primary[3][4][0][0] = "buy online,http://www.statefarm.com/insuranc/buy.htm";
	//primary[3][5][0][0] = "retrieve a saved quote,https://cust-sfpub.statefarm.com/cgi-bin/fortecgi?ServiceName=VINSHTTPAccessSO&TemplateName=vintpl/common/manage_application/all_saved_quotes_welcome.tmpl&appname=welcome&help=sv_about_sf&lob=All&product=All&rand=" + offHours + offMinutes + offSeconds + "";
	primary[3][6][0][0] = "identify my needs,http://www.statefarm.com/insuranc/needs.htm";
	primary[3][7][0][0] = "report a claim or follow-up,http://www.statefarm.com/claims/claims.htm";
	primary[3][7][1][0] = "auto,http://www.statefarm.com/insuranc/auto/auto.htm";
	primary[3][7][2][0] = "homeowners,http://www.statefarm.com/insuranc/homeown/homeown.htm";
	primary[3][7][3][0] = "condo owners,http://www.statefarm.com/insuranc/homeown/condo.htm";
	primary[3][7][4][0] = "rent,http://www.statefarm.com/insuranc/homeown/condo.htm";
	primary[3][7][5][0] = "life &amp; annuities,http://www.statefarm.com/insuranc/life/life.htm";
	primary[3][7][6][0] = "health &amp; disability,http://www.statefarm.com/insuranc/health/health.htm";
	primary[3][7][7][0] = "long-term care,http://www.statefarm.com/insuranc/ltc/ltc.htm";
	primary[3][7][8][0] = "business,http://www.statefarm.com/insuranc/business/business.htm";
	primary[3][7][9][0] = "boat,http://www.statefarm.com/insuranc/boat/boat.htm";
	primary[3][7][10][0] = "other insurance,http://www.statefarm.com/insuranc/addins/addins.htm";
	primary[3][8][0][0] = "make a payment,https://online.statefarm.com/apps/ebpp/W0064755_billsum.asp";
	primary[3][9][0][0] = "contact us,http://www.statefarm.com/insuranc/contact.htm";
	primary[4][0][0][0] = "banking,http://www.statefarm.com/bank/bank.htm";
	primary[4][0][4][0] = "leases,http://www.statefarm.com/bank/lease.htm";
	primary[4][1][0][0] = "access my account,http://www.statefarm.com/jscript/bankacct.htm";
	primary[4][2][0][0] = "apply now,https://www.statefarm.com/apps/NewAccount/BankAccountApplication.ASP";
	primary[4][3][0][0] = "get rates,http://www.statefarm.com/bank/rates.htm";
	primary[4][4][0][0] = "bank accounts,http://www.statefarm.com/bank/accounts.htm";
	primary[4][5][0][0] = "credit cards,http://www.statefarm.com/bank/credit.htm";
	primary[4][6][0][0] = "loans,http://www.statefarm.com/bank/loans.htm";
	primary[4][7][0][0] = "tools &amp; resources,http://www.statefarm.com/bank/learning.htm";
	primary[4][8][0][0] = "contact us,http://www.statefarm.com/bank/contact.htm";
	primary[5][0][0][0] = "mutual funds,http://www.statefarm.com/mutual/mutual.htm";
	primary[5][1][0][0] = "access my account,http://www.statefarm.com/mutual/trac.htm";
	primary[5][2][0][0] = "open an account,http://www.statefarm.com/mutual/open.htm";
	primary[5][3][0][0] = "funds,http://www.statefarm.com/mutual/funds.htm";
	primary[5][4][0][0] = "accounts &amp; services,http://www.statefarm.com/mutual/acctsvc.htm";
	primary[5][5][0][0] = "retirement,http://www.statefarm.com/mutual/retire.htm";
	primary[5][6][0][0] = "investor education,http://www.statefarm.com/mutual/learning.htm";
	primary[5][7][0][0] = "literature &amp; forms,http://www.statefarm.com/mutual/forms.htm";
	primary[5][8][0][0] = "contact us,http://www.statefarm.com/mutual/contact.htm";
	primary[6][0][0][0] = "planning &amp; learning,http://www.statefarm.com/planning/planning.htm";
	primary[6][1][0][0] = "insurance &amp; financial learning,http://www.statefarm.com/planning/ifr.htm";
	primary[6][2][0][0] = "prevention &amp; safety,http://www.statefarm.com/consumer/consum.htm";
	primary[6][2][1][0] = "vehicle &amp; road safety,http://www.statefarm.com/consumer/car.htm";
	primary[6][2][1][1] = "child passenger safety,http://www.statefarm.com/kidsafety.htm";
	primary[6][2][1][2] = "dangerous intersections,http://www.statefarm.com/di/danger.htm";
	primary[6][2][2][0] = "home safety,http://www.statefarm.com/consumer/home.htm";
	primary[6][2][2][1] = "good neighbor house,http://www.statefarm.com/homesafety.htm";
	primary[6][2][3][0] = "natural disasters,http://www.statefarm.com/consumer/disaster.htm";
	primary[6][2][4][0] = "free educational programs,http://www.statefarm.com/educate/kits.htm";
	primary[6][2][5][0] = "business safety,http://www.statefarm.com/planning/smallbus.htm";
	primary[6][3][0][0] = "life events &amp; stages,http://www.statefarm.com/lifevents/lifevents.htm";
	primary[6][3][1][0] = "getting married,http://www.statefarm.com/lifevents/married.htm";
	primary[6][3][2][0] = "having a baby,http://www.statefarm.com/lifevents/baby.htm";
	primary[6][3][3][0] = "moving,http://www.statefarm.com/lifevents/moving.htm";
	primary[6][3][4][0] = "planning for retirement,http://www.statefarm.com/lifevents/retire.htm";
	primary[6][3][5][0] = "planning for college,http://www.statefarm.com/lifevents/college.htm";
	primary[6][3][6][0] = "planning your financial security,http://www.statefarm.com/lifevents/financial.htm";
	primary[6][3][7][0] = "buying a car,http://www.statefarm.com/lifevents/car.htm";
	primary[6][3][8][0] = "buying a home,http://www.statefarm.com/lifevents/home.htm";
	primary[6][3][9][0] = "selling your home,http://www.statefarm.com/lifevents/selltips.htm";
	primary[6][3][10][0] = "renting a place,http://www.statefarm.com/lifevents/rent.htm";
	primary[6][3][11][0] = "paying your bills,http://www.statefarm.com/lifevents/bills.htm";
	primary[6][3][12][0] = "starting a business,http://www.statefarm.com/lifevents/business.htm";
	primary[6][3][13][0] = "getting a new job,http://www.statefarm.com/lifevents/job.htm";
	primary[6][3][14][0] = "getting out on your own,http://www.statefarm.com/lifevents/onyourown.htm";
	primary[6][3][15][0] = "damage to auto or home,http://www.statefarm.com/lifevents/damage.htm";
	primary[6][3][16][0] = "other life events,http://www.statefarm.com/lifevents/other.htm";
	primary[6][4][0][0] = "retirement planning,http://www.statefarm.com/lifevents/retire.htm";
	primary[6][4][4][0] = "retirement planning,http://www.statefarm.com/lifevents/retire.htm";
	primary[6][5][0][0] = "college planning,http://www.statefarm.com/lifevents/college.htm";
	primary[6][5][5][0] = "planning for college,http://www.statefarm.com/lifevents/college.htm";
	primary[6][6][0][0] = "small businesses,http://www.statefarm.com/planning/smallbus.htm";
	primary[6][6][5][0] = "business safety,http://www.statefarm.com/planning/smallbus.htm";
	primary[6][6][12][0] = "starting a business,http://www.statefarm.com/planning/smallbus.htm";
	primary[6][7][0][0] = "calculators,http://www.statefarm.com/lifevents/calculators2.htm";
	primary[6][8][0][0] = "taxes,http://www.statefarm.com/lifevents/taxcenter/tax.htm";
	primary[6][8][16][0] = "taxes,http://www.statefarm.com/lifevents/taxcenter/tax.htm";
	primary[6][9][0][0] = "kid stuff,http://www.statefarm.com/kidstuf/kidstuf.htm";
	primary[7][0][0][0] = "agents,http://www.statefarm.com/agents/agents.htm";
	primary[7][1][0][0] = "find an agents,http://www.statefarm.com/jscript/easysrch.htm";
	primary[7][2][0][0] = "email an agent,http://www.statefarm.com/jscript/easysrch.htm";
	primary[7][3][0][0] = "about our agents,http://www.statefarm.com/agents/doforme.htm";
	primary[8][0][0][0] = "about state farm,http://www.statefarm.com/about/about.htm";
	primary[8][1][0][0] = "our company,http://www.statefarm.com/about/about.htm";
	primary[8][2][0][0] = "careers,http://www.statefarm.com/careers/index.htm";
	primary[8][2][1][0] = "current openings,http://www.statefarm.com/careers/jobopp.htm";
	primary[8][2][2][0] = "just for students,http://www.statefarm.com/careers/campus.htm";
	primary[8][2][3][0] = "benefits & more,http://www.statefarm.com/careers/whysf.htm";
	primary[8][2][4][0] = "diversity,http://www.statefarm.com/careers/diversity.htm";
	primary[8][2][5][0] = "our locations,http://www.statefarm.com/careers/locations.htm";
	primary[8][2][6][0] = "recruiting events,http://www.statefarm.com/careers/fairs.htm";
	primary[8][2][7][0] = "ask a recruiter,http://www.statefarm.com/apps/email/EmailRecruiter/EmailRecruiter.asp";
	primary[8][2][8][0] = "apply now,http://www.statefarm.com/careers/apply.htm";
	primary[8][3][0][0] = "newsroom,http://www.statefarm.com/media/media.htm";
	primary[8][4][0][0] = "community involvement,http://www.statefarm.com/commun/commun.htm";
	primary[8][4][1][0] = "our locations,http://www.statefarm.com/sflocal/sflocal.htm";
	primary[8][4][2][0] = "education excellence,http://www.statefarm.com/edexcell/edexcell.htm";
	primary[8][4][3][0] = "good neighbor citizenship,http://www.statefarm.com/foundati/citizenship.htm";
	primary[8][4][4][0] = "partnerships,http://www.statefarm.com/partners/partners.htm";
	primary[8][4][5][0] = "free educational programs,http://www.statefarm.com/educate/educate.htm";
	primary[8][5][0][0] = "sponsorships,http://www.statefarm.com/sponsors/sponsors.htm";
	primary[8][6][0][0] = "privacy,http://www.statefarm.com/about/privacy.htm";
	primary[8][7][0][0] = "contact us,http://www.statefarm.com/email.htm";

x = headId;
y = subheadId;
z = leftId;
s = subLeftId
var regexp = /,/g
prim = primary[x][0][0][0];
sec = primary[x][y][0][0];
ter = primary[x][y][z][0];
qua = primary[x][y][z][s];
var myPrim = prim.split(regexp);
var mySec = sec.split(regexp);
var myTer = ter.split(regexp);
var myQua = qua.split(regexp);
primText = myPrim[0];
primLink = myPrim[1];
secText = mySec[0];
secLink = mySec[1];
terText = myTer[0];
terLink = myTer[1];	
quaText = myQua[0];
quaLink = myQua[1];
if (x == 4){
	brdCrumb1 = ("<a href=\"http://www.statefarm.com/jscript/bexit.htm?loc=homepage.htm\" class=\"breadcrumbs\">home</a><span class=\"breadnolink\"> &gt; </span><a href=\"" + primLink + "\" class=\"breadcrumbs\">" + primText + "</a>");	
}
else {	
	brdCrumb1 = ("<a href=\"http://www.statefarm.com/homepage.htm\" class=\"breadcrumbs\">home</a><span class=\"breadnolink\"> &gt; </span><a href=\"" + primLink + "\" class=\"breadcrumbs\">" + primText + "</a>");
}	
brdCrumb2 = ("<span class=\"breadnolink\"> &gt; </span><a href=\"" + secLink + "\" class=\"breadcrumbs\">" + secText + "</a>");
brdCrumb3 = ("<span class=\"breadnolink\"> &gt; </span><a href=\"" + terLink + "\" class=\"breadcrumbs\">" + terText + "</a>");
brdCrumb4 = ("<span class=\"breadnolink\"> &gt; </span><a href=\"" + quaLink + "\" class=\"breadcrumbs\">" + quaText + "</a>");
if ((homepage == true && ((x != 3 && y != 2) || (x != 6 && y != 2))) || z == 0){
	if (y == 0 && z == 0){
		brdCrumb = (brdCrumb1);
	}
	else if (homepage == true && y != 0 && z == 0){
		brdCrumb = (brdCrumb1);	
	}	
	else{
		brdCrumb = (brdCrumb1 + brdCrumb2);
	}
}
else {
	if ((x == 3 && y == 2) || (x == 6 && y == 2)){
		if (homepage == true){
			brdCrumb = (brdCrumb1);
		}
		else if (x == 6 && y == 2 && s!= 0){
			brdCrumb = (brdCrumb1 + brdCrumb2 + brdCrumb4);
		}
		else {
			brdCrumb = (brdCrumb1 + brdCrumb3);
		}
	}
	else { 
	brdCrumb = (brdCrumb1 + brdCrumb2 + brdCrumb3);
	}
}				

document.writeln(brdCrumb); 

}

