/* [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','2001',jdecode('Home'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','31801',jdecode('Picselle+Eye+of+St.+Moritz'),jdecode(''), jdecode('%2F31801.html'), 'true',[],'',''],
	['PAGE','4201',jdecode('%C3%9Cber+mich'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','4222',jdecode('Fotos'),jdecode(''), jdecode('%2F4222.html'), 'true',[],'',''],
	['PAGE','4701',jdecode('Werbung'),jdecode(''), jdecode('%2F4701%2Findex.html'), 'true',[ 
		['PAGE','4722',jdecode('Schmuck'),jdecode(''), jdecode('%2F4701%2F4722.html'), 'true',[],'',''],
		['PAGE','4743',jdecode('Technik'),jdecode(''), jdecode('%2F4701%2F4743.html'), 'true',[],'',''],
		['PAGE','4764',jdecode('Diverse'),jdecode(''), jdecode('%2F4701%2F4764.html'), 'false',[],'','']
	],'',''],
	['PAGE','4785',jdecode('Firmenreportage'),jdecode(''), jdecode('%2F4785.html'), 'true',[],'',''],
	['PAGE','4806',jdecode('People'),jdecode(''), jdecode('%2F4806%2Findex.html'), 'true',[ 
		['PAGE','70201',jdecode('Popart'),jdecode(''), jdecode('%2F4806%2F70201.html'), 'true',[],'',''],
		['PAGE','4827',jdecode('Kinder'),jdecode(''), jdecode('%2F4806%2F4827.html'), 'true',[],'',''],
		['PAGE','4848',jdecode('Studio'),jdecode(''), jdecode('%2F4806%2F4848.html'), 'true',[],'',''],
		['PAGE','4869',jdecode('MusikerInnen'),jdecode(''), jdecode('%2F4806%2F4869.html'), 'true',[],'',''],
		['PAGE','4890',jdecode('Theater'),jdecode(''), jdecode('%2F4806%2F4890.html'), 'true',[],'','']
	],'',''],
	['PAGE','4911',jdecode('Editorial'),jdecode(''), jdecode('%2F4911%2Findex.html'), 'true',[ 
		['PAGE','4932',jdecode('Landschaft'),jdecode(''), jdecode('%2F4911%2F4932.html'), 'true',[],'',''],
		['PAGE','4953',jdecode('Schweizer+Illustrierte'),jdecode(''), jdecode('%2F4911%2F4953.html'), 'true',[],'',''],
		['PAGE','16701',jdecode('GEO'),jdecode(''), jdecode('%2F4911%2F16701.html'), 'true',[],'',''],
		['PAGE','16722',jdecode('Schweizer+Woche'),jdecode(''), jdecode('%2F4911%2F16722.html'), 'true',[],'',''],
		['PAGE','16743',jdecode('Schweizer+Familie'),jdecode(''), jdecode('%2F4911%2F16743.html'), 'true',[],'',''],
		['PAGE','16764',jdecode('Revue+Schweiz'),jdecode(''), jdecode('%2F4911%2F16764.html'), 'true',[],'',''],
		['PAGE','16785',jdecode('Ballett'),jdecode(''), jdecode('%2F4911%2F16785.html'), 'true',[],'',''],
		['PAGE','16806',jdecode('Diverse'),jdecode(''), jdecode('%2F4911%2F16806.html'), 'true',[],'',''],
		['PAGE','4974',jdecode('K%C3%BCnstlerInnen'),jdecode(''), jdecode('%2F4911%2F4974.html'), 'true',[],'','']
	],'',''],
	['PAGE','4243',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F4243.html'), 'true',[],'',''],
	['PAGE','9201',jdecode('Lageplan'),jdecode(''), jdecode('%2F9201.html'), 'true',[],'',''],
	['PAGE','4264',jdecode('Kontakt'),jdecode(''), jdecode('%2F4264.html'), 'true',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='A8A7A9';
theSitetree.keyvisualId='6884';
theSitetree.keyvisualName='kv_6884.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12032';
theSitetree.contentColor='4E4E4E';
theSitetree.contentBGColor='B6B5B7';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'genotec',
  product: 'WSCSYSSSSLY0XYAO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'A8A7A9',
				keyvisualId: 	'6884',
				keyvisualName: 	'kv_6884.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12032',
				contentColor: 	'4E4E4E',
				contentBGColor: 'B6B5B7',
				a_color: 		'B6B5B7',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20110908-091442'
};
webappMappings['7002']=webappMappings['7002-344']={
webappId:    '7002',
documentId:  '4243',
internalId:  '344',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-415']={
webappId:    '7008',
documentId:  '4264',
internalId:  '415',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20081220-122312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4243',
internalId:  '',
customField: '20081210-234115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4264',
internalId:  '',
customField: '20081210-232839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20090202-154854'
};
webappMappings['7060']=webappMappings['7060-aed20f492112019de8a63a79cf724290']={
webappId:    '7060',
documentId:  '4890',
internalId:  'aed20f492112019de8a63a79cf724290',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16806',
internalId:  '',
customField: '20091113-183514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20081225-105054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20110907-173026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16764',
internalId:  '',
customField: '20081219-212636'
};
webappMappings['7060']=webappMappings['7060-8b62838691cb85feac5661c48f080be5']={
webappId:    '7060',
documentId:  '4827',
internalId:  '8b62838691cb85feac5661c48f080be5',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70201',
internalId:  '',
customField: '20100926-164830'
};
webappMappings['7060']=webappMappings['7060-58a8a53550996468995cadcba32265c3']={
webappId:    '7060',
documentId:  '4869',
internalId:  '58a8a53550996468995cadcba32265c3',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16785',
internalId:  '',
customField: '20081219-212910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16743',
internalId:  '',
customField: '20081219-185022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20081219-212350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20081219-175932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20110508-162005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20081220-001322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20081220-122518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20081210-232950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20081219-231358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4806',
internalId:  '',
customField: '20081219-231433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4827',
internalId:  '',
customField: '20081210-233030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4848',
internalId:  '',
customField: '20081223-194020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4869',
internalId:  '',
customField: '20090204-152712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4890',
internalId:  '',
customField: '20081210-233106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4911',
internalId:  '',
customField: '20081219-232801'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4932',
internalId:  '',
customField: '20081220-122749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4953',
internalId:  '',
customField: '20081219-212223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4974',
internalId:  '',
customField: '20081220-123622'
};
var webAppHostname = 'cgi.wsc.genotec.ch:80';
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2DD9';
var companyName   = 'DAS+FOTOSTUDIO++++Picselle+++++St.+Moritz+++Lucia+Aronsky-Elser';
var htmlTitle	  = 'Picselle+Fotografie';
var metaKeywords  = 'Fotografie%0AFotoatelier%0ASt.+Moritz%0APicselle%0APICS%2BELLE';
var metaContents  = 'Fotografie%0AReportage%0APortrait%0AWerbefotografie%0ASt.+Moritz%0A';
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();
};

