/* [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','1284',jdecode('Home'),jdecode(''),'/1284.html','true',[],'',''],
	['PAGE','13062',jdecode('Angebote'),jdecode(''),'/13062/index.html','true',[ 
		['PAGE','13071',jdecode('Puppen+-+B%C3%A4renklinik'),jdecode(''),'/13062/13071.html','true',[],'',''],
		['PAGE','13080',jdecode('Repair+Service'),jdecode(''),'/13062/13080.html','true',[],'',''],
		['PAGE','13089',jdecode('Einrahmungen-Vergolderei'),jdecode(''),'/13062/13089.html','true',[],'','']
	],'',''],
	['PAGE','1341',jdecode('%C3%96ffnungszeiten'),jdecode(''),'/1341.html','true',[],'',''],
	['PAGE','1395',jdecode('Kontakt'),jdecode(''),'/1395/index.html','true',[ 
		['PAGE','1422',jdecode('Adresse%2C+Telefon'),jdecode(''),'/1395/1422.html','true',[],'','']
	],'',''],
	['PAGE','2379',jdecode('Interessante+Links'),jdecode(''),'/2379.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Art';
theSitetree.paletteFamily='FFDEAD';
theSitetree.keyvisualId='1806';
theSitetree.keyvisualName='schlafzimmer.jpg';
theSitetree.fontsetId='283';
theSitetree.graphicsetId='351';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFDEAD';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Art',
				paletteFamily: 	'FFDEAD',
				keyvisualId: 	'1806',
				keyvisualName: 	'schlafzimmer.jpg',
				fontsetId: 		'283',
				graphicsetId: 	'351',
				contentColor: 	'000000',
				contentBGColor: 'FFDEAD',
				a_color: 		'FFDEAD',
				b_color: 		'990000',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1284',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1284',
internalId:  '',
customField: '20080312-195408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13080',
internalId:  '',
customField: '20090908-193345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13062',
internalId:  '',
customField: '20080112-131407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13071',
internalId:  '',
customField: '20080113-140258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13089',
internalId:  '',
customField: '20080111-131137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1341',
internalId:  '',
customField: '20021111-110253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1395',
internalId:  '',
customField: '20060320-123221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1422',
internalId:  '',
customField: '20041127-214234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2379',
internalId:  '',
customField: '20080113-131956'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2G3';
var companyName   = 'PUPPEN-B%C3%84RENKLINIK+%26+Repair+Services+';
var htmlTitle	  = 'www.puppenklinikum.com';
var metaKeywords  = 'Art-Shop+Weinfelden%2C+Kunst%2C+K%C3%BCnstlerzubeh%C3%B6r%2C+Puppen-B%C3%A4ren%2C+Puppenklinik+Schweiz%2C+Restaurationen%2C+Reparaturen%2C+Zifferbl%C3%A4tter%2C+Weinfelden%2C+Hostettler+Bruno%2C+Spielzeug%2C+Spielwaren%2C+Kleinm%C3%B6bel%2C+Porzellan%2C+Celluloid%2C+Drechseln%2C+Drehen%2C+Fr%C3%A4sen%2C+Bilder%2C+Vergoldungen%2C+Rahmen%2C+Einrahmungen%2C+Sonderanfertigungen%2C+Einrahmungsservice%2C+Nr.+1+in+der+Schweiz%2C+Schweizer+Qualit%C3%A4t%2C+g%C3%BCnstige+Preise%2C+mechanische+Spielsachen%2C+Wurlitzer%2C+Jukeboxen%2C+Repair+Service';
var metaContents  = 'Willkommen+in+Weinfelden%2C+Puppenklinik%2C+Puppen-+B%C3%A4renklinik%2C+Einrahmungen%2C+Vergolderei%2C+Vergoldungen%2CKunst%2C+K%C3%BCnstlerzubeh%C3%B6r%2C+Puppenklinikum+Schweiz%2C+Alles+rund+um+Puppen+und+B%C3%A4ren%2C+Restaurationen%2C+Reparaturen%2C+B%C3%A4renklinik%2C+Art-Shop%2C+Wurlitzer%2C+Jukebox%2C+Musikboxen%2C+W1700%2C+Repair+Service+';
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();
};
