/* [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','1679',jdecode('Home'),jdecode(''),'/1679.html','true',[],'',''],
	['PAGE','1700',jdecode('Czech+Heritage'),jdecode(''),'/1700.html','true',[],'',''],
	['PAGE','130534',jdecode('Our+Work'),jdecode(''),'/130534.html','true',[],'',''],
	['PAGE','49001',jdecode('Giving+Support+-+About+Us'),jdecode(''),'/49001.html','true',[],'',''],
	['PAGE','1774',jdecode('Contact+Request'),jdecode(''),'/1774.html','false',[],'',''],
	['PAGE','49601',jdecode('E-mail+contact'),jdecode(''),'/49601.html','false',[],'',''],
	['PAGE','6601',jdecode('Events+and+Fundraising'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','9201',jdecode('Appeal'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','55101',jdecode('Donation'),jdecode(''),'/55101.html','true',[],'',''],
	['PAGE','1721',jdecode('Photos'),jdecode(''),'/1721.html','false',[],'',''],
	['PAGE','1753',jdecode('Guestbook'),jdecode(''),'/1753.html','false',[],'',''],
	['PAGE','49027',jdecode('From+the+latest+Newsletter'),jdecode(''),'/49027.html','true',[],'',''],
	['PAGE','7301',jdecode('Subscribe%2C+Contact+Us'),jdecode(''),'/7301.html','true',[],'',''],
	['PAGE','60801',jdecode('Culture'),jdecode(''),'/60801.html','true',[],'',''],
	['PAGE','64001',jdecode('Czech+Music+News'),jdecode(''),'/64001.html','true',[],'',''],
	['PAGE','115934',jdecode('Gothic'),jdecode(''),'/115934.html','false',[],'',''],
	['PAGE','63601',jdecode('Baroque'),jdecode(''),'/63601.html','true',[],'',''],
	['PAGE','116434',jdecode('%C4%8Cesky'),jdecode(''),'/116434.html','true',[],'',''],
	['PAGE','115960',jdecode('Renaissance'),jdecode(''),'/115960.html','false',[],'',''],
	['PAGE','115986',jdecode('Neoclassical'),jdecode(''),'/115986.html','false',[],'',''],
	['PAGE','116012',jdecode('Nineteenth+Century'),jdecode(''),'/116012.html','false',[],'',''],
	['PAGE','116038',jdecode('Twentieth+Century'),jdecode(''),'/116038.html','false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='5351C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10894';
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: 			'Alpha',
				paletteFamily: 	'5351C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10894',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5351C2',
				e_color: 		'5351C2',
				f_color: 		'5351C2',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-6b5484876c7b40e4b00f156d8b000906']={
webappId:    '7060',
documentId:  '1721',
internalId:  '6b5484876c7b40e4b00f156d8b000906',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100306-141233'
};
webappMappings['7002']=webappMappings['7002-811']={
webappId:    '7002',
documentId:  '1753',
internalId:  '811',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-2155']={
webappId:    '7008',
documentId:  '1774',
internalId:  '2155',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1679',
internalId:  '',
customField: '20100306-143034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1700',
internalId:  '',
customField: '20100306-140856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1721',
internalId:  '',
customField: '20080813-220220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100306-142144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1753',
internalId:  '',
customField: '20080811-134512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1774',
internalId:  '',
customField: '20080811-180720'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1679',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20100306-141134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20100306-143104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49027',
internalId:  '',
customField: '20100302-111455'
};
webappMappings['7008']=webappMappings['7008-4184']={
webappId:    '7008',
documentId:  '49601',
internalId:  '4184',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20090313-123924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55101',
internalId:  '',
customField: '20100303-164738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60801',
internalId:  '',
customField: '20100219-163354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63601',
internalId:  '',
customField: '20100122-010338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64001',
internalId:  '',
customField: '20100306-141319'
};
webappMappings['1501']=webappMappings['1501-9803314']={
webappId:    '1501',
documentId:  '1679',
internalId:  '9803314',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115934',
internalId:  '',
customField: '20100122-005032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115960',
internalId:  '',
customField: '20100122-005032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115986',
internalId:  '',
customField: '20100122-005032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116012',
internalId:  '',
customField: '20100122-005032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116038',
internalId:  '',
customField: '20100122-005032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116434',
internalId:  '',
customField: '20100306-141536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130534',
internalId:  '',
customField: '20100306-142733'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEW1K';
var companyName   = '';
var htmlTitle	  = 'UK+Friends';
var metaKeywords  = 'UK+Czech+Friends+Historic+Buildings+Gardens+Parks+Architecture+House+Castle+Palace+City+Town+Culture+Music+Prague+Bohemia+Moravia';
var metaContents  = 'Czech+Historic+Buildings+Gardens+Parks+Prague+Bohemia+Moravia';
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();
};
