/* [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','4701',jdecode('Home'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','4752',jdecode('Request+a+Quote'),jdecode(''),'/4752.html','true',[],'',''],
	['PAGE','11801',jdecode('BT+Versatility+Cards'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','33001',jdecode('BT+Versatility+Systems'),jdecode(''),'/33001.html','true',[],'',''],
	['PAGE','28501',jdecode('BT+Versatility+Telephones'),jdecode(''),'/28501.html','true',[],'',''],
	['PAGE','28601',jdecode('BT+Versatility+Cords'),jdecode(''),'/28601.html','true',[],'',''],
	['PAGE','28627',jdecode('BT+Versatility+Voicemail'),jdecode(''),'/28627.html','true',[],'',''],
	['PAGE','29401',jdecode('BT+Versatility+Door+Kits'),jdecode(''),'/29401.html','true',[],'',''],
	['PAGE','30901',jdecode('Previous+BT+Systems'),jdecode(''),'/30901.html','true',[],'',''],
	['PAGE','25601',jdecode('Cords+%26+Leads'),jdecode(''),'/25601.html','true',[],'',''],
	['PAGE','13501',jdecode('Networking'),jdecode(''),'/13501.html','true',[],'',''],
	['PAGE','13527',jdecode('Home+Worker'),jdecode(''),'/13527.html','true',[],'',''],
	['PAGE','13553',jdecode('Maintenance'),jdecode(''),'/13553.html','true',[],'',''],
	['PAGE','13579',jdecode('Remote+Support'),jdecode(''),'/13579.html','true',[],'',''],
	['PAGE','13701',jdecode('Contact+Us'),jdecode(''),'/13701.html','true',[],'',''],
	['PAGE','17601',jdecode('Music+On+Hold'),jdecode(''),'/17601.html','true',[],'',''],
	['PAGE','27301',jdecode('Downloads'),jdecode(''),'/27301.html','true',[],'',''],
	['PAGE','28201',jdecode('New+IP+Lynk+System'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','31701',jdecode('BT+Inspiration'),jdecode(''),'/31701.html','false',[],'',''],
	['PAGE','31727',jdecode('BT+Pathway'),jdecode(''),'/31727.html','false',[],'',''],
	['PAGE','31753',jdecode('BT+Revelation'),jdecode(''),'/31753.html','false',[],'',''],
	['PAGE','30301',jdecode('BT+Versatility+Voicemail+Full+Range'),jdecode(''),'/30301.html','false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='5252B6';
theSitetree.keyvisualId='9817';
theSitetree.keyvisualName='kv_9817.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13032';
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: 	'5252B6',
				keyvisualId: 	'9817',
				keyvisualName: 	'kv_9817.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13032',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100420-210549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4752',
internalId:  '',
customField: '20100315-175400'
};
webappMappings['7008']=webappMappings['7008-6895']={
webappId:    '7008',
documentId:  '4752',
internalId:  '6895',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100611-143748'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20100315-175152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13527',
internalId:  '',
customField: '20100315-175038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13553',
internalId:  '',
customField: '20100315-174958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13579',
internalId:  '',
customField: '20100315-174928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20100315-174856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20100315-174755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20100408-193017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27301',
internalId:  '',
customField: '20100601-220130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28501',
internalId:  '',
customField: '20100601-222743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20100601-221056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28601',
internalId:  '',
customField: '20100601-224013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28627',
internalId:  '',
customField: '20100611-142338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20100614-213615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100611-141811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20100611-161104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20100611-164057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31727',
internalId:  '',
customField: '20100611-160948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31753',
internalId:  '',
customField: '20100611-160948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20100614-212239'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN3R9U';
var companyName   = 'BT+Versatility+++++++++++++++++++++++++++++++++++++Call%3A++01275+857910';
var htmlTitle	  = '';
var metaKeywords  = 'BT+Versatility%2C';
var metaContents  = 'We+are+installers+%26+Suppliers+of+New+%26+Refurbished+BT+Versatility+telephone+systems%2C+We+are+Bristol+telephone+engineers%2C+but+operate+across+the+South+of+England+%26+South+Wales.+With+Over+20+years+experience+in+telecommunications+we+we+can+offer+the+complete+package+to+our+customers.+We+deal+in+Leading+brands+such+as+BT+Versatility%2C+Nortel+BCM50%2C+BT+Meridian+Norstar+%26+Panasonic+Telephone+Systems.';
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();
};
