/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','4301',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F4301.html'), 'true',[],'',''],
	['PAGE','18201',jdecode('Stammtisch'),jdecode(''), jdecode('%2F18201.html'), 'true',[],'',''],
	['PAGE','4322',jdecode('Unsere+Fotos'),jdecode(''), jdecode('%2F4322.html'), 'true',[],'',''],
	['PAGE','6501',jdecode('Berichte+von+Touren'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','4343',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F4343.html'), 'true',[],'',''],
	['PAGE','4364',jdecode('Kontakt'),jdecode(''), jdecode('%2F4364.html'), 'true',[],'',''],
	['PAGE','31201',jdecode('Neue+Fotos'),jdecode(''), jdecode('%2F31201.html'), 'false',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Game';
theSitetree.paletteFamily='3D3D3D';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32044';
theSitetree.graphicsetId='13866';
theSitetree.contentColor='cb9240';
theSitetree.contentBGColor='3D3D3D';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'alfahosting',
  product: 'WSCSYSSSSLY0XNIF'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Game',
				paletteFamily: 	'3D3D3D',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32044',
				graphicsetId: 	'13866',
				contentColor: 	'cb9240',
				contentBGColor: '3D3D3D',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20120124-092857'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-cbd5b604bac8f0c9a9ffcb044d6c466f']={
webappId:    '7060',
documentId:  '4322',
internalId:  'cbd5b604bac8f0c9a9ffcb044d6c466f',
customField: 'language:de;country:DE;'
};
webappMappings['7002']=webappMappings['7002-2095']={
webappId:    '7002',
documentId:  '4343',
internalId:  '2095',
customField: 'language:de;country:DE;'
};
webappMappings['7008']=webappMappings['7008-2693']={
webappId:    '7008',
documentId:  '4364',
internalId:  '2693',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4301',
internalId:  '',
customField: '20111202-165208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4322',
internalId:  '',
customField: '20090831-140627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4343',
internalId:  '',
customField: '20100104-104928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4364',
internalId:  '',
customField: '20111026-103449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20110225-081605'
};
webappMappings['7050']=webappMappings['7050-1364']={
webappId:    '7050',
documentId:  '6501',
internalId:  '1364',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100227-060112'
};
webappMappings['1501']=webappMappings['1501-3528171']={
webappId:    '1501',
documentId:  '2101',
internalId:  '3528171',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20110725-105454'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10IN214T';
var companyName   = 'www.Twinfreunde.de';
var htmlTitle	  = 'Twinfreunde.de-+Honda+Africa+Twin+und+andere+Zweizylinder+aus+dem+M%C3%BCnsterland';
var metaKeywords  = 'Honda+Afrika+Twin+%2C+Honda+Transalp+%2C+KTM+990+Adventure+%2C+BMW+1150+GS+%2C+BMW+1200+GS+%2C+Africa+Twin+%2C+M%C3%BCnsterland%2C+Sauerland+%2C+Hamm+%2C+Dortmund%2C+L%C3%BCnen%2C+Unna%2C+Nordkirchen%2C+Motorrad%2C+Krad%2C+zweizylinder%2C+Reiseenduro%2C+Enduro%2C+Touren%2C+Stammtisch%2C+Ausfahrten%2C+';
var metaContents  = '+Infos+von+den+und+f%C3%BCr+die+Twinfreunde+M%C3%BCnsterland.Die+Twinfreunde+fahren+Honda+Africa+Twin%2C+Transalp%2C+BMW+GS+oder+KTM+LC8+Adventure-+Reiseenduros+mit+2+Zylindern+halt.Es+gibt+einen+Stammtisch+%28zur+Zeit+der+letzte+Donnerstag+im+Monat%29+aber+oft+trifft+man+sich+auch+zum+Fahren.+Die+bisherigen+Teilnehmer+kamen+aus+Hamm%2C+Unna%2C+Dortmund%2C+L%C3%BCnen%2C+L%C3%BCdinghausen+und+D%C3%BClmen.Noch+ist+Platz+f%C3%BCr+weitere+nette+Reiseendurofahrer%2Finnen.+Also+wenn+du+dich+angesprochen+f%C3%BChlst%2C+einfach+melden%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();
};

