/* [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','22001',jdecode('Home'),jdecode(''),'/22001.html','true',[],'',''],
	['PAGE','22052',jdecode('Basic+Concept'),jdecode(''),'/22052.html','true',[],'',''],
	['PAGE','22078',jdecode('User+Benefits'),jdecode(''),'/22078.html','true',[],'',''],
	['PAGE','22104',jdecode('Technical+Benefits'),jdecode(''),'/22104.html','true',[],'',''],
	['PAGE','22130',jdecode('Our+Patents'),jdecode(''),'/22130.html','true',[],'',''],
	['PAGE','22156',jdecode('FM+Convergence'),jdecode(''),'/22156.html','true',[],'',''],
	['PAGE','22182',jdecode('Mobile+Radiation'),jdecode(''),'/22182.html','true',[],'',''],
	['PAGE','22208',jdecode('FMP+Comments'),jdecode(''),'/22208.html','true',[],'',''],
	['PAGE','22234',jdecode('Contact+Us'),jdecode(''),'/22234.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='415';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='93A6CC';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'415',
				contentColor: 	'FFFFFF',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				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['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22001',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20100309-160309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22052',
internalId:  '',
customField: '20100308-154237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22078',
internalId:  '',
customField: '20100308-154339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22104',
internalId:  '',
customField: '20100312-165408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22130',
internalId:  '',
customField: '20100308-154502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22156',
internalId:  '',
customField: '20100308-154545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22182',
internalId:  '',
customField: '20100308-154629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22208',
internalId:  '',
customField: '20100308-154652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22234',
internalId:  '',
customField: '20100308-154825'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22052',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22078',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22104',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22130',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22156',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22182',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22208',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22234',
internalId:  '',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3NX7';
var companyName   = 'Fixed+Mobile+Phone';
var htmlTitle	  = 'Fixed+Mobile+Phone';
var metaKeywords  = 'Fixed+Mobile%2C+Fixed+Mobile+Convergence%2C+Fixed+Cellular%2C+Mobile+Cordless%2C+Cellular+Cordless%2C+Mobile+Fixed%2C+Mobile+to+Fixed%2C+Mobile+Phone+Radiation%2C+Cell+Phone+Radiation';
var metaContents  = 'This+patented+2-piece+phone+system+offers+a+holistic+solution+to+the+following+key+issues%3A++Fixed-Mobile+Convergence%2C+Mobile+Phone+Radiation.++It+provides+a+simple%2C+robust+method+of+making+%22mobile%2Fcell+phone%22+calls+from+a+fixed+location+and+reduces+user+exposure+to+mobile%2Fcell++phone+radiation+when+on+the+move.++Our+UK-based+company+has+patented+this+exciting++personal+communication+concept.++It+comprises+a+low+radiation+cordless+handset+communicating+via+the+transponder+when+mobile%2C+or%2C+via+a+landline+when+the+transponder+is+inserted+into+its+battery+charger.++We+are+seeking+expressions+of+interest+from+potential+licensees%2C+or%2C+joint+venture+partners+to+bring+the+system+to+market.++%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';
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();
};
