/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('services'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['ITEM','4401',jdecode('Oven+Cleaning'),jdecode(''), jdecode('http%3A%2F%2Fwww.ovensandhobscleaning.co.uk'), 'true',[],'','_blank'],
	['PAGE','1878',jdecode('Current+offers'),jdecode(''), jdecode('%2F1878.html'), 'true',[],'',''],
	['PAGE','1904',jdecode('About+us'),jdecode(''), jdecode('%2F1904.html'), 'true',[],'',''],
	['PAGE','1982',jdecode('Contact+us'),jdecode(''), jdecode('%2F1982.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('Surrey+Contact+Request'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','4701',jdecode('No+Obligation+Visit'),jdecode(''), jdecode('%2F4701.html'), 'true',[],'',''],
	['PAGE','4001',jdecode('jobs'),jdecode(''), jdecode('%2F4001.html'), 'true',[],'',''],
	['PAGE','4201',jdecode('Online+Job+application+form'),jdecode(''), jdecode('%2F4201.html'), 'false',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='59C54E';
theSitetree.keyvisualId='7259';
theSitetree.keyvisualName='kv_7259.jpg';
theSitetree.fontsetId='16437';
theSitetree.graphicsetId='12144';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Concise',
				paletteFamily: 	'59C54E',
				keyvisualId: 	'7259',
				keyvisualName: 	'kv_7259.jpg',
				fontsetId: 		'16437',
				graphicsetId: 	'12144',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20111024-211653'
};
webappMappings['7008']=webappMappings['7008-9379']={
webappId:    '7008',
documentId:  '1982',
internalId:  '9379',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20111023-215231'
};
webappMappings['7008']=webappMappings['7008-9380']={
webappId:    '7008',
documentId:  '4201',
internalId:  '9380',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20111024-211624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1904',
internalId:  '',
customField: '20111024-211916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20111024-211220'
};
webappMappings['7008']=webappMappings['7008-9381']={
webappId:    '7008',
documentId:  '4701',
internalId:  '9381',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1982',
internalId:  '',
customField: '20111023-220246'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-9382']={
webappId:    '7008',
documentId:  '5001',
internalId:  '9382',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20111023-220858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20111023-221042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20111023-185730'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30INV9II';
var companyName   = 'MAD+MOPS+DOMESTIC+CLEANING+SERVICES++Est+2003';
var htmlTitle	  = 'DOMESTIC+CLEANING+SERVICES+IN+KENT+AND+SOUTHEAST+LONDON+ESTABLISHED+2003+MAD+MOPS+DOMESTIC+CLEANING+SERVICES+KENT';
var metaKeywords  = 'domestic+cleaning%2Ccleaning+services%2Ccleaners%2Cvetted+cleaners%2Capproved+cleaners%2Cquality+cleaners%2Ctrained+cleaners%2Chouse+cleaning%2Cflat+cleaning%2Cregular+weekly+cleaning%2Cregular+cleaning%2Cgeneal+cleaning%2Ccleaning+specialists%2Cestablished+cleaning+company%2Cmad+mops+domestic+cleaning+services%2Cmad+mops+domestic+cleaning+services+kent%2C+mad+mops+domestic+cleaning+services+surrey%2C+oven+cleaning%2C+dusting%2C+hoovering%2C+ironing%2Cbespoke+cleaning%2Cmonthly+cleaning%2C+spring+cleaning%2C+end+of+tenancy+cleaning%2C+one-off+cleans%2Ctrained+cleaners%2Cquality+cleaning%2CCLEANING+IN+WOOLWICH%2CCLEANING+IN+SIDCUP%2CCLEANING+IN+ELTHAM%2CCLEANING+IN+KENT%2CCLEANING+IN+SIDCUP%2CCLEANING+IN+BEXLEY%2CCLEANING+IN+BEXLEYHEATH%2CCLEAN+MY+HOUSE%2CRELIABLE+CLEANING+SERVICE%2CLOCAL+CLEANING+SERVICE%2C+INSURED+CLEANERS';
var metaContents  = 'DOMESTIC+CLEANING+SERVICES+IN+KENT+AND+SOUTHEAST+LONDON+PROVIDED+BY+MAD+MOPS+DOMESTIC+CLEANING+SERVICES+KENT+ESTABLISHED+SINCE+2003+';
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();
};

