/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','652',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','673',jdecode('Unsere+Philosophie'),jdecode(''),'/652/673.html','true',[],'','']
	],'',''],
	['PAGE','694',jdecode('Produkte%2C+Leistungen'),jdecode(''),'/694.html','true',[],'',''],
	['PAGE','715',jdecode('Aktuelles'),jdecode(''),'/715/index.html','true',[ 
		['PAGE','736',jdecode('Referenzen'),jdecode(''),'/715/736.html','true',[],'','']
	],'',''],
	['PAGE','757',jdecode('Kontakt'),jdecode(''),'/757.html','true',[],'',''],
	['PAGE','778',jdecode('Impressum'),jdecode(''),'/778.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2446';
theSitetree.keyvisualName='business.jpg';
theSitetree.fontsetId='408';
theSitetree.graphicsetId='459';
theSitetree.contentColor='2F325F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2446',
				keyvisualName: 	'business.jpg',
				fontsetId: 		'408',
				graphicsetId: 	'459',
				contentColor: 	'2F325F',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20110123-143045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20110123-143011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20110123-143119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20080912-220130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20090315-203644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20090621-145242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20080917-214757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20091230-101436'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INED9W';
var companyName   = 'Fotobuch-Werk%21statt++-+lassen+Sie+UNS+ran%21';
var htmlTitle	  = 'www.fotobuch-werkstatt.ch.+Wir+gestalten+Ihr+Fotobuch+im+exklusiven+Stil.+Professionell+und+individuell.';
var metaKeywords  = 'Fotobuch%2C+Fotobook%2C+erstellen%2C+exklusiv%2C+individuell%2C+Design%2C+gestalten%2C+layout%2C+Text%2C+Scan%2C+Preis%2C+Format%2C+Foto%2C+Gestaltungswunsch%2C+Werkstatt%2C+erstellen%2C+Fotobuch-Werkstatt%2C+Offerte%2C+texten%2C+fotografieren%2C+Bild%2C+sch%C3%B6n%2C+speziell%2C+Produkt%2C+Leistung%2C+Gestaltungsbeispiel';
var metaContents  = 'www.fotobuch-werkstatt.ch.+Sie+fangen+Ihre+sch%C3%B6nsten+Momente+auf+Fotos+ein%2C++wir+machen+daraus+ein+professionelles+Fotobuch+im+exklusiven+Stil.+Sie+h%C3%A4tten+gerne+Ihr+eigenes+Fotobuch%2C+haben+aber+keine+Zeit+daf%C3%BCr%2C+oder+trauen+sich+einfach+nicht+ran%3F+Dann+lassen+Sie+doch+einfach+UNS+ran%21Selbstverst%C3%A4ndlich+scanen+wir+auch+Ihre+Papierabz%C3%BCge+ein%2C+falls+Sie+noch+keine+digitalen+Fotografien+haben.+Wir+freuen+uns%2C+dass+Sie+unsere+Homepage+entdeckt+haben%21+Gerne+versorgen+wir+Sie+mit+allen+Informationen+rund+um+unsere+Angebote+im+Bereich+Fotobuch-Erstellung+in+Ihrem+Auftrag.+Einige+Preis-+und+Gestaltungsbeispiele+finden+Sie+unter+der+Rubrik+Produkte%2C+Leistungen.';
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();
};

