/* [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','1614',jdecode('Home'),jdecode(''),'/1614.html','true',[],'',''],
	['PAGE','18190',jdecode('Equipment'),jdecode(''),'/18190/index.html','true',[ 
		['PAGE','24412',jdecode('Opus+1'),jdecode(''),'/18190/24412.html','true',[],'',''],
		['PAGE','24438',jdecode('Opus+2'),jdecode(''),'/18190/24438.html','true',[],'',''],
		['PAGE','24464',jdecode('Opus+3'),jdecode(''),'/18190/24464.html','true',[],'',''],
		['PAGE','24490',jdecode('Spray+Machines'),jdecode(''),'/18190/24490.html','true',[],'',''],
		['PAGE','25312',jdecode('Prices'),jdecode(''),'/18190/25312.html','true',[],'','']
	],'',''],
	['PAGE','18216',jdecode('Retail+Line'),jdecode(''),'/18216.html','true',[],'',''],
	['PAGE','25212',jdecode('Training'),jdecode(''),'/25212.html','true',[],'',''],
	['PAGE','25238',jdecode('Contact+Us'),jdecode(''),'/25238.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='F1AA13';
theSitetree.keyvisualId='9809';
theSitetree.keyvisualName='kv_9809.jpg';
theSitetree.fontsetId='17629';
theSitetree.graphicsetId='13034';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'F1AA13',
				keyvisualId: 	'9809',
				keyvisualName: 	'kv_9809.jpg',
				fontsetId: 		'17629',
				graphicsetId: 	'13034',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1614',
internalId:  '',
customField: '20100305-232553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18216',
internalId:  '',
customField: '20091210-012157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18190',
internalId:  '',
customField: '20100213-211342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24412',
internalId:  '',
customField: '20091210-005544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24438',
internalId:  '',
customField: '20091210-011115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24464',
internalId:  '',
customField: '20091210-011409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24490',
internalId:  '',
customField: '20091210-011957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25312',
internalId:  '',
customField: '20091210-012142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25212',
internalId:  '',
customField: '20091210-012210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25238',
internalId:  '',
customField: '20100111-220914'
};
webappMappings['7008']=webappMappings['7008-6208']={
webappId:    '7008',
documentId:  '25238',
internalId:  '6208',
customField: 'language:en;country:GB;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1614',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-11040393']={
webappId:    '1501',
documentId:  '1614',
internalId:  '11040393',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3MPD';
var companyName   = 'Liquid+Sunshine+-+Los+Gatos+-+%28408%29+354.0627';
var htmlTitle	  = '';
var metaKeywords  = 'Airbrush+Tanning+Los+Gatos%2C+spray+tan%2C+spray+tan+equipment%2C+airbrush+equipment%2C+air+brush+equipment%2C+fake+tan%2C+fake+tanning%2C+spray+tanning%2C+spray+tan+california%2C+airbrush+tan+california%2C+los+gatos+fake+tan%2C+los+gatos+tanning%2C+liquid+sunshine%2C+st+tropez%2C+fanatsy+tan%2C+tanning+machines%2C+tan+booth%2C+tanning+booth%2C+airbrush+extractor%2C+tanning+extractor%2C+mystic+tanning+booth%2C+mystic+tan%2C+Airbrush+tanning%2C+airbrush+salons%2C+tanning+salons%2C+tanning+Los+gatos%2C+tanning+down+town+los+gatos%2C+airbrush+packages%2C+airbrush+equipment%2C+spray+tanning%2C+spray+tanning+salons%2C+spray+tanning+equipment%2C+mobile+airbrush%2C+mobile+tanning%2C+mobile+spray+tanning%2C+custom+air+brush%2C+custom+spray+tanning%2C+air+brush+Los+gatos%2C+spray+tanning+Los+gatos%2C+air+brush+equipment+suppliers%2C+tanning+Los+gatos%2C+tanning+down+town+Los+gatos%2C+tanning+equipment%2C+tanning+equipment+Los+gatos%2C+tanning+san+Jose%2C+airbrush+tanning+san+Jose%2C+tanning+equipment+san+Jose+';
var metaContents  = 'Custom+Airbrush+Tanning+Los+Gatos%2C+quality+airbrush+tanning+for+that+natural+looking+tan+without+the+dangers+of+UV.+Prevent+premature+skin+aging+and+risk+of+cancer%2C+get+a+natural+tan+the+safe+way.+Suppliers+of+airbrush+tanning+equipment+from+leading+equipment+designer+and+manufacturer+in+UK.';
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();
};
