/* [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(''),'/2001.html','true',[],'',''],
	['PAGE','31801',jdecode('Picselle+Eye+of+St.+Moritz'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','4201',jdecode('%C3%9Cber+mich'),jdecode(''),'/4201.html','true',[],'',''],
	['PAGE','4222',jdecode('Fotos'),jdecode(''),'/4222.html','true',[],'',''],
	['PAGE','4701',jdecode('Werbung'),jdecode(''),'/4701/index.html','true',[ 
		['PAGE','4722',jdecode('Schmuck'),jdecode(''),'/4701/4722.html','true',[],'',''],
		['PAGE','4743',jdecode('Technik'),jdecode(''),'/4701/4743.html','true',[],'',''],
		['PAGE','4764',jdecode('Diverse'),jdecode(''),'/4701/4764.html','false',[],'','']
	],'',''],
	['PAGE','4785',jdecode('Firmenreportage'),jdecode(''),'/4785.html','true',[],'',''],
	['PAGE','4806',jdecode('People'),jdecode(''),'/4806/index.html','true',[ 
		['PAGE','4827',jdecode('Kinder'),jdecode(''),'/4806/4827.html','true',[],'',''],
		['PAGE','4848',jdecode('Studio'),jdecode(''),'/4806/4848.html','true',[],'',''],
		['PAGE','4869',jdecode('MusikerInnen'),jdecode(''),'/4806/4869.html','true',[],'',''],
		['PAGE','4890',jdecode('Theater'),jdecode(''),'/4806/4890.html','true',[],'','']
	],'',''],
	['PAGE','4911',jdecode('Editorial'),jdecode(''),'/4911/index.html','true',[ 
		['PAGE','4932',jdecode('Landschaft'),jdecode(''),'/4911/4932.html','true',[],'',''],
		['PAGE','4953',jdecode('Schweizer+Illustrierte'),jdecode(''),'/4911/4953.html','true',[],'',''],
		['PAGE','16701',jdecode('GEO'),jdecode(''),'/4911/16701.html','true',[],'',''],
		['PAGE','16722',jdecode('Schweizer+Woche'),jdecode(''),'/4911/16722.html','true',[],'',''],
		['PAGE','16743',jdecode('Schweizer+Familie'),jdecode(''),'/4911/16743.html','true',[],'',''],
		['PAGE','16764',jdecode('Revue+Schweiz'),jdecode(''),'/4911/16764.html','true',[],'',''],
		['PAGE','16785',jdecode('Ballett'),jdecode(''),'/4911/16785.html','true',[],'',''],
		['PAGE','16806',jdecode('Diverse'),jdecode(''),'/4911/16806.html','true',[],'',''],
		['PAGE','4974',jdecode('K%C3%BCnstlerInnen'),jdecode(''),'/4911/4974.html','true',[],'','']
	],'',''],
	['PAGE','4243',jdecode('G%C3%A4stebuch'),jdecode(''),'/4243.html','true',[],'',''],
	['PAGE','9201',jdecode('Lageplan'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','4264',jdecode('Kontakt'),jdecode(''),'/4264.html','true',[],'','']];
var siteelementCount=27;
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 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: '20100717-194331'
};
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: '20100705-084701'
};
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['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: '20081217-230747'
};
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 canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2DD9';
var companyName   = 'DAS+FOTOSTUDIO++++Picselle+++++St.+Moritz+++Lucia+Aronsky-Elser';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
