/* [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','4558',jdecode('Home'),jdecode(''),'/4558.html','true',[],'',''],
	['PAGE','4615',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/4615.html','true',[],'',''],
	['PAGE','53041',jdecode('Vermietung'),jdecode(''),'/53041.html','true',[],'',''],
	['PAGE','53609',jdecode('Weinsberg-Reisemobile'),jdecode(''),'/53609.html','true',[],'',''],
	['PAGE','83901',jdecode('Knaus-Wohnwagen'),jdecode(''),'/83901.html','true',[],'',''],
	['PAGE','4642',jdecode('Wilk-Wohnwagen'),jdecode(''),'/4642.html','true',[],'',''],
	['PAGE','4696',jdecode('Ausstellungs-Fahrzeuge'),jdecode(''),'/4696.html','true',[],'',''],
	['PAGE','4723',jdecode('Vorzelte'),jdecode(''),'/4723.html','true',[],'',''],
	['PAGE','4750',jdecode('Zubeh%C3%B6r'),jdecode(''),'/4750.html','true',[],'',''],
	['PAGE','4777',jdecode('Werkstatt'),jdecode(''),'/4777.html','true',[],'',''],
	['PAGE','4804',jdecode('Aktuelles'),jdecode(''),'/4804.html','true',[],'',''],
	['PAGE','5347',jdecode('Aktionen'),jdecode(''),'/5347.html','true',[],'',''],
	['PAGE','5374',jdecode('Kontakt'),jdecode(''),'/5374/index.html','true',[ 
		['PAGE','9701',jdecode('Kontakt+%28Form+followup+page%29'),jdecode(''),'/5374/9701.html','false',[],'','']
	],'',''],
	['PAGE','6202',jdecode('Anfahrt'),jdecode(''),'/6202.html','true',[],'',''],
	['PAGE','6237',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/6237.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4361';
theSitetree.keyvisualName='kv_4361.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: 	'4361',
				keyvisualName: 	'kv_4361.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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6202',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6237',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1009']=webappMappings['1009-6263006']={
webappId:    '1009',
documentId:  '9701',
internalId:  '6263006',
customField: 'isFollowupPage:true;documentId:5374;'
};
webappMappings['7008']=webappMappings['7008-515']={
webappId:    '7008',
documentId:  '5374',
internalId:  '515',
customField: 'language:de;country:CH;'
};
webappMappings['1501']=webappMappings['1501-523152']={
webappId:    '1501',
documentId:  '4558',
internalId:  '523152',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20080927-100422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4615',
internalId:  '',
customField: '20100115-224532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53041',
internalId:  '',
customField: '20100123-111922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53609',
internalId:  '',
customField: '20100123-111742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4642',
internalId:  '',
customField: '20100216-181334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4696',
internalId:  '',
customField: '20100705-232445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4723',
internalId:  '',
customField: '20060217-223433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4750',
internalId:  '',
customField: '20070807-084145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4777',
internalId:  '',
customField: '20080927-102042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4804',
internalId:  '',
customField: '20071118-175543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5347',
internalId:  '',
customField: '20100122-175841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5374',
internalId:  '',
customField: '20060130-233910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20060130-223530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6202',
internalId:  '',
customField: '20060301-220312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6237',
internalId:  '',
customField: '20060301-084416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83901',
internalId:  '',
customField: '20100216-175535'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXWH';
var companyName   = 'PNC+Reisemobile+%2B+Wohnwagen';
var htmlTitle	  = '';
var metaKeywords  = 'Reisemobile%2C+Wohnwagen%2C+Kaltbrunn%3B+Uznach%3B+St.+Gallen%2C+Kanton+St.+Gallen%2C+Z%C3%BCrich%2C+Ostschweiz%2C+Knaus%2C+Knaus-Wohnwagen%2C+Knaus-Caravans%2C+Caravans%2C+Wohnmobilvermietung%2C+Wohnmobil+Vermietung%2C+Wohnmobilvermietung+St.+Gallen%2C+Wohnmobilvermietung+Z%C3%BCrich%2C++Vermietung%2C+Campervermietung%2C+Campervermietung+St.+Gallen%2C+Camper+Vermietung%2C+Camper+mieten%2CCampermieten%2C+Wohnmobilmieten%2CWohnwagen+Kaltbrunn%2C+Wohnmobil+Kaltbrunn%2C+Camper+Kaltbrunn%2C+Camper+mieten+Kaltbrunn%2C+Wohnmobil+mieten+Kaltbrunn%2C++Reisemobilvermietung%2C+Reisemobil+Vermietung%2C+Wohnmobile+mieten%2C+Reisemobile+mieten%2C+Weinsberg-Reisemobile%2C+Reisemobilausbau%2C+Campingzubeh%C3%B6r%2CCampingshop%2C+Campingzubeh%C3%B6r+Kaltbrunn%2C+Reparaturen%2C+Vorzelte%2C+Wilk%2C+Wilk-Wohnwagen%2C+Wilk-Caravans%2C+PNC-Reisemobile%2C+Reisemobil-Sonderanfertigungen%2C+Weinsberg%2C';
var metaContents  = 'Reisemobile%2C+Wohnwagen%2C+Wohnmobilvermietung%2C+Wohnmobil+Vermietung%2C+Campervermietung%2C+Camper+Vermietung%2C+Camper+mieten%2C+Reisemobilvermietung%2C+Reisemobil+Vermietung%2C+Reisemobile+mieten%2C+Camper%2C+Vermietung%2C+Wohnmobile+mieten%2C+Weinsberg%2C+Weinsberg-Reisemobile%2C+Reisemobilausbau%2C+Campingzubeh%C3%B6r%2C+Knaus-Wohnwagen%2C+Knaus%2C+Wilk-Wohnwagen%2C+Wilk-Caravans%2C+Wilk%2C+PNC+Reisemobile%2C+Reisemobil-Sonderanfertigungen%2C';
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();
};
