/* [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','4480',jdecode('Time-out+f%C3%BCr+Jugendliche'),jdecode(''), jdecode('%2F4480.html'), 'true',[],'',''],
	['PAGE','45101',jdecode('Reitlager+2012'),jdecode(''), jdecode('%2F45101.html'), 'true',[],'',''],
	['PAGE','36201',jdecode('Standort'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'',''],
	['PAGE','13223',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F13223%2Findex.html'), 'true',[ 
		['PAGE','13250',jdecode('Das+Team'),jdecode(''), jdecode('%2F13223%2F13250.html'), 'true',[],'',''],
		['PAGE','37001',jdecode('Die+Ranch'),jdecode(''), jdecode('%2F13223%2F37001.html'), 'true',[],'','']
	],'',''],
	['PAGE','37022',jdecode('Kontakt'),jdecode(''), jdecode('%2F37022.html'), 'true',[],'',''],
	['PAGE','37043',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F37043.html'), 'true',[],'',''],
	['PAGE','42401',jdecode('Galerie'),jdecode(''), jdecode('%2F42401.html'), 'true',[],'',''],
	['PAGE','46501',jdecode('Rustico'),jdecode(''), jdecode('%2F46501.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Vignette';
theSitetree.paletteFamily='E79E6E';
theSitetree.keyvisualId='3551';
theSitetree.keyvisualName='kv_3551.jpg';
theSitetree.fontsetId='10783';
theSitetree.graphicsetId='10833';
theSitetree.contentColor='875534';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vignette',
				paletteFamily: 	'E79E6E',
				keyvisualId: 	'3551',
				keyvisualName: 	'kv_3551.jpg',
				fontsetId: 		'10783',
				graphicsetId: 	'10833',
				contentColor: 	'875534',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E79E6E',
				e_color: 		'886146',
				f_color: 		'C97556',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4480',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-37043abw0x0inxxhc']={
webappId:    '1002',
documentId:  '37043',
internalId:  '37043abw0x0inxxhc',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20110812-151154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37022',
internalId:  '',
customField: '20120105-143833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4480',
internalId:  '',
customField: '20110922-111255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37043',
internalId:  '',
customField: '20110802-172513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42401',
internalId:  '',
customField: '20111114-105432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20120105-143401'
};
webappMappings['7008']=webappMappings['7008-12552']={
webappId:    '7008',
documentId:  '37022',
internalId:  '12552',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13223',
internalId:  '',
customField: '20110812-151447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13250',
internalId:  '',
customField: '20110921-215020'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '45101',
internalId:  '-',
customField: '20120105-153021'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '46501',
internalId:  '-',
customField: '20120211-192130'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXHC';
var companyName   = 'PANORAMARANCH+burgund';
var htmlTitle	  = 'Time-out+f%C3%BCr+Jugendliche%2C+Reitlager+und+Abenteuercamps+f%C3%BCr+Kinder';
var metaKeywords  = 'Reitlager+Time-out+Timeout+Time-Out+Jugendliche+Kinder+Abenteuerlager+Tessin+Krisenintervention+%22Vater+%26+Sohn+-+Weekend%22+Cupierre+Burgund+Frankreich+Teamentwicklung+Team-Entwicklung+Trekking+Pferdetrekking+Auszeit+f%C3%BCr+Erwachsene+f%C3%BCr+Jugendliche+TI-trail+Reitferien+Pferdeferien+Ferienlager+Reiterferien+Kinder+Jugendliche++Pers%C3%B6nlichkeitstraining+Kinderferien+Sommerlager+Panoramaranch+Panorama-Ranch+Panorama+Ranch+Pferdeplauschtage+Herbstlager+Ky+Indigo+F%C3%BChrungstraining+Coaching+Supervision+F%C3%BChrungscoaching+Timeout+Beratung+Berufsfragen+Leadership+Horsemanship+Erwachsene+Occhar+Pfunder+Wydler+Andrea+Reitferien+Pferdeferien+Ferienlager+Reiterferien+Kinder+Jugendliche++Pers%C3%B6nlichkeitstraining+Kinderferien+Sommerlager+Panoramaranch+Panorama-Ranch+Panorama+Ranch+Pferdeplauschtage+Herbstlager+Ky+Indigo+F%C3%BChrungstraining+Coaching+Supervision+F%C3%BChrungscoaching+Timeout+Beratung+Berufsfragen+Leadership+Horsemanship+Erwachsene';
var metaContents  = 'Wir+bieten+Time-out-Pl%C3%A4tze+f%C3%BCr+Jugendliche%2C+welche+eine+Auszeit+aus+Familie%2C+Schule+oder+Institution+brauchen.+Unsere+St%C3%A4rken%3A+Erfahrung%2C+professionelle+p%C3%A4dagogische+Betreuung%2C+klare+Tagesstrukturen%2C+therapeutisches+Reiten%2C+schulische+F%C3%B6rderung.+';
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();
};

