/* [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','13301',jdecode('1.Seite+%2F+1%C3%A8re+page'),jdecode(''),'/13301.html','true',[],'',''],
	['PAGE','13373',jdecode('sinnliche+Begegnung'),jdecode(''),'/13373.html','true',[],'',''],
	['PAGE','13352',jdecode('corps-%C3%A0-corps'),jdecode(''),'/13352.html','true',[],'',''],
	['PAGE','11001',jdecode('Tanz+%2F+Danse'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','13394',jdecode('Sport'),jdecode(''),'/13394.html','true',[],'',''],
	['PAGE','13415',jdecode('Infos'),jdecode(''),'/13415.html','true',[],'',''],
	['PAGE','18706',jdecode('Feedback'),jdecode(''),'/18706/index.html','true',[ 
		['PAGE','18701',jdecode('Eintr%C3%A4ge+%2F+Notes'),jdecode(''),'/18706/18701.html','false',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Rectangle';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='2505';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='454';
theSitetree.graphicsetId='506';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rectangle',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'2505',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'454',
				graphicsetId: 	'506',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-18706abw0x0in2ssz']={
webappId:    '1002',
documentId:  '18706',
internalId:  '18706abw0x0in2ssz',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20110209-102227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13373',
internalId:  '',
customField: '20081105-223033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13352',
internalId:  '',
customField: '20091202-203527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20110209-102537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13394',
internalId:  '',
customField: '20081017-145203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13415',
internalId:  '',
customField: '20080204-204822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18706',
internalId:  '',
customField: '20070629-164507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20070523-174151'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2SSZ';
var companyName   = 'Wolfgang+Weiss+Art';
var htmlTitle	  = 'Wolfgang+Weiss+Art';
var metaKeywords  = 'Wolfgang+Weiss%2C+Mal-Atelier%2C+Paarbilder%2C+Akte%2C+Tanzbilder%2C+Sportbilder%2C+Atelier+de+peinture%2C+Tableaux+de+couples%2C+Tableax+de+nues%2C+Tableaux+de+danse%2C+Tableaux+de+sport';
var metaContents  = 'Bilder%2C+Malerei%2C+Kunst%2C+Sport-Bilder%2C+Tanzbilder%2C+Paarbilder%2C+Akt%2C+Akte%2C+Aktmalerei%2C+sinnliche+Art%2C+Bewegungsbilder%2C+Menschen+in+Bewegung%2C+sinnlich-z%C3%A4rtliche-Erotik%2C+Tableaux%2C+Peinture%2C+Art%2C+Tableaux+de+sport%2C+Tableaux+de+danse%2C+Tableaux+de+couples%2C+Nu%2C+Nues%2C+Peinture+de+nues%2C+Art+sensuel%2C+Tableaux+de+mouvement%2C++Humains+en+mouvement%2C+Erotisme+tendre+et+sensuelle';
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();
};

