/* [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(''),'/301.html','true',[],'',''],
	['PAGE','6501',jdecode('office+removal'),jdecode(''),'/6501.html','true',[],'',''],
	['PAGE','5601',jdecode('house+removal'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','5622',jdecode('cleaning+for+move'),jdecode(''),'/5622.html','true',[],'',''],
	['PAGE','5643',jdecode('housekeeping'),jdecode(''),'/5643.html','true',[],'',''],
	['PAGE','6522',jdecode('storage'),jdecode(''),'/6522.html','true',[],'',''],
	['PAGE','5664',jdecode('links%3A+living+in+z%C3%BCrich'),jdecode(''),'/5664/index.html','true',[ 
		['PAGE','11301',jdecode('links%3A+living+in+z%C3%BCrich+%28Folgeseite%29'),jdecode(''),'/5664/11301.html','false',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Letter';
theSitetree.paletteFamily='E3FFE7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10687';
theSitetree.graphicsetId='10749';
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: 			'Letter',
				paletteFamily: 	'E3FFE7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10687',
				graphicsetId: 	'10749',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'706F6F',
				e_color: 		'706F6F',
				f_color: 		'706F6F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100322-015640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100322-014912'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1664']={
webappId:    '7008',
documentId:  '5664',
internalId:  '1664',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100322-015553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20100322-015456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20100322-015407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20100322-015320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20100322-015225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20081124-201533'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3FPE';
var companyName   = 'Welcome+to+switzerland';
var htmlTitle	  = 'Z%C3%BCrich%3A+ATAX+provides+a+complete+house+removal%2C+busines+%2F+office+removal%2C+storage%2C+relocation%2C+house+cleaning+%2F+move+out+cleaning%2C+housekeeping+and+homeservice+to+individuals%2C+families+and+business+in+Z%C3%BCrich+-+Switzerland';
var metaKeywords  = 'ironing+service+zuerich%2C+cleaner+zh%2C+cleaners+zh%2C+domestic+cleaners+zh%2C+tenancy+cleaning+zh%2C+house+cleaning+zh%2C+kitchen+cleaning+zh%2C+bath+cleaning+zh%2C+office+cleaning+zh%2C+residental+cleaning+Zuerich%2C+commercial+cleaning+zh%2C+house+keeping+zh%2C+houes+keeping+ch%2C+house+cleaning+service+zh%2C+spring+cleaning+zh%2C+cleaning+maids+ch%2C+cleaning+maids+zh%2C+home+clean+zh%2C+household+management+zh%2C+household+management+ch%2C+maid+service+zh%2C+carpet+cleaning+zh%2C+window+cleaning+zh%2C+homeclean+zh%2C+housework+zh%2C+cleaning+agency+zh%2C+relocatoin+zh%2C+relocation+company+zh%2C+relocation+company+ch%2C+moving+company+zh%2C+house+move+zh%2C+home+move+zh%2C+house+removal+zh%2C+house+removal+ch%2C+office+removal+ch%2C+office+removal+zh%2C+business+removal+zh+ch%2C+business+move+zh+ch%2C+international+removal+ch+zh%2C+';
var metaContents  = 'Z%C3%BCrich%3A+ATAX+provides+a+complete+house+removal%2C+busines+%2F+office+removal%2C+storage%2C+relocation%2C+house+cleaning+%2F+move+out+cleaning%2C+housekeeping+and+homeservice+to+individuals%2C+families+and+business+in+Z%C3%BCrich+-+Switzerland';
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();
};
