/* [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','4701',jdecode('Home'),jdecode(''), jdecode('%2F4701.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F5201%2Findex.html'), 'true',[ 
		['PAGE','5222',jdecode('Werkstatt'),jdecode(''), jdecode('%2F5201%2F5222.html'), 'true',[],'',''],
		['PAGE','5243',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F5201%2F5243.html'), 'true',[],'',''],
		['PAGE','45701',jdecode('Routenplaner'),jdecode(''), jdecode('%2F5201%2F45701.html'), 'true',[],'','']
	],'',''],
	['PAGE','5264',jdecode('Kontakt+%2F+%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F5264.html'), 'true',[],'',''],
	['PAGE','5285',jdecode('Aktuelle+Angebote'),jdecode(''), jdecode('%2F5285.html'), 'true',[],'',''],
	['PAGE','5306',jdecode('Zubeh%C3%B6r'),jdecode(''), jdecode('%2F5306.html'), 'true',[],'',''],
	['PAGE','43101',jdecode('Gebrauchte+Teile'),jdecode(''), jdecode('%2F43101.html'), 'true',[],'',''],
	['PAGE','5327',jdecode('Service'),jdecode(''), jdecode('%2F5327%2Findex.html'), 'true',[ 
		['PAGE','5348',jdecode('Gebrauchtfahrzeuge'),jdecode(''), jdecode('%2F5327%2F5348.html'), 'true',[],'',''],
		['PAGE','5369',jdecode('Motorenservice'),jdecode(''), jdecode('%2F5327%2F5369.html'), 'true',[],'',''],
		['PAGE','5390',jdecode('Reifenservice'),jdecode(''), jdecode('%2F5327%2F5390.html'), 'true',[],'','']
	],'',''],
	['PAGE','32401',jdecode('Galerie'),jdecode(''), jdecode('%2F32401.html'), 'true',[],'',''],
	['PAGE','63601',jdecode('Umzugsfest'),jdecode(''), jdecode('%2F63601.html'), 'true',[],'',''],
	['PAGE','37501',jdecode('Kontaktformular'),jdecode(''), jdecode('%2F37501.html'), 'true',[],'',''],
	['PAGE','45301',jdecode('Impressum'),jdecode(''), jdecode('%2F45301.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='929192';
theSitetree.keyvisualId='7972';
theSitetree.keyvisualName='kv_7972.jpg';
theSitetree.fontsetId='16912';
theSitetree.graphicsetId='12327';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Trend',
				paletteFamily: 	'929192',
				keyvisualId: 	'7972',
				keyvisualName: 	'kv_7972.jpg',
				fontsetId: 		'16912',
				graphicsetId: 	'12327',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20111231-140515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20111021-180047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5306',
internalId:  '',
customField: '20120219-211609'
};
webappMappings['7060']=webappMappings['7060-dafe0aec3bcfc1cd32c179049390d367']={
webappId:    '7060',
documentId:  '32401',
internalId:  'dafe0aec3bcfc1cd32c179049390d367',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5264',
internalId:  '',
customField: '20110918-203415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20111021-180149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5243',
internalId:  '',
customField: '20110920-224851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5327',
internalId:  '',
customField: '20101027-221142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5348',
internalId:  '',
customField: '20120219-210236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5369',
internalId:  '',
customField: '20101028-185452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5390',
internalId:  '',
customField: '20110930-192052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20101031-153251'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45301',
internalId:  '',
customField: '20101028-185416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5285',
internalId:  '',
customField: '20120219-205140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20101021-152102'
};
webappMappings['7008']=webappMappings['7008-10726']={
webappId:    '7008',
documentId:  '37501',
internalId:  '10726',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43101',
internalId:  '',
customField: '20111231-141634'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '45701',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45701',
internalId:  '',
customField: '20101031-153141'
};
webappMappings['7060']=webappMappings['7060-49444b77ff99820b9d8de24d81346dd6']={
webappId:    '7060',
documentId:  '63601',
internalId:  '49444b77ff99820b9d8de24d81346dd6',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63601',
internalId:  '',
customField: '20111020-203755'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INESAP';
var companyName   = 'K-STREET-TUNING';
var htmlTitle	  = 'K-STREET-TUNING';
var metaKeywords  = 'K-STREET-TUNING%3B+D%C3%BCdingen%3B+';
var metaContents  = 'Autotuning%3B+Fahrwerkstuning%3B+Tuningcars%3B+Tuning%3B+Felgen%3B+Alufelgen%3B+Chromfelgen%3B+Fahrwerke%3B+Sportauspuff%3B+Chip-Tuning%3B+Luftfilter%3B+Scheiben+t%C3%B6nen%3B+Sportbremsen%3B+Motortuning%3B+Reifen%3B+Reifenservice%3B+Pneu%3B+Wheels%3B+Autozubeh%C3%B6r%3B+Golf+R%3B+';
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();
};

