/* [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','4520',jdecode('Home'),jdecode(''),'/4520.html','true',[],'',''],
	['PAGE','37964',jdecode('Angebote'),jdecode(''),'/37964.html','true',[],'',''],
	['PAGE','5209',jdecode('Kontakt'),jdecode(''),'/5209.html','true',[],'',''],
	['PAGE','38601',jdecode('Jobs'),jdecode(''),'/38601.html','true',[],'',''],
	['PAGE','46094',jdecode('G%C3%A4stebuch'),jdecode(''),'/46094/index.html','true',[ 
		['PAGE','46093',jdecode('Eintr%C3%A4ge'),jdecode(''),'/46094/46093.html','false',[],'','']
	],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Abstract';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10551';
theSitetree.graphicsetId='10577';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Abstract',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10551',
				graphicsetId: 	'10577',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				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:  '4520',
internalId:  '',
customField: '20100817-122613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37964',
internalId:  '',
customField: '20090103-143430'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-46094abw0x0inx2w9']={
webappId:    '1002',
documentId:  '46094',
internalId:  '46094abw0x0inx2w9',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5209',
internalId:  '',
customField: '20090303-135018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38601',
internalId:  '',
customField: '20090103-142751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46094',
internalId:  '',
customField: '20080101-010820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46093',
internalId:  '',
customField: '20080101-010453'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2W9';
var companyName   = 'namanam.com';
var htmlTitle	  = '';
var metaKeywords  = 'Bilder%2C+Schmuck+%3B+Ring+%3B+Ueli+Eigenheer%3B+Fingering+%3B+Silberring+%3BMechaniker%3BWG+Zimmer+CNC+%3BWerkzeugmacher%3B+Freundschaftsring+%3B+Individueller+%3B+Schmuckring%2C+Art+%3B+Silverring+%3B+bag+%3B+kaufen%3B+online+bestellen%3B+farbiger%3B+Unikate%3B+machen%3B+lassen%3B+moderner%3B++Kunst%3B+Edelsilberschmuck%3B+Anneau%3B+Bague%3B+argent%3B+%3F%3F%3F%3F%3F%3F%3F+%3F%3F%3F%3F%3F%3F%3BVisitenkarten%3B+Schnittdaten%3Brent+a+room%3B+Conditions+de+coupe%3B+cutting+Data%3B+Parametri+di+Lavorazione%3BKlemmbriden%3BSpannbriden%3BSpannbriden%3Bwebseiten+g%C3%BCnstig%3B+webseite%3B+meine+webseite%3Bgratis%3B+webseite%3Bwebside+';
var metaContents  = 'Schmuckringe%2CSilberringe%3BEdelsilberschmuck%3B+Silberringe+%3B+Silberinge%3BWG+Zimmer%3B+in+Bern%3BCNC%3Brent+a+room+in+switzerland%3B+Mechaniker%3Bsuche%3B+Arbeit%3BGoldschmied%3BWerkzeugmacher%3BMusik%3BVisitenkarten%3B+Schnittdaten%3B+Conditions+de+coupe%3B+cutting+Data%3B+Parametri+di+Lavorazione%3BJahrhundert+Verbrechen%3B+Otto+Ramsebner%3BBundesgericht%3B+Walter+St%3Fhli%3B+Remp%3B+Bandgenossenschaft%3B+WSM+STaehli%3B+PM+Performance%3BSpannbriden%3BKlemmbriden%3BGratis%3B+Webseiten%3Bwebside%3B+for%3Bfree%3BWebseiten%3B+g%C3%BCnstig';
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();
};
