/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','4401',jdecode('Product+Range'),jdecode(''), jdecode('%2F4401%2Findex.html'), 'true',[ 
		['PAGE','3901',jdecode('Baby+Care'),jdecode(''), jdecode('%2F4401%2F3901.html'), 'true',[],'',''],
		['PAGE','3401',jdecode('Bath+Salts%2C+Teas+%26+Melts'),jdecode(''), jdecode('%2F4401%2F3401.html'), 'true',[],'',''],
		['PAGE','3943',jdecode('Body+Scrubs'),jdecode(''), jdecode('%2F4401%2F3943.html'), 'true',[],'',''],
		['PAGE','3964',jdecode('Body+Powders'),jdecode(''), jdecode('%2F4401%2F3964.html'), 'true',[],'',''],
		['PAGE','3985',jdecode('Face+Care'),jdecode(''), jdecode('%2F4401%2F3985.html'), 'true',[],'',''],
		['PAGE','4006',jdecode('Foot+Care'),jdecode(''), jdecode('%2F4401%2F4006.html'), 'true',[],'',''],
		['PAGE','4027',jdecode('Fragrance'),jdecode(''), jdecode('%2F4401%2F4027.html'), 'true',[],'',''],
		['PAGE','11501',jdecode('Gift+Packs'),jdecode(''), jdecode('%2F4401%2F11501.html'), 'true',[],'',''],
		['PAGE','4048',jdecode('Hand+%26+Nail+Care'),jdecode(''), jdecode('%2F4401%2F4048.html'), 'true',[],'',''],
		['PAGE','3922',jdecode('Healing+%26+Treatment+Balms'),jdecode(''), jdecode('%2F4401%2F3922.html'), 'true',[],'',''],
		['PAGE','4069',jdecode('Lip+Care'),jdecode(''), jdecode('%2F4401%2F4069.html'), 'true',[],'',''],
		['PAGE','4090',jdecode('Massage+Balms+%26+Oils'),jdecode(''), jdecode('%2F4401%2F4090.html'), 'true',[],'',''],
		['PAGE','4111',jdecode('Skin+Care'),jdecode(''), jdecode('%2F4401%2F4111.html'), 'true',[],'',''],
		['PAGE','4132',jdecode('Soaps+%26+Hand+Wash'),jdecode(''), jdecode('%2F4401%2F4132.html'), 'true',[],'','']
	],'',''],
	['PAGE','1852',jdecode('Online+Shop'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','1873',jdecode('Contact+Us'),jdecode(''), jdecode('%2F1873.html'), 'true',[],'',''],
	['PAGE','2301',jdecode('Search'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2122',jdecode('Dates+for+your+calendar'),jdecode(''), jdecode('%2F2122.html'), 'true',[],'',''],
	['PAGE','2601',jdecode('Testimonials'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'',''],
	['PAGE','1894',jdecode('Links'),jdecode(''), jdecode('%2F1894.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='88A6B5';
theSitetree.keyvisualId='11351';
theSitetree.keyvisualName='kv_11351.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13936';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp32-tnz',
  product: 'WSCSYSSSSLYTC22A'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vita02',
				paletteFamily: 	'88A6B5',
				keyvisualId: 	'11351',
				keyvisualName: 	'kv_11351.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13936',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				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['4001']=webappMappings['4001-15725963']={
webappId:    '4001',
documentId:  '1852',
internalId:  '15725963',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110303-011939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20110812-170732'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '2301',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100328-021518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20110416-060628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20100418-065537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100328-015807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20110416-060936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20110513-195635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20101003-220146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3943',
internalId:  '',
customField: '20101003-224524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4006',
internalId:  '',
customField: '20101003-224845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4027',
internalId:  '',
customField: '20101003-224929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4048',
internalId:  '',
customField: '20101003-225018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3964',
internalId:  '',
customField: '20101003-224638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4090',
internalId:  '',
customField: '20101003-225233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3985',
internalId:  '',
customField: '20101003-224739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20110424-233552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4069',
internalId:  '',
customField: '20110416-051737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4111',
internalId:  '',
customField: '20110416-060815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4132',
internalId:  '',
customField: '20110416-043545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20100223-194327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20110424-233642'
};
webappMappings['7008']=webappMappings['7008-15934']={
webappId:    '7008',
documentId:  '1873',
internalId:  '15934',
customField: 'language:en;country:US;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CAUP';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = 'Natural%2C+Beauty%2C+Body%2C+Baby%2C+Health%2C+Bath%2C+Gift+Packs%2C+Face+Care%2C+Organic%2C+Hand+Care%2C+New+Zealand+Made%2C+Hand+Made%2C+Hawkes+Bay%2C+Foot+Care%2C+Essential+Oils%2C+Carrier+Oils%2C+Body+Scrub%2C+Body+Powder%2C+Talculm+Free%2C+Baby+Care%2C+Eczema%2C+Massage%2C+Soap%2C+Bath+Salts%2C+Nail+Care%2C+Fragrance%2C+Perfume%2C+Lip+Balm%2C+Aiceanta';
var metaContents  = 'Aiceanta+-+Natural+Beauty+%26+Body+Products+-+Made+in+Hawkes+Bay%2C+New+Zealand.';
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();
};

