/* [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 theSitetree=[ 
	['PAGE','4001',jdecode('Home'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','11643',jdecode('Shop'),jdecode(''),'/11643.html','false',[],''],
	['PAGE','11422',jdecode('Our+Products'),jdecode(''),'/11422.html','true',[],''],
	['PAGE','11622',jdecode('Gift+Registry'),jdecode(''),'/11622.html','true',[],''],
	['PAGE','18901',jdecode('Reduce+Reuse+Recycle'),jdecode(''),'/18901.html','true',[],''],
	['PAGE','15201',jdecode('FAQs'),jdecode(''),'/15201/index.html','true',[ 
		['PAGE','15401',jdecode('Cotton'),jdecode(''),'/15201/15401.html','true',[],''],
		['PAGE','15001',jdecode('What+is+BPA%3F'),jdecode(''),'/15201/15001.html','true',[],''],
		['PAGE','15601',jdecode('Plastics+by+number'),jdecode(''),'/15201/15601.html','true',[],''],
		['PAGE','15801',jdecode('What+is+PVC%3F'),jdecode(''),'/15201/15801.html','true',[],'']
	],''],
	['PAGE','11601',jdecode('What%26%23x27%3Bs+New'),jdecode(''),'/11601.html','true',[],''],
	['PAGE','11401',jdecode('Keep+In+Touch'),jdecode(''),'/11401.html','true',[],''],
	['PAGE','11485',jdecode('Hours+%26+Location'),jdecode(''),'/11485.html','true',[],''],
	['PAGE','11443',jdecode('About+Us'),jdecode(''),'/11443.html','true',[],''],
	['PAGE','19801',jdecode('Friends'),jdecode(''),'/19801.html','true',[],''],
	['PAGE','27101',jdecode('Job+Shop'),jdecode(''),'/27101.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32124';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32124',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100312-160928'
};
webappMappings['7008']=webappMappings['7008-1214']={
webappId:    '7008',
documentId:  '11401',
internalId:  '1214',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-732d8cc76fb055152f24a364825f5970']={
webappId:    '7060',
documentId:  '11422',
internalId:  '732d8cc76fb055152f24a364825f5970',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1215']={
webappId:    '7008',
documentId:  '11622',
internalId:  '1215',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100312-162258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11622',
internalId:  '',
customField: '20100212-153120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20100206-160926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11422',
internalId:  '',
customField: '20100206-170725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11443',
internalId:  '',
customField: '20100225-120903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20100314-164036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11485',
internalId:  '',
customField: '20100212-153235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11643',
internalId:  '',
customField: '20090530-133223'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '11485',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['4001']=webappMappings['4001-18325527']={
webappId:    '4001',
documentId:  '11643',
internalId:  '18325527',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20090627-130422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20100206-171324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090627-132046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090627-134316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20090627-134713'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100312-161317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20100212-153707'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLG5I';
var companyName   = '431+Main+Downtown+Rochester';
var htmlTitle	  = 'Green+Baby+';
var metaKeywords  = 'Green+Baby+Rochester+MI%2C+Green+Baby%2C+Michelle+Billeci%2C+Downtown+Rochester%2C+Organic+Baby+Clothes%2C+organic+crib+mattress%2C+organic+bed%2C+organic+nursery%2C+';
var metaContents  = 'Green+Baby+carries+natural%2C+organic%2C+and+ecofriendly+baby+products+from+0-4t.+Green+Baby+is+located+at+431+Main+in+downtown+Rochester%2C+MI+48307.+248-650-0700.';
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();
};
