/* [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 theSitetree=[ 
	['PAGE','10301',jdecode('Home'),jdecode(''),'/10301.html','true',[],''],
	['PAGE','31501',jdecode('Office+Cleaning+Service'),jdecode(''),'/31501.html','true',[],''],
	['PAGE','31527',jdecode('Retail+Cleaning+Service'),jdecode(''),'/31527.html','true',[],''],
	['PAGE','31553',jdecode('End+of+tenancy+clean'),jdecode(''),'/31553.html','true',[],''],
	['PAGE','31579',jdecode('IT+Cleaning+Service'),jdecode(''),'/31579.html','true',[],''],
	['PAGE','31605',jdecode('Public+Sector+Cleans'),jdecode(''),'/31605.html','true',[],''],
	['PAGE','31631',jdecode('Transport+Cleans'),jdecode(''),'/31631.html','true',[],''],
	['PAGE','31657',jdecode('After+build+clean'),jdecode(''),'/31657.html','true',[],''],
	['PAGE','10404',jdecode('One-off+Cleans'),jdecode(''),'/10404.html','true',[],''],
	['PAGE','10352',jdecode('Domestic+Cleans%2FIroning'),jdecode(''),'/10352.html','true',[],''],
	['PAGE','10430',jdecode('Oven+Cleaning'),jdecode(''),'/10430.html','true',[],''],
	['PAGE','31683',jdecode('Holiday+Lets%2FCaravans'),jdecode(''),'/31683.html','true',[],''],
	['PAGE','31709',jdecode('After+Party+Clean'),jdecode(''),'/31709.html','true',[],''],
	['PAGE','10456',jdecode('Carpet+%26+Upholstery+'),jdecode(''),'/10456.html','true',[],''],
	['PAGE','36801',jdecode('Health+and+Safety+'),jdecode(''),'/36801.html','true',[],''],
	['PAGE','10508',jdecode('Customer+Comments'),jdecode(''),'/10508.html','true',[],''],
	['PAGE','10534',jdecode('Contact+Us'),jdecode(''),'/10534.html','true',[],''],
	['PAGE','10560',jdecode('Enquiry+Form'),jdecode(''),'/10560.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='AAA0CD';
theSitetree.keyvisualId='1712';
theSitetree.keyvisualName='museum.jpg';
theSitetree.fontsetId='306';
theSitetree.graphicsetId='346';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='AAA0CD';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Architekt',
				paletteFamily: 	'AAA0CD',
				keyvisualId: 	'1712',
				keyvisualName: 	'museum.jpg',
				fontsetId: 		'306',
				graphicsetId: 	'346',
				contentColor: 	'000000',
				contentBGColor: 'AAA0CD',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'AAA0CD',
				b_color: 		'3E3361',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1091']={
webappId:    '7008',
documentId:  '10560',
internalId:  '1091',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20080603-220750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10352',
internalId:  '',
customField: '20080501-220709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10560',
internalId:  '',
customField: '20080501-234058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10534',
internalId:  '',
customField: '20080501-232640'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-5693454']={
webappId:    '1501',
documentId:  '10301',
internalId:  '5693454',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20080501-224741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10404',
internalId:  '',
customField: '20080603-204442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10430',
internalId:  '',
customField: '20080501-230809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10456',
internalId:  '',
customField: '20080603-211504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31527',
internalId:  '',
customField: '20080603-201059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10508',
internalId:  '',
customField: '20080603-214551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31553',
internalId:  '',
customField: '20080501-235324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31579',
internalId:  '',
customField: '20080501-231604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31605',
internalId:  '',
customField: '20080501-224829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31631',
internalId:  '',
customField: '20080430-222012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31657',
internalId:  '',
customField: '20080603-203626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31683',
internalId:  '',
customField: '20080603-205617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31709',
internalId:  '',
customField: '20080603-210210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36801',
internalId:  '',
customField: '20080603-212519'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2UKM';
var companyName   = 'Astonish+Cleaning+Services';
var htmlTitle	  = 'Astonish+Cleaning+Services';
var metaKeywords  = 'META+name%3Dkeywords+content%3Doffice+cleaning+uk+%2Coffice+cleaning+services+uk+%2Cuk+office+cleaning+contractors+%2Coffice+cleaning+essex+%2Coffice+cleaning+service+essex+%2Ccontract+cleaning+office+uk+%2Ccommercial+retail+cleaning+%2Cit+equipment+cleaning+%2Cretail+contract+cleaning+uk+%2Cretail+cleaning+company+%2Cdomestic+cleaning+agency+%2Cdomestic+cleaning+uk+%2Cdomestic+cleaning+services+essex+%2Cdomestic+cleaning+in+essex+%2Cdomestic+cleaning+essex+%2Cdomestic+oven+cleaning+%2Coven+cleaning+service+%2Coven+cleaning+specialists+%2Coven+cleaning+uk+%2Ccarpet+steam+cleaning+%2Ccarpet+cleaning+business+%2Ccarpet+cleaning+essex+%2Cupholstery+cleaning+uk+%2Ccarpet+cleaning+uk+%2C+www.astonishcleaning.co.uk';
var metaContents  = 'Domestic+cleaning+colchester%2C+ipswich%2C+office+cleaning+uk+%2Coffice+cleaning+colchester+ipswich+uk+%2Cuk+office+cleaning+contractors+%2Coffice+cleaning+essex+%2Coffice+cleaning+service+essex+%2Ccontract+cleaning+office+uk+%2Ccommercial+retail+cleaning+%2Cit+equipment+cleaning+%2Cretail+contract+cleaning+uk+%2Cretail+cleaning+company+%2Cdomestic+cleaning+agency+%2Cdomestic+cleaning+uk+%2Cdomestic+cleaning+services+essex+%2Cdomestic+cleaning+in+essex+%2Cdomestic+cleaning+essex+%2Cdomestic+oven+cleaning+%2Coven+cleaning+service+%2Coven+cleaning+specialists+%2Coven+cleaning+uk+%2Ccarpet+steam+cleaning+%2Ccarpet+cleaning+business+%2Ccarpet+cleaning+colchester+essex+%2Cupholstery+cleaning+uk+%2Ccarpet+cleaning+uk+%2C+www.astonishcleaning.co.uk';
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();
};
