/* [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','801',jdecode('Home'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','852',jdecode('Vermietung'),jdecode(''), jdecode('%2F852%2Findex.html'), 'true',[ 
		['PAGE','894',jdecode('Mietpreise'),jdecode(''), jdecode('%2F852%2F894.html'), 'true',[],'',''],
		['PAGE','47501',jdecode('Mietbedingungen'),jdecode(''), jdecode('%2F852%2F47501.html'), 'true',[],'','']
	],'',''],
	['PAGE','111801',jdecode('Blucamp'),jdecode(''), jdecode('%2F111801%2Findex.html'), 'true',[ 
		['PAGE','111822',jdecode('Campingbus'),jdecode(''), jdecode('%2F111801%2F111822.html'), 'true',[],'',''],
		['PAGE','111843',jdecode('Teilintegrierte'),jdecode(''), jdecode('%2F111801%2F111843.html'), 'true',[],'',''],
		['PAGE','111864',jdecode('Ti+mit+Hubbett'),jdecode(''), jdecode('%2F111801%2F111864.html'), 'true',[],'',''],
		['PAGE','111885',jdecode('Alkoven'),jdecode(''), jdecode('%2F111801%2F111885.html'), 'true',[],'',''],
		['PAGE','119501',jdecode('Behindertengerecht'),jdecode(''), jdecode('%2F111801%2F119501.html'), 'true',[],'','']
	],'',''],
	['PAGE','111906',jdecode('ROLLER+TEAM'),jdecode(''), jdecode('%2F111906%2Findex.html'), 'true',[ 
		['PAGE','111927',jdecode('Campingbusse'),jdecode(''), jdecode('%2F111906%2F111927.html'), 'true',[],'',''],
		['PAGE','111948',jdecode('Teilintegrierte'),jdecode(''), jdecode('%2F111906%2F111948.html'), 'true',[],'',''],
		['PAGE','111969',jdecode('Ti+mit+Hubbett'),jdecode(''), jdecode('%2F111906%2F111969.html'), 'true',[],'',''],
		['PAGE','111990',jdecode('Alkoven'),jdecode(''), jdecode('%2F111906%2F111990.html'), 'true',[],'','']
	],'',''],
	['PAGE','957',jdecode('Occasionen'),jdecode(''), jdecode('%2F957.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('wo+sind+wir'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','75201',jdecode('Anfrage'),jdecode(''), jdecode('%2F75201.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Eatdrink';
theSitetree.paletteFamily='7575CE';
theSitetree.keyvisualId='3358';
theSitetree.keyvisualName='kv_3358.jpg';
theSitetree.fontsetId='10621';
theSitetree.graphicsetId='10738';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Eatdrink',
				paletteFamily: 	'7575CE',
				keyvisualId: 	'3358',
				keyvisualName: 	'kv_3358.jpg',
				fontsetId: 		'10621',
				graphicsetId: 	'10738',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'1B1B6F',
				e_color: 		'1B1B6F',
				f_color: 		'1B1B6F',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-18053040']={
webappId:    '1501',
documentId:  '801',
internalId:  '18053040',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2081']={
webappId:    '7008',
documentId:  '75201',
internalId:  '2081',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20120201-134929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20120201-135818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20111124-175658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111948',
internalId:  '',
customField: '20110331-161833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111990',
internalId:  '',
customField: '20110331-162012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111906',
internalId:  '',
customField: '20111124-180555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111927',
internalId:  '',
customField: '20110331-161734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20111124-175937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47501',
internalId:  '',
customField: '20071103-163009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111864',
internalId:  '',
customField: '20101025-140443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111885',
internalId:  '',
customField: '20101025-141210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111843',
internalId:  '',
customField: '20101105-230614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111801',
internalId:  '',
customField: '20111124-180524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111822',
internalId:  '',
customField: '20101025-140118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20090428-162355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75201',
internalId:  '',
customField: '20071103-161618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119501',
internalId:  '',
customField: '20101105-230537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111969',
internalId:  '',
customField: '20110405-124331'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2KU9';
var companyName   = 'TOP-Angebote+f%C3%BCr+Ihre+Freizeit';
var htmlTitle	  = 'camping-discount.ch';
var metaKeywords  = 'Wohnmobil%2C+Wohnmobile%2C+Wohnmobilvermietung%2C+Wohnmobil+Vermietung%2C+Blucamp%2C+Camping-Discount%2C+Wohnmobile+mieten%2C+Vermietung%2C+Reisemobile%2C+Reisemobilvermietung%2C+Reisemobile+mieten%2C+Camper%2C+Campervermietung%2C+Camper+Vermietung%2C+Camper+mieten%2C+Sarnen%2C+Blurent';
var metaContents  = 'Wohnmobile%2C+Wohnmobilvermietung%2C+Blucamp%2C+camping-discount%2C++der+Wohnmobil+Discount+in+der+Schweiz%2C+Wohnmobil+mieten%2C+Wohnmobile+mieten%2C+Camper+mieten%2C+Luzern%2C+Sarnen%2C+Innerschweiz%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();
};

