/* [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','10701',jdecode('Home'),jdecode(''),'/10701.html','true',[],'',''],
	['PAGE','10752',jdecode('Technical+Solutions'),jdecode(''),'/10752.html','true',[],'',''],
	['PAGE','10804',jdecode('Carbon+Fibre+Solutions'),jdecode(''),'/10804.html','true',[],'',''],
	['PAGE','10778',jdecode('Engineered+Textiles'),jdecode(''),'/10778.html','true',[],'',''],
	['PAGE','13827',jdecode('Intelligent+Energy'),jdecode(''),'/13827.html','true',[],'',''],
	['PAGE','16901',jdecode('Carbon+Fibre+Cable'),jdecode(''),'/16901.html','true',[],'',''],
	['PAGE','17001',jdecode('Alternatives+to+steel'),jdecode(''),'/17001.html','true',[],'',''],
	['PAGE','10830',jdecode('Contact'),jdecode(''),'/10830.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20091122-234846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10778',
internalId:  '',
customField: '20090324-191102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10752',
internalId:  '',
customField: '20090324-215145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10804',
internalId:  '',
customField: '20091122-233659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13827',
internalId:  '',
customField: '20090324-222532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10830',
internalId:  '',
customField: '20091122-233804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100218-172053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20100218-175713'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEPMP';
var companyName   = 'Nygo+Limited+';
var htmlTitle	  = 'Carbon+fibre+cables%2C+carbon+fibre+engineering+products+design+and+manufacture.+Stronger+%26+lighter+than+steel.';
var metaKeywords  = 'carbon+fibre%2C+carbon+fibre+cable%2C+carbon+fibre+rope%2C+composites%2C+advanced+materials%2C+CF+composites%2C+carbon+fibre+products%2C+construction%2C+building%2C+composite+design%2C+manhole%2C+manhole+cover%2C+cover%2C+bridge+strengthening%2C+buidling+support%2C+re-inforcement%2C+carbon+fibre+re+inforcement%2C+re+inforce+bridges%2C+bespoke+carbon+fibre%2C+military+materials%2C+militiary+composites%2C+advanced+composites%2C+carbon+fibre+building+material%2C+carbon+fibre+I+beam%2C+carbon+fibre+man+hole+cover%2C+carbon+fibre+%2B+cars%2C+carbon+fibre+%2B+automotive%2C+carbon+fibre+%2B+transport%2C+carbon+fibre+%2B+IEE%2C+IEE%2C+intelligent+energy%2C+intelligent+energy+europe%2C+low+energy%2C+light+weight+materials%2C+light+weight+cars%2C+light+weight+trucks%2C+light+weight+containers%2C+cargo+containers%2C+light+weight+cargo+containers%2C+alternatives+to+steel.';
var metaContents  = 'Carbon+fibre+materials+for+engineering+and+construction.+Carbon+fibre+composites+for+every+day+use.++Advanced+materials.++Light+weight%2C+strong++rigid.+Improving+safety+and+efficiency.+Improving+strength+and+re-inforcing+structures+in-situ.++Lowering+transport+costs+and+weight+ratios.';
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();
};
