/* [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','4801',jdecode('Oatmealsoap+Home'),jdecode(''), jdecode('%2F4801.html'), 'true',[],'',''],
	['PAGE','1406',jdecode('About%2FContact+Us'),jdecode(''), jdecode('%2F1406.html'), 'true',[],'',''],
	['PAGE','1311',jdecode('PRODUCTS'),jdecode(''), jdecode('%2F1311.html'), 'true',[],'',''],
	['PAGE','4827',jdecode('SoapmakingCourses'),jdecode(''), jdecode('%2F4827.html'), 'true',[],'',''],
	['PAGE','4527',jdecode('Aromatherapy'),jdecode(''), jdecode('%2F4527.html'), 'true',[],'',''],
	['PAGE','4501',jdecode('Reiki'),jdecode(''), jdecode('%2F4501.html'), 'true',[],'',''],
	['PAGE','8301',jdecode('Specials'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Kids';
theSitetree.paletteFamily='B8B2D6';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17074';
theSitetree.graphicsetId='12451';
theSitetree.contentColor='5A6804';
theSitetree.contentBGColor='F8F8EE';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKIE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kids',
				paletteFamily: 	'B8B2D6',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17074',
				graphicsetId: 	'12451',
				contentColor: 	'5A6804',
				contentBGColor: 'F8F8EE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4527',
internalId:  '',
customField: '20110815-124048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20110815-145848'
};
webappMappings['7008']=webappMappings['7008-9153']={
webappId:    '7008',
documentId:  '1406',
internalId:  '9153',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1311',
internalId:  '',
customField: '20120213-124529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20120209-203026'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20111027-181642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1406',
internalId:  '',
customField: '20120209-203814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4827',
internalId:  '',
customField: '20110815-135240'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30INV17J';
var companyName   = 'The+Oatmeal+Soap+Company';
var htmlTitle	  = 'The+Oatmeal+Soap+Company+';
var metaKeywords  = 'soap+for+sensitive+skin%2Cnatural+soap%2CRooibos+skin+care%2Ceczema%2Cexma%2Cexema%2Cecxema%2Cecxma%2Ceczma%2Cpsoriasis%2Cpure%2Cnatural%2Chandcrafted%2Cskin%2Cproducts%2Coils%2Cessential%2Cbath%2Cacne%2Csoap%2COlive%2CCoconut%2Cmoisturising%2CIdeal%2Csensitive%2Coatmealsoap%2Csmells%2Ckitchensoap%2Cdry%2Crelieve%2Cpamper%2Ctester+packs%2Crecyclable%2Cgreen%2Cenvironment%2Cnot+tested+on+animals%2Clavender%2Cherbs%2Cspices%2Cylang+ylang%2Choney%2Cherbal%2Cchamomile%2Crooibos%2Cruibos%2Ccitrus%2Cfloral%2Cspicy%2Cmarbled%2Cluxury%2Csoapmaking+courses%2Creiki+treatments%2C+aromatherapy+oils';
var metaContents  = 'Kathryn+Howarth+at+the+Oatmeal+Soap+Company+makes+pure+natural+soaps+and+skincare+products+for+eczema+and+psoriasis+sufferers.++Ideal+for+anyone+with+a+sensitive+skin%2C+%0Aour+luxury+soaps+and+creams+are+handcrafted.++Soapmaking+courses+available.++Reiki+and+aromatherapy+sessions%2Fattunements.';
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();
};

