/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','22701',jdecode('Shop'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','15401',jdecode('Hugger+Sleep+Sack'),jdecode(''),'/15401/index.html','true',[ 
		['PAGE','3122',jdecode('Learn'),jdecode(''),'/15401/3122.html','true',[],''],
		['PAGE','473',jdecode('Shop'),jdecode(''),'/15401/473.html','true',[],'']
	],''],
	['PAGE','15422',jdecode('Snugger+Sling'),jdecode(''),'/15422/index.html','true',[ 
		['PAGE','3143',jdecode('Learn'),jdecode(''),'/15422/3143.html','true',[],''],
		['PAGE','452',jdecode('Shop'),jdecode(''),'/15422/452.html','true',[],'']
	],''],
	['PAGE','3164',jdecode('Testimonials'),jdecode(''),'/3164.html','true',[],''],
	['PAGE','536',jdecode('Retailers'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','9201',jdecode('Find+a+local+retailer'),jdecode(''),'/536/9201.html','true',[],''],
		['PAGE','9222',jdecode('Become+a+retailer'),jdecode(''),'/536/9222.html','true',[],''],
		['PAGE','23501',jdecode('Apply+for+a+wholesale+account'),jdecode(''),'/536/23501.html','true',[],'']
	],''],
	['PAGE','24301',jdecode('Shipping+%26+Policies'),jdecode(''),'/24301.html','true',[],''],
	['PAGE','557',jdecode('Contact+Us'),jdecode(''),'/557.html','true',[],''],
	['PAGE','515',jdecode('About+us'),jdecode(''),'/515.html','true',[],''],
	['PAGE','578',jdecode('Press+Room'),jdecode(''),'/578.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Kingston';
theSitetree.paletteFamily='042287';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11146';
theSitetree.graphicsetId='11955';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='88BAEE';
var theTemplate={
				name: 			'Kingston',
				paletteFamily: 	'042287',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11146',
				graphicsetId: 	'11955',
				contentColor: 	'000000',
				contentBGColor: '88BAEE',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090307-184901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20090309-221552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15422',
internalId:  '',
customField: '20090511-124854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090309-220831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090309-221144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3122',
internalId:  '',
customField: '20070121-212014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090309-221521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3143',
internalId:  '',
customField: '20090511-125457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3164',
internalId:  '',
customField: '20090307-175645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20090307-175024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20070927-184353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20090307-184815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20090307-175146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20090307-174049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090307-174213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20070120-000527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20070101-182611'
};
webappMappings['1002']=webappMappings['1002-3164ahw050inea9n']={
webappId:    '1002',
documentId:  '3164',
internalId:  '3164ahw050inea9n',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-2322']={
webappId:    '7008',
documentId:  '23501',
internalId:  '2322',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEA9N';
var companyName   = 'Lil+Bugger+Ltd.+++++++++++++++++++++++++++++++++++++++Comfort+for+Kids.+.+.+Peace+for+Parents';
var htmlTitle	  = 'www.lilbugger.biz';
var metaKeywords  = 'baby+sling+sleep+sack+lil+bugger+hugger+snugger+wrap+little+wearable+blanket+sleepsack+infant+child+toddler';
var metaContents  = 'Homepage+for+Lil+Bugger%2C+LLC.+A+fast+growing+company+producing+stylish%2C+comfortable+and+practical+products+for+both+baby+and+parent.+The+Lil+Bugger+Snugger+is+a+fashion+forward+baby+sling+designed+for+todays+active+parent.+The+Lil+Bugger+Hugger+is+a+wearable+blanket+designed+to+keep+baby+warm+and+safe+while+sleeping.+Both+products+provide+exeptional+Comfort+for+Kids+and+Peace+for+Parents';
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();
};
