/* [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(''), jdecode('%2F301.html'), 'true',[],'',''],
	['PAGE','37701',jdecode('Local+Helplines'),jdecode(''), jdecode('%2F37701.html'), 'true',[],'',''],
	['PAGE','36901',jdecode('National+Helplines'),jdecode(''), jdecode('%2F36901.html'), 'true',[],'',''],
	['PAGE','38401',jdecode('Support+Organisations'),jdecode(''), jdecode('%2F38401.html'), 'true',[],'',''],
	['PAGE','28701',jdecode('Support+Local'),jdecode(''), jdecode('%2F28701%2Findex.html'), 'true',[ 
		['PAGE','18922',jdecode('Involvement+Contacts'),jdecode(''), jdecode('%2F28701%2F18922.html'), 'true',[],'',''],
		['PAGE','99801',jdecode('Funders'),jdecode(''), jdecode('%2F28701%2F99801.html'), 'true',[],'',''],
		['PAGE','40005',jdecode('Birmingham'),jdecode(''), jdecode('%2F28701%2F40005.html'), 'true',[],'',''],
		['PAGE','39901',jdecode('Coventy'),jdecode(''), jdecode('%2F28701%2F39901.html'), 'true',[],'',''],
		['PAGE','39927',jdecode('Dudley'),jdecode(''), jdecode('%2F28701%2F39927.html'), 'true',[],'',''],
		['PAGE','39953',jdecode('Herefordshire'),jdecode(''), jdecode('%2F28701%2F39953.html'), 'true',[],'',''],
		['PAGE','40031',jdecode('North+Staffs'),jdecode(''), jdecode('%2F28701%2F40031.html'), 'true',[],'',''],
		['PAGE','40083',jdecode('Sandwell'),jdecode(''), jdecode('%2F28701%2F40083.html'), 'true',[],'',''],
		['PAGE','40401',jdecode('Shropshire'),jdecode(''), jdecode('%2F28701%2F40401.html'), 'true',[],'',''],
		['PAGE','40109',jdecode('Solihull'),jdecode(''), jdecode('%2F28701%2F40109.html'), 'true',[],'',''],
		['PAGE','40057',jdecode('South+Staffs'),jdecode(''), jdecode('%2F28701%2F40057.html'), 'true',[],'',''],
		['PAGE','40135',jdecode('Walsall'),jdecode(''), jdecode('%2F28701%2F40135.html'), 'true',[],'',''],
		['PAGE','40161',jdecode('Warwickshire'),jdecode(''), jdecode('%2F28701%2F40161.html'), 'true',[],'',''],
		['PAGE','39979',jdecode('Wolverhampton'),jdecode(''), jdecode('%2F28701%2F39979.html'), 'true',[],'',''],
		['PAGE','40187',jdecode('Worcestershire'),jdecode(''), jdecode('%2F28701%2F40187.html'), 'true',[],'','']
	],'',''],
	['PAGE','96501',jdecode('About+us'),jdecode(''), jdecode('%2F96501%2Findex.html'), 'true',[ 
		['PAGE','18001',jdecode('Contact+Us'),jdecode(''), jdecode('%2F96501%2F18001.html'), 'true',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Education';
theSitetree.paletteFamily='004D3D';
theSitetree.keyvisualId='7298';
theSitetree.keyvisualName='kv_7298.jpg';
theSitetree.fontsetId='16462';
theSitetree.graphicsetId='12156';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='60786B';
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: 			'Education',
				paletteFamily: 	'004D3D',
				keyvisualId: 	'7298',
				keyvisualName: 	'kv_7298.jpg',
				fontsetId: 		'16462',
				graphicsetId: 	'12156',
				contentColor: 	'FFFFFF',
				contentBGColor: '60786B',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20111114-175522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39927',
internalId:  '',
customField: '20100810-220226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40005',
internalId:  '',
customField: '20111102-121508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39901',
internalId:  '',
customField: '20110313-144313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40031',
internalId:  '',
customField: '20120127-124702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40057',
internalId:  '',
customField: '20110530-152439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20120127-115322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99801',
internalId:  '',
customField: '20101102-210423'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18922',
internalId:  '',
customField: '20101205-154446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20110306-134655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20111212-141726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96501',
internalId:  '',
customField: '20100806-124648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20110921-142702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20110530-150839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40083',
internalId:  '',
customField: '20101205-144102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40135',
internalId:  '',
customField: '20120127-121146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39979',
internalId:  '',
customField: '20110313-150131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40401',
internalId:  '',
customField: '20111102-115501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40187',
internalId:  '',
customField: '20110313-144431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39953',
internalId:  '',
customField: '20100806-152557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40109',
internalId:  '',
customField: '20100806-141828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40161',
internalId:  '',
customField: '20101209-153845'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2QY0';
var companyName   = 'Users+In+Partnership+West+Midlands+%28CIC%29';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

