/* [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','4101',jdecode('Home'),jdecode(''), jdecode('%2F4101.html'), 'true',[],'',''],
	['PAGE','9801',jdecode('Motorr%C3%A4der'),jdecode(''), jdecode('%2F9801.html'), 'true',[],'',''],
	['PAGE','9822',jdecode('Touren'),jdecode(''), jdecode('%2F9822.html'), 'true',[],'',''],
	['PAGE','9864',jdecode('News+%2F+Event'),jdecode(''), jdecode('%2F9864.html'), 'true',[],'',''],
	['PAGE','9906',jdecode('Leistungen+%2F+Kontakt'),jdecode(''), jdecode('%2F9906.html'), 'false',[],'',''],
	['PAGE','9885',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F9885.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('Forum'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','9927',jdecode('Impressum'),jdecode(''), jdecode('%2F9927.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Heros';
theSitetree.paletteFamily='D38C2A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32057';
theSitetree.graphicsetId='13875';
theSitetree.contentColor='ef9015';
theSitetree.contentBGColor='454545';
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: 			'Heros',
				paletteFamily: 	'D38C2A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32057',
				graphicsetId: 	'13875',
				contentColor: 	'ef9015',
				contentBGColor: '454545',
				a_color: 		'323232',
				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:  '4101',
internalId:  '',
customField: '20120106-165033'
};
webappMappings['7002']=webappMappings['7002-3161']={
webappId:    '7002',
documentId:  '9885',
internalId:  '3161',
customField: 'language:de;country:DE;'
};
webappMappings['7008']=webappMappings['7008-4220']={
webappId:    '7008',
documentId:  '9906',
internalId:  '4220',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20120106-164416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9822',
internalId:  '',
customField: '20120105-091820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9927',
internalId:  '',
customField: '20100123-101627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9906',
internalId:  '',
customField: '20100121-111704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9885',
internalId:  '',
customField: '20100123-181005'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9864',
internalId:  '',
customField: '20120106-164622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20120106-164919'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10INXEDP';
var companyName   = 'Classic+-+Motorrad+-+Tours';
var htmlTitle	  = 'Classic+Motorradtouren';
var metaKeywords  = '';
var metaContents  = 'Oldtimer+Motorr%C3%A4der+gef%C3%BChrte+Motorradtouren%2C+Oldtimer+Touren+%2C+Italo+bikes%2C+oltimer+forum%0D%0AOldtimer%0D%0AOldi+Motorr%C3%A4der%0D%0AClassic+Motorradforum%0D%0AOldtimer+Forum%0D%0AOldtimer+Motorradforum%0D%0AOldtimer+motorrad+Forum%0D%0AMotorradforum%0D%0ABenelli+Forum%0D%0ALaverda+Forum%0D%0AHonda+Forum%0D%0AMoto+Guzzi+Forum%0D%0AKawa+Forum%0D%0ASuzuki+Forum%0D%0AOltimer+IG%0D%0AOldtimer+Motorad+Ig%0D%0AClassic+Freunde%0D%0AMotorrad+touren';
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();
};

