/* [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','601',jdecode('Home'),jdecode(''),'/601/index.html','true',[ 
		['PAGE','6001',jdecode('Adresse%2C+Telefon+%28Folgeseite%29'),jdecode(''),'/601/6001.html','false',[],'','']
	],'',''],
	['PAGE','8301',jdecode('Sonnenschutz+Folien'),jdecode(''),'/8301/index.html','true',[ 
		['PAGE','8322',jdecode('Folien+Fix'),jdecode(''),'/8301/8322.html','true',[],'',''],
		['PAGE','13101',jdecode('Folien+Lamellen'),jdecode(''),'/8301/13101.html','true',[],'',''],
		['PAGE','10601',jdecode('Folien+Rollo'),jdecode(''),'/8301/10601.html','true',[],'','']
	],'',''],
	['PAGE','14301',jdecode('Blendschutz+-+Folien'),jdecode(''),'/14301/index.html','true',[ 
		['PAGE','14322',jdecode('Folien+Fix'),jdecode(''),'/14301/14322.html','true',[],'',''],
		['PAGE','14364',jdecode('Folien+Lamellen'),jdecode(''),'/14301/14364.html','true',[],'',''],
		['PAGE','14343',jdecode('Folien+Rollo'),jdecode(''),'/14301/14343.html','true',[],'','']
	],'',''],
	['PAGE','20901',jdecode('Privatsp%C3%A4hre'),jdecode(''),'/20901/index.html','true',[ 
		['PAGE','20922',jdecode('Transparenter+Sichtschutz'),jdecode(''),'/20901/20922.html','true',[],'',''],
		['PAGE','66801',jdecode('Dekor+Sichtschutz'),jdecode(''),'/20901/66801.html','true',[],'',''],
		['PAGE','20943',jdecode('Totaler+Sichtschutz'),jdecode(''),'/20901/20943.html','true',[],'','']
	],'',''],
	['PAGE','17001',jdecode('UV-Schutz'),jdecode(''),'/17001.html','true',[],'',''],
	['PAGE','17601',jdecode('Sicherheit'),jdecode(''),'/17601/index.html','true',[ 
		['PAGE','18222',jdecode('Splitterschutz'),jdecode(''),'/17601/18222.html','true',[],'',''],
		['PAGE','18201',jdecode('Einbruchschutz'),jdecode(''),'/17601/18201.html','true',[],'',''],
		['PAGE','18243',jdecode('Vandalismus'),jdecode(''),'/17601/18243.html','true',[],'','']
	],'',''],
	['PAGE','22701',jdecode('Schutzfolien'),jdecode(''),'/22701/index.html','true',[ 
		['PAGE','23201',jdecode('Vandalismus'),jdecode(''),'/22701/23201.html','true',[],'','']
	],'',''],
	['PAGE','23801',jdecode('Optik'),jdecode(''),'/23801/index.html','true',[ 
		['PAGE','25301',jdecode('Dekor+Folien'),jdecode(''),'/23801/25301.html','true',[],'',''],
		['PAGE','25801',jdecode('Dekor+als+Designe'),jdecode(''),'/23801/25801.html','true',[],'',''],
		['PAGE','26701',jdecode('Art+Decor'),jdecode(''),'/23801/26701.html','true',[],'','']
	],'',''],
	['PAGE','86801',jdecode('Produkte+'),jdecode(''),'/86801/index.html','true',[ 
		['PAGE','86822',jdecode('Datenbl%C3%A4tter'),jdecode(''),'/86801/86822.html','true',[],'','']
	],'',''],
	['PAGE','27201',jdecode('Autoglas'),jdecode(''),'/27201.html','true',[],'',''],
	['PAGE','6901',jdecode('Kontakt'),jdecode(''),'/6901/index.html','true',[ 
		['PAGE','4822',jdecode('Kontakt-Formular'),jdecode(''),'/6901/4822.html','true',[],'',''],
		['PAGE','5201',jdecode('So+finden+Sie+uns'),jdecode(''),'/6901/5201.html','true',[],'','']
	],'',''],
	['PAGE','65901',jdecode('Folien+Factory+Fotoalbum'),jdecode(''),'/65901.html','true',[],'','']];
var siteelementCount=32;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2492';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='418';
theSitetree.graphicsetId='463';
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: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2492',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'418',
				graphicsetId: 	'463',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5201',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['7008']=webappMappings['7008-2018']={
webappId:    '7008',
documentId:  '6901',
internalId:  '2018',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86822',
internalId:  '',
customField: '20100222-151134'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-889934']={
webappId:    '1501',
documentId:  '601',
internalId:  '889934',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20110412-174337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20100312-161424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20100308-135715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20100308-133454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20100308-135438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20100308-135939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20100204-202501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20070423-214002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20070424-113650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18243',
internalId:  '',
customField: '20100312-161341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20943',
internalId:  '',
customField: '20100308-135917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20100308-135325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8322',
internalId:  '',
customField: '20100308-135140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14322',
internalId:  '',
customField: '20100308-135553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14343',
internalId:  '',
customField: '20070423-205555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14364',
internalId:  '',
customField: '20100308-135620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18222',
internalId:  '',
customField: '20100206-115121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20100312-161521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20070424-124938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86801',
internalId:  '',
customField: '20100208-161344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20070423-170952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20100308-135754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100312-161121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100206-114730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20100312-161549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20100312-161635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20070709-105856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20070423-172855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20070423-172438'
};
webappMappings['7060']=webappMappings['7060-88a17527d9a55918ff6ab2741b168b98']={
webappId:    '7060',
documentId:  '65901',
internalId:  '88a17527d9a55918ff6ab2741b168b98',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65901',
internalId:  '',
customField: '20090220-190456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66801',
internalId:  '',
customField: '20100308-135822'
};
webappMappings['7008']=webappMappings['7008-1328']={
webappId:    '7008',
documentId:  '4822',
internalId:  '1328',
customField: 'language:de;country:CH;'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2CYH';
var companyName   = 'F+O+L+I+E+N++++F+A+C+T+O+R+Y+';
var htmlTitle	  = 'Alles+rund+um+Folien+++FolienFactory';
var metaKeywords  = 'Folien%2C+Klirr.ch%2C+Rollo%2C+Sonnenschutz%2C+Hitzeschutz';
var metaContents  = 'Folien+gegen+Einbruch%2C+Vandalismus+und+als+Sonnenschutz.+';
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();
};

