/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','1601',jdecode('WNY+Pregnancy+%26+Baby+Expo'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','2301',jdecode('Vendors'),jdecode(''),'/2301/index.html','true',[ 
		['PAGE','2322',jdecode('Contract'),jdecode(''),'/2301/2322.html','true',[],'','']
	],'',''],
	['PAGE','3401',jdecode('FAQs'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','6201',jdecode('Who+We+Help'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','3301',jdecode('Location'),jdecode(''),'/3301.html','true',[],'',''],
	['PAGE','2343',jdecode('Contact+Us'),jdecode(''),'/2343.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='617F92';
theSitetree.keyvisualId='6904';
theSitetree.keyvisualName='kv_6904.jpg';
theSitetree.fontsetId='11217';
theSitetree.graphicsetId='12036';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='809DAF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'617F92',
				keyvisualId: 	'6904',
				keyvisualName: 	'kv_6904.jpg',
				fontsetId: 		'11217',
				graphicsetId: 	'12036',
				contentColor: 	'FFFFFF',
				contentBGColor: '809DAF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-35884']={
webappId:    '7008',
documentId:  '2343',
internalId:  '35884',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20110901-091531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20110916-135827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2322',
internalId:  '',
customField: '20110901-091424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2343',
internalId:  '',
customField: '20110601-231836'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3301',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20110601-220525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20110601-223816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20110901-091034'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INFN58';
var companyName   = 'WNY+PREGNANCY+%26+BABY+EXPO+2011';
var htmlTitle	  = 'WNY+PREGNANCY+%26+BABY+EXPO+2011';
var metaKeywords  = 'Breastfeeding%2C+Babies%2C+Pregnancy%2C+Maternity%2C+Free+seminars%2C+Photographers%2C+Massage+Therapists%2C+Keepsakes%2C+products%2C+support+groups%2C+cloth+diapers%2C+hygeia%2C+breast+pump%2C+breastpumps%2C+lactation%2C+doula%2C+doulas%2C+Polly+Thoman%2C+IBCLC%2C++pediatricians%2C+nurses%2C+cindy+whitaker%2C+cindy+whittaker%2C+bottles%2C+refurbishing%2C+parts%2C+breastpump+parts%2C+nursing+stools%2C+bosom+baby%2C+boppy%2C+nursing%2C+nursing+bra%2C+maternity+tank+top%2C+Glamourmom%2C+Bravado+bra%2C+Bravado+tank%2C+Infant+Massage%2C+Infant+and+Child+CPR%2C+medela%2C+recycle+breastpump%2C+moboleez%2C+nursing+covers%2C+hoother+hiders%2C+Breast+pads%2C+breast+milk%2C+breastmilk+storage+bags%2C+maternity+clothes%2C+maternity+tops%2C+maternity+bottoms%2C+slings%2C+baby+wearing%2C+swaddle+blankets%2C+Happiest+Baby+On+the+Block%2C+BPA+Free%2C+Earth+Mam%2C+Angel+Baby%2C+Wean+Machine%2C+Herbal+Teas%2C+Gripe+Water%2C+Clay+Keepsake+kits%2C+preggie+pops%2C+Queasy+pop+kids%2C+tag-a-long+blankets%2C+soothie+pacifiers%2C+nursing+covers%2C+colic+massage+pads%2C+milkies%2C+baby+goga+bottle+warmers%2C+itzbeen+timer%2C+wubbanubs%2C+baby+food+making+kits%2C+homemade+baby+food%2C+banana+baby+toothbrushes%2C+Western+New+York%2C+Akron%2C+Alden%2C+Alden%2C+Amherst%2C+Angola+on+the+Lake%2C+Angola%2C+%0AAurora%2C+Billington%2C+Heights%2C+Blasdell%2C+Brant%2C+Buffalo%2C+Cheektowaga%2CClarence+%0ACenter%2C+Clarence%2C+Colden%2C+Collins%2C+Concord%2C+Depew%2C+East+Amherst%2C+East+Aurora%2C+%0AEden%2C+Elma+Center%2C+Elma%2C+Evans%2C+Farnham%2C+Gowanda%2C+Grand+Island%2C+Hamburg%2C+Harris+%0AHill%2C+Holland%2C+Kenmore%2C+Lackawanna%2C+Lake+Erie+Beach%2C+Lake+View%2C+Lancaster%2C+%0AMarilla%2C+Newstead+%2CNorth+Boston+North+Collins%2C+Orchard+Park%2C+Sardinia%2C+Sloan%2C+%0ASpringville%2C+Tonawanda%2C+Tonawanda%2C+Town+Line%2C+Wales%2C+West+Seneca%2C+Williamsville%2C+%0ANY+br%26gt%3BRochester%2C+Greece%2C+Henrietta%2C+Fairport%2C+Irondiqoit%2C+NEW+YORK';
var metaContents  = 'WNY+Pregnancy+%26+Baby+Expo.++FREE+ADMISSION%21++2011%27s+Expo+is+located+in+Cheektowaga%2C+New+York.++The+vendor+list+is+growing+with+businesses+and+services+to+help+you+during+your+pregnancy+and+when+your+little+one+is+growing+and+growing%21++Goodie+bags+to+the+first+200+families%21';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

