/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F552.html'), 'true',[],'',''],
	['PAGE','573',jdecode('Aktuelles'),jdecode(''), jdecode('%2F573.html'), 'true',[],'',''],
	['PAGE','594',jdecode('Produkte%2C+Leistungen'),jdecode(''), jdecode('%2F594%2Findex.html'), 'true',[ 
		['PAGE','615',jdecode('Fahrplan'),jdecode(''), jdecode('%2F594%2F615.html'), 'true',[],'',''],
		['PAGE','636',jdecode('Tarife'),jdecode(''), jdecode('%2F594%2F636.html'), 'true',[],'','']
	],'',''],
	['PAGE','32301',jdecode('Restaurants'),jdecode(''), jdecode('%2F32301.html'), 'true',[],'',''],
	['PAGE','72601',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F72601%2Findex.html'), 'true',[ 
		['PAGE','6401',jdecode('Neubau+Talstation'),jdecode(''), jdecode('%2F72601%2F6401.html'), 'true',[],'',''],
		['PAGE','27001',jdecode('Einweihung+Talstation+'),jdecode(''), jdecode('%2F72601%2F27001.html'), 'true',[],'',''],
		['PAGE','19201',jdecode('Lawinen+2009'),jdecode(''), jdecode('%2F72601%2F19201.html'), 'true',[],'',''],
		['PAGE','44301',jdecode('Bahn+1944+-+1945'),jdecode(''), jdecode('%2F72601%2F44301.html'), 'true',[],'',''],
		['PAGE','54601',jdecode('Badefloss+2010'),jdecode(''), jdecode('%2F72601%2F54601.html'), 'true',[],'',''],
		['PAGE','76301',jdecode('Neue+Seite'),jdecode(''), jdecode('%2F72601%2F76301.html'), 'true',[],'','']
	],'',''],
	['PAGE','77201',jdecode('Lageplan'),jdecode(''), jdecode('%2F77201.html'), 'true',[],'',''],
	['PAGE','657',jdecode('+Links'),jdecode(''), jdecode('%2F657.html'), 'true',[],'',''],
	['PAGE','678',jdecode('Kontakt'),jdecode(''), jdecode('%2F678.html'), 'true',[],'',''],
	['PAGE','20601',jdecode('Impressum'),jdecode(''), jdecode('%2F20601.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='9242';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12764';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'9242',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12764',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-16331889']={
webappId:    '1501',
documentId:  '501',
internalId:  '16331889',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '77201',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['7060']=webappMappings['7060-fd4241403a5c702d6d7a639347086c48']={
webappId:    '7060',
documentId:  '6401',
internalId:  'fd4241403a5c702d6d7a639347086c48',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-d022da5c5782cc2b1e6a2ef6f658d361']={
webappId:    '7060',
documentId:  '54601',
internalId:  'd022da5c5782cc2b1e6a2ef6f658d361',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-78d26168e718f1c55b82f58025f12cac']={
webappId:    '7060',
documentId:  '19201',
internalId:  '78d26168e718f1c55b82f58025f12cac',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-01d56aa4bab8ae3872f7b9e1fc09b152']={
webappId:    '7060',
documentId:  '27001',
internalId:  '01d56aa4bab8ae3872f7b9e1fc09b152',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120106-133410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20111113-122544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20120108-164323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100717-115223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20080520-010350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20110202-105047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20090524-095030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20080520-203238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20090524-185950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20090226-195642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77201',
internalId:  '',
customField: '20120108-165937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090524-191314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20080520-010156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54601',
internalId:  '',
customField: '20100816-111043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20120108-123602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20100118-113728'
};
webappMappings['7060']=webappMappings['7060-cd098ddcc4f71d871bd0cbfd8d11de2b']={
webappId:    '7060',
documentId:  '44301',
internalId:  'cd098ddcc4f71d871bd0cbfd8d11de2b',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72601',
internalId:  '',
customField: '20120108-130522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76301',
internalId:  '',
customField: '20120108-130537'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010INE7EU';
var companyName   = 'Seilbahngenossenschaft+Golzern';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = 'golzern%2C+fahrplan+seilbahn+golzern';
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();
};

