/* [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','201',jdecode('Home'),jdecode(''),'/201/index.html','true',[ 
		['PAGE','40001',jdecode('Home+%28Folgeseite%29'),jdecode(''),'/201/40001.html','false',[],'','']
	],'',''],
	['PAGE','273',jdecode('Seniorenhilfe'),jdecode(''),'/273/index.html','true',[ 
		['PAGE','30401',jdecode('Seniorenhilfe+%28Folgeseite%29'),jdecode(''),'/273/30401.html','false',[],'','']
	],'',''],
	['PAGE','294',jdecode('Seniorenbetreuung'),jdecode(''),'/294.html','true',[],'',''],
	['PAGE','315',jdecode('Seniorenpflege'),jdecode(''),'/315/index.html','true',[ 
		['PAGE','43601',jdecode('Seniorenpflege+%28Folgeseite%29'),jdecode(''),'/315/43601.html','false',[],'','']
	],'',''],
	['PAGE','336',jdecode('Seniorenumzug'),jdecode(''),'/336.html','true',[],'',''],
	['PAGE','252',jdecode('Hausservice'),jdecode(''),'/252.html','true',[],'',''],
	['PAGE','357',jdecode('F%C3%BCr+Seniorenangeh%C3%B6rigen'),jdecode(''),'/357.html','true',[],'',''],
	['PAGE','378',jdecode('Kontakt'),jdecode(''),'/378/index.html','true',[ 
		['PAGE','38801',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/378/38801.html','false',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Reflectance';
theSitetree.paletteFamily='7E8CE4';
theSitetree.keyvisualId='3602';
theSitetree.keyvisualName='kv_3602.jpg';
theSitetree.fontsetId='10739';
theSitetree.graphicsetId='10854';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Reflectance',
				paletteFamily: 	'7E8CE4',
				keyvisualId: 	'3602',
				keyvisualName: 	'kv_3602.jpg',
				fontsetId: 		'10739',
				graphicsetId: 	'10854',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'7E8CE4',
				e_color: 		'424978',
				f_color: 		'A09D9D',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '294',
internalId:  '',
customField: '20100322-005359'
};
webappMappings['7008']=webappMappings['7008-1669']={
webappId:    '7008',
documentId:  '378',
internalId:  '1669',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20081111-000317'
};
webappMappings['7008']=webappMappings['7008-1670']={
webappId:    '7008',
documentId:  '201',
internalId:  '1670',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '273',
internalId:  '',
customField: '20100322-005222'
};
webappMappings['7008']=webappMappings['7008-1671']={
webappId:    '7008',
documentId:  '315',
internalId:  '1671',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40001',
internalId:  '',
customField: '20081111-023951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20100322-005121'
};
webappMappings['7008']=webappMappings['7008-1668']={
webappId:    '7008',
documentId:  '273',
internalId:  '1668',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '315',
internalId:  '',
customField: '20100322-005516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20081111-095917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '336',
internalId:  '',
customField: '20100322-005629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252',
internalId:  '',
customField: '20100322-005751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '357',
internalId:  '',
customField: '20100322-005900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '378',
internalId:  '',
customField: '20100322-010021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20081111-021901'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3P9O';
var companyName   = '+++++++++++++atax.suisse%40gmail.com';
var htmlTitle	  = 'Seniorenhilfe%2C+Seniorenbetreuung%2C+Seniorenbegleitung%2C+Seniorenumzug%2C+Seniorenberatung%2C+Seniorenpflege+und+Spitex+-Dienste+in+Z%C3%BCrich%3A++ATAX+ist+Ihr+verl%C3%A4sslicher%2C+diskreter+und+seri%C3%B6ser+Partner+auf+dem+Gebiet+der+h%C3%A4uslichen+Altenpflege%2C+Senioren-betreuung%2C';
var metaKeywords  = 'Haushaltshilfe+f%C3%BCr+Senioren%2C+Seniorenumzug+ZH%2C+Seniorenbetreuung+ZH%2C+Putzfrau+f%C3%BCr+Senioren+ZH%2C+Hauspersonal+f%C3%BCr+Senioren+ZH%2C++Seniorenpflege+ZH';
var metaContents  = 'ATAX+ist+Ihr+verl%C3%A4sslicher+und+seri%C3%B6ser+Partner+auf+dem+Gebiet+der+h%C3%A4uslichen+Altenpflege%2C+Senioren-betreuung%2C+Alltagshilfen%2C+Haushaltshilfe+f%C3%BCr+Senioren%2C+Seniorenbegleitung+und+Seniorenumzug+im+Grossraum+Z%C3%BCrich.+';
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();
};
