/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','124801',jdecode('Hans+Signer+Ausstellung'),jdecode(''), jdecode('%2F124801.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('Foto+Gallery'),jdecode(''), jdecode('%2F11501.html'), 'true',[],'',''],
	['PAGE','4601',jdecode('Online-Shop'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','31222',jdecode('Leinwand+Prints'),jdecode(''), jdecode('%2F31222.html'), 'true',[],'',''],
	['PAGE','23301',jdecode('Colorierte+Fotos'),jdecode(''), jdecode('%2F23301.html'), 'true',[],'',''],
	['PAGE','79001',jdecode('Acrylglas+'),jdecode(''), jdecode('%2F79001.html'), 'true',[],'',''],
	['PAGE','29901',jdecode('Fotobuch'),jdecode(''), jdecode('%2F29901.html'), 'true',[],'',''],
	['PAGE','89701',jdecode('Kalender'),jdecode(''), jdecode('%2F89701.html'), 'true',[],'',''],
	['PAGE','31201',jdecode('Poster%2FGrossformate'),jdecode(''), jdecode('%2F31201.html'), 'true',[],'',''],
	['PAGE','110001',jdecode('Art+Portrait'),jdecode(''), jdecode('%2F110001.html'), 'true',[],'',''],
	['PAGE','80101',jdecode('Gutscheine'),jdecode(''), jdecode('%2F80101.html'), 'true',[],'',''],
	['PAGE','1916',jdecode('Kontakt'),jdecode(''), jdecode('%2F1916.html'), 'true',[],'',''],
	['PAGE','2564',jdecode('Impressum'),jdecode(''), jdecode('%2F2564.html'), 'true',[],'',''],
	['PAGE','1601',jdecode('Wer+bin+ich'),jdecode(''), jdecode('%2F1601.html'), 'true',[],'',''],
	['PAGE','1811',jdecode('Ladenlokal'),jdecode(''), jdecode('%2F1811%2Findex.html'), 'true',[ 
		['PAGE','10701',jdecode('Lageplan'),jdecode(''), jdecode('%2F1811%2F10701.html'), 'true',[],'',''],
		['PAGE','10722',jdecode('Oeffnungszeiten'),jdecode(''), jdecode('%2F1811%2F10722.html'), 'true',[],'','']
	],'',''],
	['PAGE','21301',jdecode('AGB%26%23x27%3Bs'),jdecode(''), jdecode('%2F21301.html'), 'true',[],'',''],
	['PAGE','1622',jdecode('Produkte+Infos'),jdecode(''), jdecode('%2F1622.html'), 'true',[],'',''],
	['PAGE','43701',jdecode('Presse'),jdecode(''), jdecode('%2F43701.html'), 'true',[],'',''],
	['PAGE','44501',jdecode('Links'),jdecode(''), jdecode('%2F44501.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Elegant';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32899';
theSitetree.graphicsetId='13971';
theSitetree.contentColor='cab397';
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: 			'Elegant',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32899',
				graphicsetId: 	'13971',
				contentColor: 	'cab397',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['4001']=webappMappings['4001-20058634']={
webappId:    '4001',
documentId:  '4601',
internalId:  '20058634',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-20201459']={
webappId:    '1501',
documentId:  '501',
internalId:  '20201459',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-727']={
webappId:    '7008',
documentId:  '1916',
internalId:  '727',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120124-160534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20110609-143625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1622',
internalId:  '',
customField: '20090219-165429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100806-134907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20090721-163723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20080429-162656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31222',
internalId:  '',
customField: '20111220-135031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29901',
internalId:  '',
customField: '20110414-124426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1916',
internalId:  '',
customField: '20080204-132331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2564',
internalId:  '',
customField: '20110219-141448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1811',
internalId:  '',
customField: '20110405-133939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20110215-133516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20120124-160721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20090407-143935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20110209-151524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43701',
internalId:  '',
customField: '20080911-144825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44501',
internalId:  '',
customField: '20110628-142350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79001',
internalId:  '',
customField: '20120124-161009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80101',
internalId:  '',
customField: '20110219-141318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89701',
internalId:  '',
customField: '20120103-140518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110001',
internalId:  '',
customField: '20110609-172456'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '124801',
internalId:  '-',
customField: '20111230-174250'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INEKUE';
var companyName   = 'Z%C3%9CRICHFOTO.CH';
var htmlTitle	  = 'Z%C3%9CRICHFOTO.CH';
var metaKeywords  = 'Z%C3%BCrichfoto.ch%2C+Z%C3%BCrich+Foto%2C+schwarz+weiss+Fotos%2C+Altstadt%2C+Z%C3%BCrichsee%2C+Online+Shop%2C+M%C3%BCllestein+Rolf%2C+Kunst%2C+Photograpy%2C+Bilder%2C+Grossm%C3%BCnster%2C+St.Peter%2C+Fraum%C3%BCnster%2C+Foto+von+Z%C3%BCrich%2C+Fotos%2C+Kunstfotos%2C+Niederdorf%2C+Foto+von+Zurich%2C+Foto+von+Zuerich';
var metaContents  = 'Z%C3%BCrichfoto.ch%2C+Z%C3%BCrich+Foto%2C+schwarz+weiss+Fotos%2C+Altstadt%2C+Z%C3%BCrichsee%2C+Online+Shop%2C+M%C3%BCllestein+Rolf%2C+Kunst%2C+Photograpy%2C+Bilder%2C+Grossm%C3%BCnster%2C+St.Peter%2C+Fraum%C3%BCnster%2C+Foto+von+Z%C3%BCrich%2C+Fotos%2C+Kunstfotos%2C+Niederdorf%2C+Foto+von+Zurich%2C+Foto+von+Zuerich';
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();
};

