/* [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','4558',jdecode('HOME'),jdecode(''),'/4558.html','true',[],'',''],
	['PAGE','13506',jdecode('UNSERE+REISEN'),jdecode(''),'/13506.html','true',[],'',''],
	['PAGE','59981',jdecode('TAUCHBASEN'),jdecode(''),'/59981.html','true',[],'',''],
	['PAGE','62142',jdecode('REISEBUCHUNGEN'),jdecode(''),'/62142.html','true',[],'',''],
	['PAGE','23009',jdecode('G%C3%84STEBUCH'),jdecode(''),'/23009/index.html','true',[ 
		['PAGE','23010',jdecode('EINTR%C3%84GE'),jdecode(''),'/23009/23010.html','false',[],'','']
	],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Picture';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10727';
theSitetree.graphicsetId='10752';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='1D1D1D';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Picture',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10727',
				graphicsetId: 	'10752',
				contentColor: 	'FFFFFF',
				contentBGColor: '1D1D1D',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-23009ahp010ine0vx']={
webappId:    '1002',
documentId:  '23009',
internalId:  '23009ahp010ine0vx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20081227-174217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13506',
internalId:  '',
customField: '20081227-174118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59981',
internalId:  '',
customField: '20081227-174527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62142',
internalId:  '',
customField: '20081227-180542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23009',
internalId:  '',
customField: '20090302-183851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23010',
internalId:  '',
customField: '20081227-174205'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4558',
internalId:  '',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13506',
internalId:  '',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '59981',
internalId:  '',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '62142',
internalId:  '',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '23009',
internalId:  '',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '23010',
internalId:  '',
customField: 'language:de;country:CH;'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INE0VX';
var companyName   = 'Swiss+Traveller';
var htmlTitle	  = 'Swiss+Traveller';
var metaKeywords  = 'Swiss+Traveller%2C+Swiss-Traveller%2C+www.swiss-traveller.com%2C+Reisen%2C+Reiseb%C3%BCro%2C+Forum%2C+Asien%2C+Australien%2C+Europa%2C+Backbacker%2C+Traveller%2C+Martina+Strebel%2C+Stephan+Amstad%2C+Swiss%2C+Globetrotter%2C+Mietwagen%2C+Austrian+Airlines%2C+Quantas%2CMigros%2C+Coop%2C+USA%2C+Australien%2C+Reiseb%C3%BCcher%2C+Forum%2C+Rot%2C+Blau%2CGelb%2C+Gr%C3%BCn%2C+Martina+Strebel+Stephan+Amstad%2C+Travel%2C+%21--%23exec+cmd%3Dcgi-bin%2Fentropybanner.cgi--';
var metaContents  = 'Swiss+Traveller%2C+ist+eine+Plattform+von+Martina+Strebel+und+Stephan+Amstad+f%C3%BCr+all+die+Traveller%2C+die+wir+w%C3%A4hrend+dem+Reisen+kennen+gelernt+habe+und+f%C3%BCr+alle+Freunde+und+Bekannte+die+Zuhause+geblieben+sind.+Wir+wollen+Euch+die+Welt+in+Fotos+wiederspiegeln.+Viel+Vergn%C3%BCgen+beim+st%C3%B6bern%21+%3A-%29+Just+Travel...%21%21';
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();
};
