/* [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','103801',jdecode('flyfree'),jdecode(''),'/103801.html','true',[],'',''],
	['PAGE','5601',jdecode('tandemflights+'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','104901',jdecode('fluggebiete+preise'),jdecode(''),'/104901.html','true',[],'',''],
	['PAGE','91401',jdecode('about+me'),jdecode(''),'/91401.html','true',[],'',''],
	['PAGE','20501',jdecode('safety'),jdecode(''),'/20501.html','true',[],'',''],
	['PAGE','5706',jdecode('contact'),jdecode(''),'/5706.html','true',[],'',''],
	['PAGE','5643',jdecode('gallery'),jdecode(''),'/5643.html','true',[],'',''],
	['PAGE','128501',jdecode('video'),jdecode(''),'/128501.html','true',[],'',''],
	['PAGE','20404',jdecode('guest+book'),jdecode(''),'/20404/index.html','true',[ 
		['PAGE','20399',jdecode('Entries'),jdecode(''),'/20404/20399.html','false',[],'','']
	],'',''],
	['PAGE','41601',jdecode('news'),jdecode(''),'/41601.html','true',[],'',''],
	['PAGE','5622',jdecode('events'),jdecode(''),'/5622.html','true',[],'',''],
	['PAGE','5685',jdecode('friends+partner'),jdecode(''),'/5685.html','true',[],'',''],
	['PAGE','133801',jdecode('meteo'),jdecode(''),'/133801.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4356';
theSitetree.keyvisualName='kv_4356.jpg';
theSitetree.fontsetId='10800';
theSitetree.graphicsetId='11232';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8396BA';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Solid',
				paletteFamily: 	'8396BA',
				keyvisualId: 	'4356',
				keyvisualName: 	'kv_4356.jpg',
				fontsetId: 		'10800',
				graphicsetId: 	'11232',
				contentColor: 	'FFFFFF',
				contentBGColor: '8396BA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-20404abw0x0ine5mv']={
webappId:    '1002',
documentId:  '20404',
internalId:  '20404abw0x0ine5mv',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103801',
internalId:  '',
customField: '20090201-190911'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '103801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-249']={
webappId:    '7008',
documentId:  '5706',
internalId:  '249',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20090131-194518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104901',
internalId:  '',
customField: '20090201-191049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91401',
internalId:  '',
customField: '20090131-192703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20090124-121011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20080926-161651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20090131-194251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128501',
internalId:  '',
customField: '20090309-150348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20404',
internalId:  '',
customField: '20080324-212939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20399',
internalId:  '',
customField: '20080324-212939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20090803-192607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20090131-195303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5685',
internalId:  '',
customField: '20090803-190057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133801',
internalId:  '',
customField: '20090131-200118'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INE5MV';
var companyName   = 'Paragliding+Tandemflights+%2F+Speedflying';
var htmlTitle	  = 'Willkommen+bei+flyfree.ch+Gleitschirm+Tandemfl%C3%BCge+in+der+Schweiz';
var metaKeywords  = 'flyfree.ch%2C+Gleitschirmpassagierfl%EF%BF%BDge%2C+Gleitschirm%2C+Passagierfl%3Fge%2C+paragliding%2C+tandemflights%2C+speedflying%2C+Dani+Meier%2C+Meteo%2C+Engelberg%2C+Zentralschweiz';
var metaContents  = 'Erleben+sie+die+einfachste+Art+des+Fliegens.+Gleitschirmpassagierfl%EF%BF%BDge%2C+Paragliding+Tandemflights.';
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();
};
