/* [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','801',jdecode('home'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','852',jdecode('Berlin'),jdecode(''),'/852/index.html','true',[ 
		['PAGE','873',jdecode('the+apartment'),jdecode(''),'/852/873.html','true',[],'',''],
		['PAGE','894',jdecode('prices+%26+availability'),jdecode(''),'/852/894.html','true',[],'',''],
		['PAGE','915',jdecode('local+info+%26+links'),jdecode(''),'/852/915.html','true',[],'',''],
		['PAGE','16001',jdecode('10+things+not+to+miss'),jdecode(''),'/852/16001.html','true',[],'','']
	],'',''],
	['PAGE','1062',jdecode('Southern+Spain'),jdecode(''),'/1062/index.html','true',[ 
		['PAGE','1083',jdecode('the+house'),jdecode(''),'/1062/1083.html','true',[],'',''],
		['PAGE','1104',jdecode('prices+%26+availability'),jdecode(''),'/1062/1104.html','true',[],'',''],
		['PAGE','1125',jdecode('local+info+%26+links'),jdecode(''),'/1062/1125.html','true',[],'',''],
		['PAGE','16043',jdecode('10+things+not+to+miss'),jdecode(''),'/1062/16043.html','true',[],'','']
	],'',''],
	['PAGE','957',jdecode('Jonsdorf'),jdecode(''),'/957/index.html','true',[ 
		['PAGE','978',jdecode('the+apartment'),jdecode(''),'/957/978.html','true',[],'',''],
		['PAGE','999',jdecode('prices+%26+availability'),jdecode(''),'/957/999.html','true',[],'',''],
		['PAGE','1020',jdecode('local+info+%26+links'),jdecode(''),'/957/1020.html','true',[],'',''],
		['PAGE','16022',jdecode('10+things+not+to+miss'),jdecode(''),'/957/16022.html','true',[],'','']
	],'',''],
	['PAGE','19801',jdecode('more+photos'),jdecode(''),'/19801.html','true',[],'',''],
	['PAGE','8806',jdecode('guestbook'),jdecode(''),'/8806/index.html','true',[ 
		['PAGE','8801',jdecode('read+our+guestbook'),jdecode(''),'/8806/8801.html','false',[],'','']
	],'',''],
	['PAGE','1167',jdecode('contact'),jdecode(''),'/1167.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='497';
theSitetree.contentColor='4D4D4D';
theSitetree.contentBGColor='a1c6c6';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'497',
				contentColor: 	'4D4D4D',
				contentBGColor: 'a1c6c6',
				a_color: 		'a1c6c6',
				b_color: 		'669999',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-8806anbt10in2c8r']={
webappId:    '1002',
documentId:  '8806',
internalId:  '8806anbt10in2c8r',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20070526-113549'
};
webappMappings['7008']=webappMappings['7008-264']={
webappId:    '7008',
documentId:  '1167',
internalId:  '264',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-9909aae96852cd2134e6d1fd43ce8a4b']={
webappId:    '7060',
documentId:  '19801',
internalId:  '9909aae96852cd2134e6d1fd43ce8a4b',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100110-195022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20100817-185445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20100817-185106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20081126-204045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20070713-142914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20070601-150823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20100817-185312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20100110-201415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20100110-184505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1020',
internalId:  '',
customField: '20100110-184625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16022',
internalId:  '',
customField: '20100110-184722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1062',
internalId:  '',
customField: '20081226-152345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1083',
internalId:  '',
customField: '20090502-153301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1104',
internalId:  '',
customField: '20100531-131427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1125',
internalId:  '',
customField: '20090809-172432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16043',
internalId:  '',
customField: '20070604-145615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20100110-185116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8806',
internalId:  '',
customField: '20100110-185248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1167',
internalId:  '',
customField: '20090713-102324'
};
webappMappings['1501']=webappMappings['1501-1974662']={
webappId:    '1501',
documentId:  '801',
internalId:  '1974662',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2C8R';
var companyName   = 'stay+at+ours...';
var htmlTitle	  = '';
var metaKeywords  = 'villa+with+pool%2C+Huercal-Overa%2C+rural+holiday%2C+city+break%2C+Ferienwohnung%2C+CSD%2C+Berlin+Pride%2C+Almeria%2C+Berlin%2C+Schoeneberg%2C+holiday+rental%2C+apartment%2C+cortijo%2C+let%2C+villa%2C+FeWo';
var metaContents  = 'Private+holiday+accommodation+in+Berlin+and+Almeria%2C+Spain';
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();
};
