/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','186712',jdecode('Aktionen%25-News'),jdecode(''), jdecode('%2F186712.html'), 'true',[],'',''],
	['PAGE','62301',jdecode('Umbauten%2FStyling'),jdecode(''), jdecode('%2F62301.html'), 'true',[],'',''],
	['PAGE','165512',jdecode('Projekt'),jdecode(''), jdecode('%2F165512.html'), 'true',[],'',''],
	['PAGE','187612',jdecode('MX++Training'),jdecode(''), jdecode('%2F187612.html'), 'true',[],'',''],
	['PAGE','191712',jdecode('Tuning'),jdecode(''), jdecode('%2F191712.html'), 'true',[],'',''],
	['PAGE','97212',jdecode('Zubeh%C3%B6rteile'),jdecode(''), jdecode('%2F97212.html'), 'true',[],'',''],
	['PAGE','32901',jdecode('Bekleidung+Suzuki'),jdecode(''), jdecode('%2F32901.html'), 'true',[],'',''],
	['PAGE','2252',jdecode('Occasionen'),jdecode(''), jdecode('%2F2252.html'), 'true',[],'',''],
	['PAGE','30101',jdecode('Vermietung'),jdecode(''), jdecode('%2F30101.html'), 'true',[],'',''],
	['PAGE','30122',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F30122.html'), 'true',[],'',''],
	['PAGE','66601',jdecode('Fotos%2FEvents'),jdecode(''), jdecode('%2F66601.html'), 'true',[],'',''],
	['PAGE','2315',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F2315.html'), 'true',[],'',''],
	['PAGE','2336',jdecode('Unsere+Fahrer'),jdecode(''), jdecode('%2F2336.html'), 'true',[],'',''],
	['PAGE','2357',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F2357.html'), 'true',[],'',''],
	['PAGE','2504',jdecode('Kontakt'),jdecode(''), jdecode('%2F2504.html'), 'true',[],'',''],
	['PAGE','2525',jdecode('Weitere+Links'),jdecode(''), jdecode('%2F2525.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8817';
theSitetree.keyvisualName='KV_03.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8817',
				keyvisualName: 	'KV_03.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FFFFFF',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20120215-095404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20110728-081649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2504',
internalId:  '',
customField: '20100312-115512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191712',
internalId:  '',
customField: '20111028-141345'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20120117-143327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20120112-084021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20110618-131438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30122',
internalId:  '',
customField: '20120206-133516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20101022-092710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '186712',
internalId:  '',
customField: '20120112-082919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97212',
internalId:  '',
customField: '20120112-082547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20120110-131509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66601',
internalId:  '',
customField: '20120110-074430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2525',
internalId:  '',
customField: '20091029-095146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62301',
internalId:  '',
customField: '20111215-171133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165512',
internalId:  '',
customField: '20110818-074542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187612',
internalId:  '',
customField: '20120206-133451'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEYQ6';
var companyName   = 'Ren%C3%A9+Werro+Suzuki-Motos';
var htmlTitle	  = 'ren%C3%A9+werro+Suzuki+Motos';
var metaKeywords  = 'werro+ren%C3%A9%0D%0Aorpund%0D%0Asuzuki%0D%0Awerro%0D%0Arws%0D%0Arws-Motos%0D%0A%0D%0Aren%C3%A9+werro+Suzuki+motos';
var metaContents  = 'rws-motos%0D%0Asuzuki+werro%0D%0Aren%C3%A9+werro%0D%0Asuzuki+orpund%0D%0Aren%C3%A9+werro+suzuki+motos%0D%0Amotos+orpund';
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();
};

