/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','12401',jdecode('What+we+do'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','37601',jdecode('Where+we+cover'),jdecode(''),'/37601.html','true',[],'',''],
	['PAGE','25601',jdecode('Who+we+are'),jdecode(''),'/25601.html','true',[],'',''],
	['PAGE','56101',jdecode('Commercial+portfolio'),jdecode(''),'/56101.html','true',[],'',''],
	['PAGE','11801',jdecode('Prices'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','11201',jdecode('Booking+request'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','13801',jdecode('Contact+us'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','6006',jdecode('Comments'),jdecode(''),'/6006.html','true',[],'',''],
	['PAGE','70501',jdecode('Customer+discounts'),jdecode(''),'/70501.html','true',[],'',''],
	['PAGE','14101',jdecode('Other+jobs+we+do'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','93723',jdecode('LCD%2FPlasma+Brackets'),jdecode(''),'/93723.html','true',[],'',''],
	['PAGE','53101',jdecode('Line+marking+service'),jdecode(''),'/53101.html','true',[],'',''],
	['PAGE','27501',jdecode('Why+choose+us%3F'),jdecode(''),'/27501.html','true',[],'',''],
	['PAGE','5901',jdecode('Director%26%23x27%3Bs+journal'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','38301',jdecode('Join+Us'),jdecode(''),'/38301.html','true',[],'',''],
	['PAGE','52701',jdecode('How+to+find+us'),jdecode(''),'/52701.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Sportsplace';
theSitetree.paletteFamily='1D2D7E';
theSitetree.keyvisualId='2628';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='343';
theSitetree.graphicsetId='402';
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: 			'Sportsplace',
				paletteFamily: 	'1D2D7E',
				keyvisualId: 	'2628',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'343',
				graphicsetId: 	'402',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'1D2D7E',
				b_color: 		'788EC9',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100603-091944'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-3912963']={
webappId:    '1501',
documentId:  '301',
internalId:  '3912963',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-203']={
webappId:    '7050',
documentId:  '5901',
internalId:  '203',
customField: 'language:en;country:GB;'
};
webappMappings['1002']=webappMappings['1002-6006anbt10in2q8l']={
webappId:    '1002',
documentId:  '6006',
internalId:  '6006anbt10in2q8l',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090709-223628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6006',
internalId:  '',
customField: '20090721-165325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52701',
internalId:  '',
customField: '20090709-223705'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '52701',
internalId:  'routing',
customField: 'en_GB'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20090725-011257'
};
webappMappings['7008']=webappMappings['7008-286']={
webappId:    '7008',
documentId:  '11201',
internalId:  '286',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100602-190125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100603-092643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20091220-152802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20090718-161331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20090709-223525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93723',
internalId:  '',
customField: '20091203-215317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20091203-215425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20090902-154903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20090709-223647'
};
webappMappings['7008']=webappMappings['7008-287']={
webappId:    '7008',
documentId:  '38301',
internalId:  '287',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53101',
internalId:  '',
customField: '20090709-223342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20090709-223604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70501',
internalId:  '',
customField: '20100603-092511'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2Q8L';
var companyName   = 'House+Jobs++-+Professional+Handyman+Service';
var htmlTitle	  = 'HouseJobs+-+The+Property+Caretakers';
var metaKeywords  = 'Handyman%2C+handyman%2C+Watford+Handyman%2C+Handyman+Watford%2C+handy+person%2C+handyperson%2C+odd+job%2C+odd+jobs%2C+oddjobs%2C+plumber%2C+plumbing%2C+electrical%2C+electrition%2C+gardening%2C+gardener%2C+roofer%2C+roofing%2C+tiler%2C+tiling%2C+plasterer%2C+plastering%2C+painting%2C+painter%2C+decorator%2C+repairs.';
var metaContents  = 'handyman%2C+fixing%2C+electrical%2C+plumbing%2C+gardening%2C+roofing%2C+tiling%2C+decorating%2C+plastering%2C+Watford+Handyman%2C+No+job+too+small%2C+we+can+do+it+all%2C+up+to+25%25+discount+on+our+labour+rates.';
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();
};
