/* [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','1246',jdecode('Keller%C3%A4umung+in+Baselland'),jdecode(''),'/1246.html','true',[],'',''],
	['PAGE','4001',jdecode('Hausr%C3%A4umung+in+Baselland'),jdecode(''),'/4001.html','true',[],'',''],
	['PAGE','4022',jdecode('Wohnungsaufl%C3%B6sung+in+Baselland'),jdecode(''),'/4022.html','true',[],'',''],
	['PAGE','4043',jdecode('B%C3%BCror%C3%A4umung+in+Baselland'),jdecode(''),'/4043.html','true',[],'',''],
	['PAGE','5001',jdecode('Messie-R%C3%A4umung+in+Baselland'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','1341',jdecode('So+kontaktieren+Sie+uns'),jdecode(''),'/1341.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Pastel';
theSitetree.paletteFamily='D3F9AA';
theSitetree.keyvisualId='11250';
theSitetree.keyvisualName='kv_11250.jpg';
theSitetree.fontsetId='32128';
theSitetree.graphicsetId='13921';
theSitetree.contentColor='403f3f';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pastel',
				paletteFamily: 	'D3F9AA',
				keyvisualId: 	'11250',
				keyvisualName: 	'kv_11250.jpg',
				fontsetId: 		'32128',
				graphicsetId: 	'13921',
				contentColor: 	'403f3f',
				contentBGColor: 'FFFFFF',
				a_color: 		'D3F9AA',
				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:  '4022',
internalId:  '',
customField: '20100728-181322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20100728-181351'
};
webappMappings['7008']=webappMappings['7008-7423']={
webappId:    '7008',
documentId:  '1341',
internalId:  '7423',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20100728-181114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100728-181432'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1246',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100728-181248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1341',
internalId:  '',
customField: '20100728-182415'
};
var canonHostname = 'wsc01.webland.ch';
var accountId     = 'AWB010IN27YE';
var companyName   = 'www.Kellerraeumung-Entruempelung-Hausraeumung-in-Baselland.ch++++++++++++++++++++++++++++++++atax.basel%40gmail.com';
var htmlTitle	  = 'Basel-Stadt+%2B+Baselland%3A++Kellerr%C3%A4umung%2C+Entr%C3%BCmpelung+und+Hausr%C3%A4umung+in+Baselland';
var metaKeywords  = 'Basel+Basel-Stadt+Kanton+Basel+Baselland+Basel-Landschaft+Basel+Land+Basel-Land+BS+BL+Bettingen+Riehen+Rheinknie+Birsig+Dreil%C3%A4ndereck+Kleinbasel+Grossbasel+Kleinh%C3%BCningen+Muttenz+L%C3%B6rrach+Grenzach-+Wyhlen+Birsfelden+Muttenz+M%C3%BCnchenstein+Reinach+Bottmingen+Binningen+Allschwil++Altstadt+Vorst%C3%A4dte+Am+Ring+Breite+St.Alban+Gundeldingen+Bruderholz+Bachletten+Gotthelf+Iselin+St.Johann+Clara+Wettstein+Hirzbrunnen+Rosental+Matth%C3%A4us+Klybeck+Kleinh%C3%BCningen+Birs+Rhein+Wiese+Basileus+Basilius+B%C3%A0le+Basilea+M%C3%BCnsterh%C3%BCge+lMarktplatz+Pharma-Industrie+Chemie-Industrie+Mulhouse+R%C3%A4umungsservice+Entsorgungsservice+Entr%C3%BCmpelungsservice+Entsorgung+Entr%C3%BCmpelung+R%C3%A4umung+R%C3%A4umungen+Hausr%C3%A4umung+Wohnungsr%C3%A4umung+Haushaltsr%C3%A4umung+Kellerr%C3%A4umung+Garagenr%C3%A4umung+Abholdienst+Abholservice+Kleintransporte+Warentaxi+TransportTaxi+MoebelTaxi+Verlassenschafts-R%C3%A4umung+Erbschaft+Erbe+Messie+Verm%C3%BCllung+Messie-Syndrom+Zwangsr%C3%A4umung+Umzug+Umzuege+Reinigung+Wohnungsreinigung+Umzugsreinigung+Verwahrlosung+Sammelwut+Hamster-Syndrom+Diogenes-Syndrom+Messi+Mesi+Mietmonamade+im+Auftrag+von+Hausverwaltung+Gemeindeverwaltung+Baselbiet';
var metaContents  = 'ATAX+bietet+Entr%C3%BCmpelunsservice%2C+Entsorgungsservice+und+diskrete%2C+professionelle%2C+kosteng%C3%BCnstige+R%C3%A4umungen%2C+Kellerr%C3%A4umung%2C+Hausr%C3%A4umungen%2C+Wohnungsr%C3%A4umungen%2C+Wohnungsaufl%C3%B6sungen%2C+Haushaltsaufl%C3%B6sungen%2C+Messie-Wohnungs-R%C3%A4umungen%2C+Zwangsr%C3%A4umungen%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();
};

