/* [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','5001',jdecode('HOME'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','114101',jdecode('Reviews+page'),jdecode(''), jdecode('%2F114101.html'), 'true',[],'',''],
	['PAGE','5182',jdecode('PRICING+%26+OFFERS'),jdecode(''), jdecode('%2F5182.html'), 'true',[],'',''],
	['PAGE','105101',jdecode('Driving+schools+colchester'),jdecode(''), jdecode('%2F105101.html'), 'true',[],'',''],
	['PAGE','97401',jdecode('INDEPENDENT+DRIVING'),jdecode(''), jdecode('%2F97401.html'), 'true',[],'',''],
	['PAGE','5078',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F5078.html'), 'true',[],'',''],
	['PAGE','5104',jdecode('PROMISE'),jdecode(''), jdecode('%2F5104.html'), 'true',[],'',''],
	['PAGE','63801',jdecode('ONLINE+BOOKING'),jdecode(''), jdecode('%2F63801.html'), 'true',[],'',''],
	['PAGE','5130',jdecode('AREAS+COVERED'),jdecode(''), jdecode('%2F5130.html'), 'true',[],'',''],
	['PAGE','5052',jdecode('CONTACT'),jdecode(''), jdecode('%2F5052.html'), 'true',[],'',''],
	['PAGE','26627',jdecode('LINKS'),jdecode(''), jdecode('%2F26627.html'), 'true',[],'',''],
	['PAGE','12027',jdecode('DRIVING+TEST'),jdecode(''), jdecode('%2F12027%2Findex.html'), 'true',[ 
		['PAGE','94801',jdecode('Driving+test+report+DL25D'),jdecode(''), jdecode('%2F12027%2F94801.html'), 'true',[],'','']
	],'',''],
	['PAGE','12001',jdecode('THEORY+TEST'),jdecode(''), jdecode('%2F12001.html'), 'true',[],'',''],
	['PAGE','61701',jdecode('Test+Confidence'),jdecode(''), jdecode('%2F61701.html'), 'true',[],'',''],
	['PAGE','61727',jdecode('Pass+pluss'),jdecode(''), jdecode('%2F61727.html'), 'true',[],'',''],
	['PAGE','26601',jdecode('TUTORIALS'),jdecode(''), jdecode('%2F26601.html'), 'true',[],'',''],
	['PAGE','97001',jdecode('Show+me+tell+me'),jdecode(''), jdecode('%2F97001.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='BECCD8';
theSitetree.keyvisualId='11358';
theSitetree.keyvisualName='kv_11358.jpg';
theSitetree.fontsetId='31947';
theSitetree.graphicsetId='13785';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BECCD8';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'BECCD8',
				keyvisualId: 	'11358',
				keyvisualName: 	'kv_11358.jpg',
				fontsetId: 		'31947',
				graphicsetId: 	'13785',
				contentColor: 	'000000',
				contentBGColor: 'BECCD8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20111216-165814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20111102-223551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5078',
internalId:  '',
customField: '20101214-171815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5104',
internalId:  '',
customField: '20101214-171927'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5130',
internalId:  '',
customField: '20101214-172230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20110818-171946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5182',
internalId:  '',
customField: '20110704-171309'
};
webappMappings['7008']=webappMappings['7008-3684']={
webappId:    '7008',
documentId:  '5052',
internalId:  '3684',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12027',
internalId:  '',
customField: '20101214-172817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20090317-184924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26627',
internalId:  '',
customField: '20101214-172642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97401',
internalId:  '',
customField: '20101214-171629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105101',
internalId:  '',
customField: '20101228-135046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61701',
internalId:  '',
customField: '20090813-194845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61727',
internalId:  '',
customField: '20101214-173150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97001',
internalId:  '',
customField: '20101214-173255'
};
webappMappings['1501']=webappMappings['1501-10236576']={
webappId:    '1501',
documentId:  '5001',
internalId:  '10236576',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-5567']={
webappId:    '7008',
documentId:  '63801',
internalId:  '5567',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63801',
internalId:  '',
customField: '20101214-172110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94801',
internalId:  '',
customField: '20100212-205825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114101',
internalId:  '',
customField: '20110617-230457'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEOFP';
var companyName   = 'WELCOME+TO+PULSAR+DRIVING+SCHOOL';
var htmlTitle	  = 'Driving+school';
var metaKeywords  = 'Driving+school%2Cdriving+instructor%2Cdriving%2Clesson%2Cdriving+lessons%2Cdriving+test%2Ctheory+test%2C+online+driving+theory+test%2Clearn+to+drive%2Cpass+plus%2Cpractical+driving+test%2C+driving%2Cschool%2Cessex%2C+driver+training%2C+driving+courses%2Cdriving+instruction%2Clearning+driving%2C+online+driving+schools%2C+pass+your+driving+test%2C+young+drivers%2Clearning+to+drive%2Caa+driving+school';
var metaContents  = 'I+offer+a+friendly%2C+patient%2C+and+professional+service+to+learner+drivers+young+and+old%2C+confident+or+nervous.';
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();
};

