/* [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','9012',jdecode('Home'),jdecode(''),'/9012/index.html','true',[ 
		['PAGE','11912',jdecode('GPS+Mobile'),jdecode(''),'/9012/11912.html','true',[],'',''],
		['PAGE','11938',jdecode('GPS+Tracking'),jdecode(''),'/9012/11938.html','true',[],'',''],
		['PAGE','11964',jdecode('GPS+Energy'),jdecode(''),'/9012/11964.html','true',[],'',''],
		['PAGE','11990',jdecode('GPS+Telecoms'),jdecode(''),'/9012/11990.html','true',[],'',''],
		['PAGE','12612',jdecode('GPS+Systems+%26+Leasing'),jdecode(''),'/9012/12612.html','true',[],'','']
	],'',''],
	['PAGE','11412',jdecode('About+us'),jdecode(''),'/11412/index.html','true',[ 
		['PAGE','11438',jdecode('How+to+find+us'),jdecode(''),'/11412/11438.html','true',[],'','']
	],'',''],
	['PAGE','11464',jdecode('Contact+Us'),jdecode(''),'/11464.html','true',[],'',''],
	['PAGE','12016',jdecode('Business+Services'),jdecode(''),'/12016.html','true',[],'',''],
	['PAGE','12042',jdecode('GPS+European+T%26%23x27%3Bs+%26+C%26%23x27%3Bs'),jdecode(''),'/12042/index.html','true',[ 
		['PAGE','11712',jdecode('Terms+%26+Conditions'),jdecode(''),'/12042/11712.html','true',[],'',''],
		['PAGE','13312',jdecode('AUP'),jdecode(''),'/12042/13312.html','true',[],'',''],
		['PAGE','13712',jdecode('Privacy+Statement'),jdecode(''),'/12042/13712.html','true',[],'',''],
		['PAGE','13738',jdecode('Legal+Notices'),jdecode(''),'/12042/13738.html','true',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Moonflight';
theSitetree.paletteFamily='5B7A93';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='445';
theSitetree.graphicsetId='499';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Moonflight',
				paletteFamily: 	'5B7A93',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'445',
				graphicsetId: 	'499',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'2C5574',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9012',
internalId:  '',
customField: '20100111-174825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11712',
internalId:  '',
customField: '20100302-102131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11438',
internalId:  '',
customField: '20100111-183937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12042',
internalId:  '',
customField: '20100302-103222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12016',
internalId:  '',
customField: '20100302-103034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11912',
internalId:  '',
customField: '20100302-103034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11938',
internalId:  '',
customField: '20100302-103034'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9012',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11964',
internalId:  '',
customField: '20100302-103034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11990',
internalId:  '',
customField: '20100302-103034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12612',
internalId:  '',
customField: '20100302-105136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13312',
internalId:  '',
customField: '20100309-124906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13712',
internalId:  '',
customField: '20100309-145445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13738',
internalId:  '',
customField: '20100309-145331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11412',
internalId:  '',
customField: '20100302-104902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11464',
internalId:  '',
customField: '20100302-111355'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3WJC';
var companyName   = 'GPS+European+Ltd';
var htmlTitle	  = '';
var metaKeywords  = 'Telecoms%2C+fixed+line%2C+data%2C+broadband%2C+inter+country%2C+discounts%2C+savings%2C+customer+service%2C+support.';
var metaContents  = 'Independant+Telecoms+provider%2C+base+throught+Europe+offering+unrivaled+products%2C+services+and+customer+service';
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();
};

