/* [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','4455',jdecode('Home'),jdecode(''), jdecode('%2F4455.html'), 'true',[],'',''],
	['PAGE','197288',jdecode('++++News'),jdecode(''), jdecode('%2F197288.html'), 'true',[],'',''],
	['PAGE','4539',jdecode('DR+Angebot+'),jdecode(''), jdecode('%2F4539.html'), 'true',[],'',''],
	['PAGE','193616',jdecode('DR+Ausstattung'),jdecode(''), jdecode('%2F193616.html'), 'true',[],'',''],
	['PAGE','203092',jdecode('Freie+Trauung'),jdecode(''), jdecode('%2F203092.html'), 'true',[],'',''],
	['PAGE','193086',jdecode('Bilder'),jdecode(''), jdecode('%2F193086%2Findex.html'), 'true',[ 
		['PAGE','4701',jdecode('Sofaecke'),jdecode(''), jdecode('%2F193086%2F4701.html'), 'true',[],'',''],
		['PAGE','4647',jdecode('Darkroom'),jdecode(''), jdecode('%2F193086%2F4647.html'), 'true',[],'',''],
		['PAGE','4674',jdecode('Kuschelraum'),jdecode(''), jdecode('%2F193086%2F4674.html'), 'true',[],'','']
	],'',''],
	['PAGE','4755',jdecode('Reservierung'),jdecode(''), jdecode('%2F4755%2Findex.html'), 'true',[ 
		['PAGE','205952',jdecode('Schl%C3%BCssel'),jdecode(''), jdecode('%2F4755%2F205952.html'), 'true',[],'','']
	],'',''],
	['PAGE','7702',jdecode('Preise'),jdecode(''), jdecode('%2F7702.html'), 'true',[],'',''],
	['PAGE','204994',jdecode('Regeln'),jdecode(''), jdecode('%2F204994%2Findex.html'), 'true',[ 
		['PAGE','4593',jdecode('Hausregeln'),jdecode(''), jdecode('%2F204994%2F4593.html'), 'true',[],'',''],
		['PAGE','203586',jdecode('Mal+auf+ein+Wort'),jdecode(''), jdecode('%2F204994%2F203586.html'), 'true',[],'',''],
		['PAGE','203595',jdecode('Verhaltensregeln'),jdecode(''), jdecode('%2F204994%2F203595.html'), 'true',[],'','']
	],'',''],
	['PAGE','4620',jdecode('Hygiene+%2F+Sicherheit'),jdecode(''), jdecode('%2F4620.html'), 'true',[],'',''],
	['PAGE','201762',jdecode('Fragen+%2B+Antworten'),jdecode(''), jdecode('%2F201762.html'), 'true',[],'',''],
	['PAGE','190416',jdecode('Lage'),jdecode(''), jdecode('%2F190416.html'), 'true',[],'',''],
	['PAGE','4809',jdecode('Links'),jdecode(''), jdecode('%2F4809.html'), 'true',[],'',''],
	['PAGE','193781',jdecode('AGB+%2B+Haftung+++++'),jdecode(''), jdecode('%2F193781.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='CC0000';
theSitetree.keyvisualId='902';
theSitetree.keyvisualName='feder.jpg';
theSitetree.fontsetId='163';
theSitetree.graphicsetId='188';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'CC0000',
				keyvisualId: 	'902',
				keyvisualName: 	'feder.jpg',
				fontsetId: 		'163',
				graphicsetId: 	'188',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4455',
internalId:  '',
customField: '20101219-011820'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4455',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '190416',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204994',
internalId:  '',
customField: '20110921-190814'
};
webappMappings['1501']=webappMappings['1501-393117']={
webappId:    '1501',
documentId:  '4455',
internalId:  '393117',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203586',
internalId:  '',
customField: '20100421-193303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4539',
internalId:  '',
customField: '20101219-013942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '193616',
internalId:  '',
customField: '20101219-014020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4593',
internalId:  '',
customField: '20100421-193224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4620',
internalId:  '',
customField: '20101027-115735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201762',
internalId:  '',
customField: '20101219-013553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '193086',
internalId:  '',
customField: '20101027-151522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4647',
internalId:  '',
customField: '20110921-190210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4674',
internalId:  '',
customField: '20101027-145704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20101027-150528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7702',
internalId:  '',
customField: '20101219-013116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4755',
internalId:  '',
customField: '20110921-190609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203595',
internalId:  '',
customField: '20100421-193414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '190416',
internalId:  '',
customField: '20101219-013641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4809',
internalId:  '',
customField: '20101219-013734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '197288',
internalId:  '',
customField: '20110921-192035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '193781',
internalId:  '',
customField: '20101025-170728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203092',
internalId:  '',
customField: '20101219-014234'
};
webappMappings['7060']=webappMappings['7060-1b4b425e80b3eec6c7535d7541122f18']={
webappId:    '7060',
documentId:  '205952',
internalId:  '1b4b425e80b3eec6c7535d7541122f18',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205952',
internalId:  '',
customField: '20110308-215510'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXSHC';
var companyName   = 'D+A+R+K+R+O+O+M++++B+A+S+E+L+';
var htmlTitle	  = 'Darkroom+Basel+stundenweise+zu+vermieten';
var metaKeywords  = 'A%2C+Darkroom+Basel+stundenweise+zu+vermieten%21++Darkroom%2C+SM%2C+SM-Raum%2C+BDSM%2C+Sklave%2C+Sklavin%2C+Herrin%2C+Sex%2C+Erotik%2C+Playroom%2C+zu+vermieten%2C+Basel%2C+Meister%2C+Lust%2C+Leidenschaft%2C+Erotik+Sexualit%C3%A4t%2C+';
var metaContents  = 'Darkroom+Basel+stundenweise+zu+vermieten%21++Darkroom%2C+SM%2C+SM-Raum%2C+BDSM%2C+Sklave%2C+Sklavin%2C+Herrin%2C+Sex%2C+Erotik%2C+Playroom%2C+zu+vermieten%2C+Basel%2C+Meister%2C+Lust%2C+Leidenschaft%2C+Erotik+Sexualit%C3%A4t%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();
};

