/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','46522',jdecode('Anti-aging+Cream'),jdecode(''),'/46522.html','true',[],''],
	['PAGE','46543',jdecode('Base+Cream'),jdecode(''),'/46543.html','true',[],''],
	['PAGE','46564',jdecode('Its+Nit+Genocide%21'),jdecode(''),'/46564.html','true',[],''],
	['PAGE','41601',jdecode('Shopping+Basket'),jdecode(''),'/41601.html','true',[],''],
	['PAGE','773',jdecode('Technical+Information'),jdecode(''),'/773.html','true',[],''],
	['PAGE','752',jdecode('About+Witch%26%23x27%3Bs+Brew'),jdecode(''),'/752.html','true',[],''],
	['PAGE','857',jdecode('Testimonials'),jdecode(''),'/857.html','true',[],''],
	['PAGE','878',jdecode('Contact+and+Links'),jdecode(''),'/878.html','true',[],''],
	['PAGE','46501',jdecode('Guestbook'),jdecode(''),'/46501.html','true',[],''],
	['PAGE','9301',jdecode('FAQ'),jdecode(''),'/9301.html','true',[],''],
	['PAGE','43001',jdecode('Thank+You'),jdecode(''),'/43001.html','false',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Sonnemond';
theSitetree.paletteFamily='DCFCD7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10759';
theSitetree.graphicsetId='10813';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='DCFCD7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Sonnemond',
				paletteFamily: 	'DCFCD7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10759',
				graphicsetId: 	'10813',
				contentColor: 	'000000',
				contentBGColor: 'DCFCD7',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5C5898',
				e_color: 		'ED4747',
				f_color: 		'437D3B',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100209-004047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20100209-004241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100201-070106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100208-210220'
};
webappMappings['1501']=webappMappings['1501-18241371']={
webappId:    '1501',
documentId:  '701',
internalId:  '18241371',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46501',
internalId:  '',
customField: '20100129-052154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20100208-210356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20091105-051256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20091105-041048'
};
webappMappings['4001']=webappMappings['4001-17252849']={
webappId:    '4001',
documentId:  '41601',
internalId:  '17252849',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20100214-194838'
};
webappMappings['1002']=webappMappings['1002-46501abri20invlld']={
webappId:    '1002',
documentId:  '46501',
internalId:  '46501abri20invlld',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46522',
internalId:  '',
customField: '20100209-004448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46543',
internalId:  '',
customField: '20100209-004600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46564',
internalId:  '',
customField: '20100208-065540'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI20INVLLD';
var companyName   = 'The+Witch%27s+Brew';
var htmlTitle	  = 'The+Witch%27s+Brew';
var metaKeywords  = 'Organic+skin+care%2C+super+foods%2C+herbs%2C+lacto-fermentation%2C+edible%2C+anti-aging%2C+shea+butter%2C+lard%2C+weston+a+price%2C+beauty%2C+health%2C+rejuvenation%2C+do+it+yourself%2C+base+cream%2C+naturopath%2C+traditional%2C+home+made%2C+nits%2C+lice.';
var metaContents  = 'Organic+and+edible+skin+care%2C+natural+traditional+remedies+and+products%2C+anti-aging+wonder+cream%2C+all+natural+nit+remover%2C+make+your+own+creams%2C+traditional+skin+care+recipes';
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();
};
