/* [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','4480',jdecode('Home'),jdecode(''), jdecode('%2F4480.html'), 'true',[],'',''],
	['PAGE','18101',jdecode('Beschriftungen'),jdecode(''), jdecode('%2F18101.html'), 'true',[],'',''],
	['PAGE','4564',jdecode('Gravuren+und+Spezielles'),jdecode(''), jdecode('%2F4564%2Findex.html'), 'true',[ 
		['PAGE','4645',jdecode('G%C3%BCrtelschnallen'),jdecode(''), jdecode('%2F4564%2F4645.html'), 'true',[],'',''],
		['PAGE','4591',jdecode('Gravuren'),jdecode(''), jdecode('%2F4564%2F4591.html'), 'true',[],'',''],
		['PAGE','4618',jdecode('Acessoires+%26+Spezielles'),jdecode(''), jdecode('%2F4564%2F4618.html'), 'true',[],'','']
	],'',''],
	['PAGE','18122',jdecode('Aktionen+und+%25'),jdecode(''), jdecode('%2F18122.html'), 'true',[],'',''],
	['PAGE','4699',jdecode('Infos+und+Adresse'),jdecode(''), jdecode('%2F4699.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4D4CD2';
theSitetree.keyvisualId='572';
theSitetree.keyvisualName='zeit.jpg';
theSitetree.fontsetId='124';
theSitetree.graphicsetId='140';
theSitetree.contentColor='7794FB';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'4D4CD2',
				keyvisualId: 	'572',
				keyvisualName: 	'zeit.jpg',
				fontsetId: 		'124',
				graphicsetId: 	'140',
				contentColor: 	'7794FB',
				contentBGColor: '000000',
				a_color: 		'4D4CD2',
				b_color: 		'7794F8',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4480',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4618',
internalId:  '',
customField: '20110525-132324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4564',
internalId:  '',
customField: '20091009-171449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4591',
internalId:  '',
customField: '20110102-133136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20110525-132614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4480',
internalId:  '',
customField: '20110401-165705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4699',
internalId:  '',
customField: '20100217-112245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4645',
internalId:  '',
customField: '20110525-132148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18122',
internalId:  '',
customField: '20110102-133940'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN214H';
var companyName   = 'Moses+Unikat+Anfertigungen';
var htmlTitle	  = 'Moses+Unikatanfertigung+Nichts+ist+unm%C3%B6glich%21%21';
var metaKeywords  = 'Unikate%2C+Kerzenstaender%2C+Logo%2C+Armbrust%2C+Sarg%2C+Bar%2C+Foltetrgeraete%2C+mittelalter%2C+Autoteile%2C+design%2C+renovation%2C+restaurierung%2C+metall%2C+holz%2C+einzelanfertigung%2C+raritaet%2C+barrique%2C+fass%2C+faesser%2C+moses%2C+mueller%2C+speziell%2C+bad+taste%2C+alles+moeglich%2C+moebel%2C+wohnen%2C+wohnacessoires%2C+metall%2C+athik%2C+teuflisch%2C+hoellisch%2C+satan%2C+leichtbau%2C+spezialitaet%2C++restaurantdekoration%2C+restaurant%2C+renovation%2C+sarg%2C+autoteile%2C+kurios%2C+kuriositaet%2C+barrique%2C+stuehle%2C+tische%2C+altare%2C+anfertigung%2C+speziell%2C+heimwerker%2C+notdienst%2C+Guertelschnallen%2C+Gravuren+aller+Art%2C+Weihnachten%2C+Wheinachtsgeschenk%2C+Geschenk%2C+Geschenke%2C+Satanisch+gut%2C+Bucklets%2C+Spezial%2C+Speziel%2C+Chromstahl%2C+Gold%2C+silber%2C+Schutz%2C+Amulette%2C%0D%0A%0D%0AWandtattos%2C+Sandstrahlen%2C+Folien%2C+Schablonen%2C+Sandstrahlen%2C+dienstleistungen%2C+aller%2C+art%2C';
var metaContents  = 'Unikate%2C+Kerzenstaender%2C+Logo%2C+Armbrust%2C+Sarg%2C+Bar%2C+Foltetrgeraete%2C+mittelalter%2C+Autoteile%2C+design%2C+renovation%2C+restaurierung%2C+metall%2C+holz%2C+einzelanfertigung%2C+raritaet%2C+barrique+fass%2C+faesser%2C+moses%2C+mueller%2C+speziell%2C+bad+taste%2C+alles+moeglich%2C+moebel%2C++wohnen%2C+wohnacessoires%2C+metall%2C+athik%2C+teuflisch%2C+hoellisch%2C+satan%2C+leichtbau%2C+spezialitaet%2C+badmoses%2C+restaurantdekoration%2C+restaurant%2C+renovation%2C+autoteile%2C+kurios%2C+kuriositaet%2C+barrique%2C+stuehle%2C+tische%2C+altare%2C+anfertigung%2C+speziell%2C+heimwerker%2C++Guertelschnallen%2C+Gravuren+aller+Art%2C+Weihnachten%2C+Wheinachtsgeschenk%2C+Geschenk%2C+Geschenke%2C+Satanisch+gut%2C+Bucklets%2C+Spezial%2C+Speziel%2C+Chromstahl%2C+Gold%2C+silber%2C+Schutz%2C++Amulette%2C%0D%0A%0D%0AWandtattos%2C+Sandstrahlen%2C+Folien%2C+Schablonen%2C+Sandstrahlen%2C+dienstleistungen+aller+art%2C';
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();
};

