/* [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','1311',jdecode('Deutsch'),jdecode(''),'/1311.html','true',[],'',''],
	['PAGE','5701',jdecode('English'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','5722',jdecode('Francais'),jdecode(''),'/5722.html','true',[],'',''],
	['PAGE','5764',jdecode('G%C3%A4stebuch'),jdecode(''),'/5764.html','false',[],'',''],
	['PAGE','13801',jdecode('Kontakt%2Fcontact'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','6401',jdecode('Limousinen-Service'),jdecode(''),'/6401.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Corpus';
theSitetree.paletteFamily='374874';
theSitetree.keyvisualId='8981';
theSitetree.keyvisualName='kv_8981.jpg';
theSitetree.fontsetId='17256';
theSitetree.graphicsetId='12684';
theSitetree.contentColor='313131';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Corpus',
				paletteFamily: 	'374874',
				keyvisualId: 	'8981',
				keyvisualName: 	'kv_8981.jpg',
				fontsetId: 		'17256',
				graphicsetId: 	'12684',
				contentColor: 	'313131',
				contentBGColor: 'FFFFFF',
				a_color: 		'798ABE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-1650057']={
webappId:    '1501',
documentId:  '1311',
internalId:  '1650057',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20091223-153834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20100820-095802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20081020-094129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1311',
internalId:  '',
customField: '20100820-095842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5764',
internalId:  '',
customField: '20080529-160755'
};
webappMappings['7002']=webappMappings['7002-48']={
webappId:    '7002',
documentId:  '5764',
internalId:  '48',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1311',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100820-095502'
};
webappMappings['7008']=webappMappings['7008-300']={
webappId:    '7008',
documentId:  '13801',
internalId:  '300',
customField: 'language:de;country:CH;'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN25Q9';
var companyName   = 'Airport-Taxiservice+Basel';
var htmlTitle	  = 'Taxi+Basel+Basle+B%C3%A2le+Airport+a%C3%A9roport+Taxiservice+EuroAirport+Basel+Mulhouse+Freiburg+Unique+Z%C3%BCrich+Genf+Geneva+Gen%C3%A8ve+Cointrin+Bern+Berne+Belp+Lugano+Agno+Frankfurt%2FMain+aquabasilea+Fasnacht+Kurier+Kurierdienst';
var metaKeywords  = 'Taxi%2C+Airport%2C+a%C3%A9roport%2C+Taxiservice%2C+Limousine%2C+Basel%2C+Schweiz%2C+Allschwil%2C+Binningen%2C+Bottmingen%2C+Oberwil%2C+Therwil%2C+Riehen%2C+Flughafen%2C+Flughafentransfer%2C+Unique%2C+Z%C3%BCrich%2C+Zurich%2C+Genf%2C+Geneve%2C+Geneva%2C+Cointrin%2C+Belp%2C+Lugano%2C+Agno%2C+Sion%2C+Frankfurt%2C+Main%2C+aquabasilea%2C+Fasnacht%2C+Basler%2C+Kurier%2C+Kurierdienst';
var metaContents  = 'Airport-Taxi+Service+%28we+speak+english%3B+nous+parlons+francais%29+-+Jederzeit+p%C3%BCnktlich+und+auf+dem+k%C3%BCrzesten+Weg+zu+Ihrem+Ziel+in+Basel+Mulhouse+Freiburg+und+Umgebung+-+wir+bedienen+auch+Flughafen+Unique+Airport+Z%C3%BCrich%2C+Genf-Cointrin%2C+Belp+Bern%2C+Lugano-Agno%2C+Sion%2C+Frankfurt%2FMain+u.a.';
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();
};
