/* [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 theSitetree=[ 
	['PAGE','1301',jdecode('Home'),jdecode(''),'1301.html','true',[],''],
	['PAGE','2401',jdecode('News+%26+Events'),jdecode(''),'2401.html','true',[],''],
	['PAGE','1352',jdecode('TXI+Partners'),jdecode(''),'1352.html','true',[],''],
	['PAGE','1436',jdecode('VoIP'),jdecode(''),'1436/index.html','true',[ 
		['PAGE','1478',jdecode('Benefits'),jdecode(''),'1436/1478.html','true',[],''],
		['PAGE','1499',jdecode('Infrastructure'),jdecode(''),'1436/1499.html','true',[],''],
		['PAGE','1520',jdecode('FAQ'),jdecode(''),'1436/1520.html','true',[],''],
		['PAGE','1541',jdecode('Licences'),jdecode(''),'1436/1541.html','true',[],''],
		['PAGE','91301',jdecode('Handset+Options'),jdecode(''),'1436/91301.html','true',[],'']
	],''],
	['PAGE','1583',jdecode('Broadband'),jdecode(''),'1583/index.html','true',[ 
		['PAGE','1604',jdecode('SDSL'),jdecode(''),'1583/1604.html','true',[],''],
		['PAGE','1625',jdecode('ADSL'),jdecode(''),'1583/1625.html','true',[],''],
		['PAGE','1646',jdecode('ADSL+MAX'),jdecode(''),'1583/1646.html','true',[],'']
	],''],
	['PAGE','110601',jdecode('Antenna+Services'),jdecode(''),'110601.html','true',[],''],
	['PAGE','1667',jdecode('IT+Services'),jdecode(''),'1667.html','true',[],''],
	['PAGE','1688',jdecode('Mobile+Solutions'),jdecode(''),'1688/index.html','true',[ 
		['PAGE','1709',jdecode('O2'),jdecode(''),'1688/1709.html','true',[],'']
	],''],
	['PAGE','103401',jdecode('++TomTom+Work'),jdecode(''),'103401.html','true',[],''],
	['PAGE','1730',jdecode('Ericom'),jdecode(''),'1730.html','true',[],''],
	['PAGE','1751',jdecode('Citrix'),jdecode(''),'1751/index.html','true',[ 
		['PAGE','1772',jdecode('Citrix+Experience'),jdecode(''),'1751/1772.html','true',[],'']
	],''],
	['PAGE','1793',jdecode('Access+to+TXI+Portals'),jdecode(''),'1793.html','true',[],''],
	['PAGE','1814',jdecode('Contact+Details'),jdecode(''),'1814.html','true',[],''],
	['PAGE','113401',jdecode('Events'),jdecode(''),'113401.html','true',[],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='5252B6';
theSitetree.keyvisualId='9812';
theSitetree.keyvisualName='kv_9812.html';
theSitetree.fontsetId='17628';
theSitetree.graphicsetId='13032';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Valiant',
				paletteFamily: 	'5252B6',
				keyvisualId: 	'9812',
				keyvisualName: 	'kv_9812.jpg',
				fontsetId: 		'17628',
				graphicsetId: 	'13032',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:  '103401',
internalId:  '',
customField: '20080314-085545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20090619-111524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1436',
internalId:  '',
customField: '20080310-145627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1520',
internalId:  '',
customField: '20070622-104851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1499',
internalId:  '',
customField: '20080626-100403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1478',
internalId:  '',
customField: '20080626-100134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20090225-102552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1667',
internalId:  '',
customField: '20070626-163617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1688',
internalId:  '',
customField: '20070720-145333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1541',
internalId:  '',
customField: '20070622-104900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1352',
internalId:  '',
customField: '20080915-161021'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113401',
internalId:  '',
customField: '20090227-112924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1583',
internalId:  '',
customField: '20070703-140024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1604',
internalId:  '',
customField: '20070703-140129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1625',
internalId:  '',
customField: '20070622-104930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1646',
internalId:  '',
customField: '20070622-104937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1709',
internalId:  '',
customField: '20070626-163548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1730',
internalId:  '',
customField: '20070703-141540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1751',
internalId:  '',
customField: '20070703-141649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1772',
internalId:  '',
customField: '20070703-141856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1793',
internalId:  '',
customField: '20070626-163038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1814',
internalId:  '',
customField: '20070718-130030'
};
webappMappings['7008']=webappMappings['7008-616']={
webappId:    '7008',
documentId:  '1814',
internalId:  '616',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91301',
internalId:  '',
customField: '20070731-140458'
};
webappMappings['7060']=webappMappings['7060-e7f6e12eadb8b9b9ca9f5c69753b6114']={
webappId:    '7060',
documentId:  '113401',
internalId:  'e7f6e12eadb8b9b9ca9f5c69753b6114',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110601',
internalId:  '',
customField: '20081021-111658'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN211G';
var companyName   = 'Complete+Communications+Solutions';
var htmlTitle	  = 'Voice+over+IP+VoIP+Solutions%2C+Phone+Services+in+Dorset+UK';
var metaKeywords  = 'voip+solutions%2C+hosted+voice+over+ip%2C+ip+telephony%2C+voip%2C+uk%2C+dorset%2C+hampshire%2C+south%2C+mobile+phones%2C+3g%2C+openhand%2C+polycom%2C+ericom%2C+hipcom%2C+o2+leased+lines%2C+adsl%2C+sdsl%2C+broadband%2C+internet%2C+business+isp%2C+security%2C+solutions%2C+thin+client%2C+cisco%2C+citrix%2Cc+onnectivity%2C+international%2C+roaming%2C+vpn%2C+antivirus%2C+co-location%2C+hosting%2C+facilities';
var metaContents  = 'TXI+Installations+Ltd+is+a+Dorset+based+company+In+the+UK+specialising+in+Voice+over+IP+VoIP+Solutions+using+a+range+of+VoIP+phone+service+providers.';
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__%20%2b%20page%2c%20true%2c%20true.html)).toString();
};
