/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','2901',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F2901.html'), 'true',[],'',''],
	['PAGE','2701',jdecode('Aktuelle+Projekte'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','2722',jdecode('Referenzobjekte+Schaffhausen'),jdecode(''), jdecode('%2F2722%2Findex.html'), 'true',[ 
		['PAGE','4322',jdecode('%22Geisshof%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F4322.html'), 'true',[],'',''],
		['PAGE','4343',jdecode('%22Breiteblick%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F4343.html'), 'true',[],'',''],
		['PAGE','4364',jdecode('%22Bellevue%22+Neuhausen+am+Rheinfall'),jdecode(''), jdecode('%2F2722%2F4364.html'), 'true',[],'',''],
		['PAGE','4385',jdecode('%22Ahornstrasse%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F4385.html'), 'true',[],'',''],
		['PAGE','6501',jdecode('%22Sandacker%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F6501.html'), 'true',[],'',''],
		['PAGE','6522',jdecode('%22Alpenblick%22+Neuhausen+am+Rheinfall'),jdecode(''), jdecode('%2F2722%2F6522.html'), 'true',[],'',''],
		['PAGE','7101',jdecode('%22Wissh%C3%BCslipark%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F7101.html'), 'true',[],'',''],
		['PAGE','7122',jdecode('%22Gmeindwis%22+Neuhausen+am+Rheinfall'),jdecode(''), jdecode('%2F2722%2F7122.html'), 'true',[],'',''],
		['PAGE','7143',jdecode('%22Talstrasse+60%2B62%22+Schaffhausen'),jdecode(''), jdecode('%2F2722%2F7143.html'), 'true',[],'',''],
		['PAGE','7501',jdecode('%22H%C3%BClste%22+Beringen'),jdecode(''), jdecode('%2F2722%2F7501.html'), 'true',[],'',''],
		['PAGE','7522',jdecode('%22Liberacker%22+Guntmadingen'),jdecode(''), jdecode('%2F2722%2F7522.html'), 'true',[],'','']
	],'',''],
	['PAGE','6701',jdecode('Referenzobjekte+Z%C3%BCrich'),jdecode(''), jdecode('%2F6701%2Findex.html'), 'true',[ 
		['PAGE','4301',jdecode('%22Furtweg%22+Uhwiesen'),jdecode(''), jdecode('%2F6701%2F4301.html'), 'true',[],'',''],
		['PAGE','6822',jdecode('%22Stammbaum%22+Hegnau-Volketswil'),jdecode(''), jdecode('%2F6701%2F6822.html'), 'true',[],'',''],
		['PAGE','7164',jdecode('%22Eintrachtstrasse%22+W%C3%A4denswil'),jdecode(''), jdecode('%2F6701%2F7164.html'), 'true',[],'',''],
		['PAGE','7206',jdecode('%22Rebhoger%22+Oberohringen-Seuzach'),jdecode(''), jdecode('%2F6701%2F7206.html'), 'true',[],'',''],
		['PAGE','7185',jdecode('%22Innerdorf%22+Volketswil'),jdecode(''), jdecode('%2F6701%2F7185.html'), 'true',[],'',''],
		['PAGE','7227',jdecode('%22Forenacker%22+Feuerthalen-Langwiesen'),jdecode(''), jdecode('%2F6701%2F7227.html'), 'true',[],'',''],
		['PAGE','7248',jdecode('%22Langwis%22+Egg'),jdecode(''), jdecode('%2F6701%2F7248.html'), 'true',[],'',''],
		['PAGE','7269',jdecode('%22Heiligberg%22+Andelfingen'),jdecode(''), jdecode('%2F6701%2F7269.html'), 'true',[],'',''],
		['PAGE','7543',jdecode('%22Hindergartenstrasse+91-101%22+Dachsen'),jdecode(''), jdecode('%2F6701%2F7543.html'), 'true',[],'',''],
		['PAGE','79322',jdecode('%22am+Rhyweg%22+Dachsen'),jdecode(''), jdecode('%2F6701%2F79322.html'), 'true',[],'',''],
		['PAGE','79301',jdecode('%22Hindergarten%22+Dachsen'),jdecode(''), jdecode('%2F6701%2F79301.html'), 'true',[],'',''],
		['PAGE','7585',jdecode('%22Binzhalde%22+Uetikon+am+See'),jdecode(''), jdecode('%2F6701%2F7585.html'), 'true',[],'',''],
		['PAGE','7606',jdecode('%22Gseckstrasse%22+M%C3%A4nnedorf'),jdecode(''), jdecode('%2F6701%2F7606.html'), 'true',[],'',''],
		['PAGE','6801',jdecode('%22am+Rebberg%22+Henggart'),jdecode(''), jdecode('%2F6701%2F6801.html'), 'true',[],'',''],
		['PAGE','72801',jdecode('%22Alte+Bergstrasse%22+Uetikon+am+See'),jdecode(''), jdecode('%2F6701%2F72801.html'), 'true',[],'','']
	],'',''],
	['PAGE','6722',jdecode('Weitere+Referenzobjekte'),jdecode(''), jdecode('%2F6722%2Findex.html'), 'true',[ 
		['PAGE','6843',jdecode('%22Casa+Materdell%22+Maloja%2C+Graub%C3%BCnden'),jdecode(''), jdecode('%2F6722%2F6843.html'), 'true',[],'',''],
		['PAGE','62201',jdecode('%22Schaffhauserstrasse+20%22%2C+B%C3%BCsingen'),jdecode(''), jdecode('%2F6722%2F62201.html'), 'true',[],'','']
	],'',''],
	['PAGE','2943',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F2943.html'), 'true',[],'',''],
	['PAGE','2764',jdecode('Kontaktformular'),jdecode(''), jdecode('%2F2764.html'), 'true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Mote';
theSitetree.paletteFamily='0450C2';
theSitetree.keyvisualId='11397';
theSitetree.keyvisualName='kv_11397.jpg';
theSitetree.fontsetId='32001';
theSitetree.graphicsetId='13828';
theSitetree.contentColor='565656';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'genotec',
  product: 'WSCSYSSSSLYTCP0Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mote',
				paletteFamily: 	'0450C2',
				keyvisualId: 	'11397',
				keyvisualName: 	'kv_11397.jpg',
				fontsetId: 		'32001',
				graphicsetId: 	'13828',
				contentColor: 	'565656',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20120104-211816'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2943',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-2225']={
webappId:    '7008',
documentId:  '2764',
internalId:  '2225',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20111219-161749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20111122-153914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20120104-205813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2764',
internalId:  '',
customField: '20111219-161626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4301',
internalId:  '',
customField: '20111123-161905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20111103-135418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4322',
internalId:  '',
customField: '20111117-143918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4343',
internalId:  '',
customField: '20111117-142606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4364',
internalId:  '',
customField: '20111117-142716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4385',
internalId:  '',
customField: '20111117-145157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20111214-093922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20111122-155144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20111117-144024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20111117-144055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20111123-162649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20111117-144132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20111123-162706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20111123-162725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20111117-144227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20111207-103433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6822',
internalId:  '',
customField: '20111214-094319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7164',
internalId:  '',
customField: '20111206-150825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20111206-163853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20111206-160213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20111122-151357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7248',
internalId:  '',
customField: '20111207-100631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7269',
internalId:  '',
customField: '20111207-100845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7543',
internalId:  '',
customField: '20111206-105925'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '62201',
internalId:  '-',
customField: '20111121-164224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7585',
internalId:  '',
customField: '20111207-102825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7606',
internalId:  '',
customField: '20111207-103505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6843',
internalId:  '',
customField: '20111122-155531'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '72801',
internalId:  '-',
customField: '20111206-093751'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '79301',
internalId:  '-',
customField: '20111123-162218'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '79322',
internalId:  '-',
customField: '20111206-095021'
};
var webAppHostname = 'cgi.wsc.genotec.ch:80';
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT340IN2EQ9';
var companyName   = 'Hirt+Roost+%26+Partner+AG';
var htmlTitle	  = '';
var metaKeywords  = 'Immobilien+verkaufen%0D%0AImmobilien+kaufen%0D%0AEigentumswohnung%0D%0AEinfamilienhaus%0D%0ABauprojekte';
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();
};

