/* [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','10501',jdecode('Locate+an+Instructor'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','6101',jdecode('Services+and+Fees'),jdecode(''), jdecode('%2F6101%2Findex.html'), 'true',[ 
		['PAGE','6205',jdecode('Prices+and+Discounts'),jdecode(''), jdecode('%2F6101%2F6205.html'), 'true',[],'',''],
		['PAGE','6153',jdecode('Special+Offers'),jdecode(''), jdecode('%2F6101%2F6153.html'), 'true',[],'',''],
		['PAGE','6127',jdecode('Terms+%26+Conditions'),jdecode(''), jdecode('%2F6101%2F6127.html'), 'true',[],'','']
	],'',''],
	['PAGE','32501',jdecode('2012+Prices+and+Discounts'),jdecode(''), jdecode('%2F32501.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('On+line+Booking'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','7401',jdecode('Practical+Driving+Courses'),jdecode(''), jdecode('%2F7401%2Findex.html'), 'true',[ 
		['PAGE','28101',jdecode('Basic+Driving+Tuition'),jdecode(''), jdecode('%2F7401%2F28101.html'), 'true',[],'',''],
		['PAGE','6179',jdecode('Intensive+Courses'),jdecode(''), jdecode('%2F7401%2F6179.html'), 'true',[],'',''],
		['PAGE','7801',jdecode('Motorway+Driving'),jdecode(''), jdecode('%2F7401%2F7801.html'), 'true',[],'',''],
		['PAGE','7427',jdecode('Pass+Plus'),jdecode(''), jdecode('%2F7401%2F7427.html'), 'true',[],'',''],
		['PAGE','28127',jdecode('Economic+Driving'),jdecode(''), jdecode('%2F7401%2F28127.html'), 'true',[],'',''],
		['PAGE','29201',jdecode('Return+To+Driving'),jdecode(''), jdecode('%2F7401%2F29201.html'), 'true',[],'','']
	],'',''],
	['PAGE','13227',jdecode('Theory+Training+Course.'),jdecode(''), jdecode('%2F13227.html'), 'true',[],'',''],
	['PAGE','13201',jdecode('Tips+and+Support'),jdecode(''), jdecode('%2F13201.html'), 'true',[],'',''],
	['PAGE','12201',jdecode('Book+Your+Test'),jdecode(''), jdecode('%2F12201.html'), 'true',[],'',''],
	['PAGE','6301',jdecode('Congratulations'),jdecode(''), jdecode('%2F6301.html'), 'true',[],'',''],
	['PAGE','8201',jdecode('Contact+Us'),jdecode(''), jdecode('%2F8201.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2469';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2469',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				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:  '5001',
internalId:  '',
customField: '20110225-204919'
};
webappMappings['7008']=webappMappings['7008-7397']={
webappId:    '7008',
documentId:  '5201',
internalId:  '7397',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100604-122824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20111106-182916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20100604-090432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6153',
internalId:  '',
customField: '20111020-155542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6127',
internalId:  '',
customField: '20100604-090143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6205',
internalId:  '',
customField: '20111106-183352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6179',
internalId:  '',
customField: '20111106-175328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20111106-183559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28127',
internalId:  '',
customField: '20111106-172905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7427',
internalId:  '',
customField: '20111106-183630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20111106-174412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20111106-172849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20111202-100210'
};
webappMappings['7008']=webappMappings['7008-7405']={
webappId:    '7008',
documentId:  '8201',
internalId:  '7405',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100603-164018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20110225-195532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20100610-205743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13227',
internalId:  '',
customField: '20111101-163822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20111117-113518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20111224-153541'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN38P5';
var companyName   = 'The+Safe+Way+Driving+School+++++++';
var htmlTitle	  = 'Safe+Way+Driving+School';
var metaKeywords  = 'driving+school+south+east+london%2Cdriving+schools+in+hertfordshire%2Cdriving+school+in+middlesex%2Cdriving+instructors+london%2Cdriving+instructor+essex%2Cdriving+school+hertfordshire%2Cdriving+lessons+brentwood%2Cdriving+lessons+in+middlesex%2Cdriving+lessons+in+loughton%2Cdriving+lessons+east+london%2Cdriving+lesson+hertfordshire%2Cdriver+training+in+london+%2Clearn+to+drive+hertfordshire%2Cdriver+training+courses+in+london%2Cdriver+training+in+hertfordshire%2Cdriver+training+in+essex%2Cintensive+driving+course+london%2Cdriving+crash+course+in+essex%2Cdriving+tuition+hertfordshire%2Cdriving+theory+test+practice%2Cdriver+theory+test%2Cpass+plus+driving+course%2Cpass+plus+essex%2Cpass+plus+instructors%2C+www.safewaydrivingschool.co.uk%2C+Abbess+Beauchamp%2C+Abridge%2C+Bobbingsworth%2C+Botany+Bay%2C+Bovinger%2C+Broadley+Common%2C+Broxbourne%2C+Buckhurst+Hill%2C+Bumbles+Green%2C+Cheshunt%2C+Chigwell%2C+Chipping+Ongar%2C+Church+Langley%2C+Coopersale%2C+Coopersale+Common%2C+Doddinghurst%2C+Domewood%2C+Enfield%2C+Epping%2C+Epping+Forest%2C+Epping+Green%2C+Epping+Upland%2C+Fiddlers+Hamlet%2C+Fyefield%2C+Gilston%2C+Harlow%2C+Harlow+New+Town%2C+Hastingwood%2C+High+Beech%2C+High+Laver%2C+High+Ongar%2C+High+Wych%2C+Hoddesdon%2C+Ingatestone%2C+Ivy+Chimneys%2C+Leyton%2C+Leytonstone%2C+Loughton%2C+Lower+Nazeing%2C+Magdalen+Laver%2C+Manor+Park%2C+Matching%2C+Matching+Green%2C+Matching+Tye%2C+Moreton%2C+Navestock%2C+Newham%2C+North+Weald%2C+North+Weald+Basett%2C+Old+Harlow%2C+Ongar%2C+Roydon%2C+Roydon+Mill%2C+Sawbridgeworth%2C+South+Woodford%2C+Stanford+Rivers%2C+Stanstead+Abotts%2C+Tawney+Common%2C+Theydon+Bois%2C+Theydon+Garnon%2C+Theydon+Mount%2C+Thornwood%2C+Turnford%2C+Tylers+Green%2C+Upshire%2C+Waltham+Abbey%2C+Waltham+Cross%2C+Waltham+Forest%2C+Walthamstow%2C+Wanstead%2C+Wanstead+Flats%2C+Woodford%2C+Woodford+Green%2C+Wormley%2C+CM15%2C+CM16%2C+CM17%2C+CM18%2C+CM19%2C+CM20%2C+CM21%2C+CM4%2C+CM5%2C+E10%2C+E11%2C+E12%2C+E17%2C+E4%2C+E7%2C+EN1%2C+EN10%2C+EN11%2C+EN2%2C+EN3%2C+EN7%2C+EN8%2C+EN9%2C+IG10%2C+IG7%2C+IG8%2C+IG9%2C+N13%2C+N14%2C+N18%2C+N21%2C+N9%2C+RM4%2C%0D%0A%0D%0A%0D%0A%0D%0A';
var metaContents  = 'At+The+Safe+Way+Driving+School+we+believe+that+learning+to+drive+is+not+just+about+passing+your+driving+test%3B+it%27s+acquiring+a+skill+you+will+use+for+the+rest+of+your+life.++We+teach+you+to+drive+the+SAFE+WAY%2C+so+that+you+can+enjoy+your+driving+through+to+your+mature+years.+Driving+lessons+are+available+in+Abbess+Beauchamp%2C+Abridge%2C+Bobbingsworth%2C+Botany+Bay%2C+Bovinger%2C+Broadley+Common%2C+Broxbourne%2C+Buckhurst+Hill%2C+Bumbles+Green%2C+Cheshunt%2C+Chigwell%2C+Chipping+Ongar%2C+Church+Langley%2C+Coopersale%2C+Coopersale+Common%2C+Doddinghurst%2C+Domewood%2C+Enfield%2C+Epping%2C+Epping+Forest%2C+Epping+Green%2C+Epping+Upland%2C+Fiddlers+Hamlet%2C+Fyefield%2C+Gilston%2C+Harlow%2C+Harlow+New+Town%2C+Hastingwood%2C+High+Beech%2C+High+Laver%2C+High+Ongar%2C+High+Wych%2C+Hoddesdon%2C+Ingatestone%2C+Ivy+Chimneys%2C+Leyton%2C+Leytonstone%2C+Loughton%2C+Lower+Nazeing%2C+Magdalen+Laver%2C+Manor+Park%2C+Matching%2C+Matching+Green%2C+Matching+Tye%2C+Moreton%2C+Navestock%2C+Newham%2C+North+Weald%2C+North+Weald+Basett%2C+Old+Harlow%2C+Ongar%2C+Roydon%2C+Roydon+Mill%2C+Sawbridgeworth%2C+South+Woodford%2C+Stanford+Rivers%2C+Stanstead+Abotts%2C+Tawney+Common%2C+Theydon+Bois%2C+Theydon+Garnon%2C+Theydon+Mount%2C+Thornwood%2C+Turnford%2C+Tylers+Green%2C+Upshire%2C+Waltham+Abbey%2C+Waltham+Cross%2C+Waltham+Forest%2C+Walthamstow%2C+Wanstead%2C+Wanstead+Flats%2C+Woodford%2C+Woodford+Green%2C+Wormley%2C+Covering+postcodes+CM15%2C+CM16%2C+CM17%2C+CM18%2C+CM19%2C+CM20%2C+CM21%2C+CM4%2C+CM5%2C+E10%2C+E11%2C+E12%2C+E17%2C+E4%2C+E7%2C+EN1%2C+EN10%2C+EN11%2C+EN2%2C+EN3%2C+EN7%2C+EN8%2C+EN9%2C+IG10%2C+IG7%2C+IG8%2C+IG9%2C+N13%2C+N14%2C+N18%2C+N21%2C+N9%2C+RM4%2C%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();
};

