/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','4201',jdecode('Mineralstein+-+Ketten'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','2022',jdecode('Bilder'),jdecode(''), jdecode('%2F2022.html'), 'true',[],'',''],
	['PAGE','2001',jdecode('Tierkommunikation'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','20001',jdecode('%22d+Wundert%C3%BCte%22'),jdecode(''), jdecode('%2F20001.html'), 'true',[],'',''],
	['PAGE','2043',jdecode('Kontakt'),jdecode(''), jdecode('%2F2043.html'), 'true',[],'',''],
	['PAGE','11601',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'',''],
	['PAGE','14901',jdecode('Links'),jdecode(''), jdecode('%2F14901.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Fantasy';
theSitetree.paletteFamily='515C92';
theSitetree.keyvisualId='9902';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17882';
theSitetree.graphicsetId='13067';
theSitetree.contentColor='FFFFFF';
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: 'true',
				hasCompanyname: 'false',
				name: 			'Fantasy',
				paletteFamily: 	'515C92',
				keyvisualId: 	'9902',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17882',
				graphicsetId: 	'13067',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				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:  '1901',
internalId:  '',
customField: '20120122-194602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20110724-142505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2022',
internalId:  '',
customField: '20120122-202135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2043',
internalId:  '',
customField: '20120122-194744'
};
webappMappings['7008']=webappMappings['7008-8569']={
webappId:    '7008',
documentId:  '2043',
internalId:  '8569',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20110828-231316'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-11601abw330ineyot']={
webappId:    '1002',
documentId:  '11601',
internalId:  '11601abw330ineyot',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100205-230246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20110406-202041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20111204-203340'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEYOT';
var companyName   = 'F+E+E+N+S+T+E+I+N+E';
var htmlTitle	  = '';
var metaKeywords  = 'Mineralsteine%2C+Steinketten%2C+Ketten%2C+Steine%2C+Mineralien%2C+Hilfe%2C+Psychisch%2C+Physisch%2C+Schmuck%2C+Hildegard+von+Bingen%2C+Indianer%2C+Horoskop%2C+Amethyst%2C+Bergkristall%2C+Turmalin%2C+Obsidian%2C+Rosenquarz%2C+Onyx%2C+Aventurin%2C+Sonnenstein%2C+Calzedon%2C+Malachit%2C+T%C3%BCrkis%2C+Lapislazuli%2C+Larimar%2C+Jaspis%2C+Rubin%2C+Saphir%2C+Rhodonit%2C+H%C3%A4matit%2C+Citrin%2C+Bernstein%2C+Falkenauge%2C+Tigerauge%2C+Granat%2C+Labradorit%2C+Koralle%2C+Iolith%2C+Serafinit%2C+Heliotrop%2C+Perlmutt%2C+Pyrit%2C+Sodalith%2C+Perle%2C+Rauchquarz%2C+Peridot%2C+Rutilquarz%2C+Achat%2C+Amazonit%2C+Apatit%2C+Aquamarin%2C+Auzurit%2C+Calcit%2C+Fluorit%2C+Chrysopras%2C+Chrysokoll%2C+Diamant%2C+Jade%2C+Dolomit%2C+Opal%2C+Gagat%2C+Gold%2C+Silber%2C+Howlith%2C+Quarz%2C+Kunzit%2C+Karneol%2C+Magnetit%2C+Mondstein%2C+Mookait%2C+Moosachat%2C+Sardonix%2C+Smaragd%2C+Spinell%2C+Sugilith%2C+Tigereisen%2C+Topas%2C+Anh%C3%A4nger%2C+Kristalle%2C+Kugeln%2C+Gl%C3%BCcksbringer%2C+Zoisit%2C+Scheiben%2C+Handschmeichler%2C+Beryll%2C+Feldspat%2C+Korund%2C+Metall%2C+Chakra%2C+Schneequarz%2C+Milchstein%2C+Kriens%2C+Obernau%2C+Luzern%2C+Schweiz%2C+Armband';
var metaContents  = 'Mineralsteine%2C+Steinketten%2C+Ketten%2C+Steine%2C+Mineralien%2C+Hilfe%2C+Psychisch%2C+Physisch%2C+Schmuck%2C+Hildegard+von+Bingen%2C+Indianer%2C+Horoskop%2C+Amethyst%2C+Bergkristall%2C+Turmalin%2C+Obsidian%2C+Rosenquarz%2C+Onyx%2C+Aventurin%2C+Sonnenstein%2C+Calzedon%2C+Malachit%2C+T%C3%BCrkis%2C+Lapislazuli%2C+Larimar%2C+Jaspis%2C+Rubin%2C+Saphir%2C+Rhodonit%2C+H%C3%A4matit%2C+Citrin%2C+Bernstein%2C+Falkenauge%2C+Tigerauge%2C+Granat%2C+Labradorit%2C+Koralle%2C+Iolith%2C+Serafinit%2C+Heliotrop%2C+Perlmutt%2C+Pyrit%2C+Sodalith%2C+Perle%2C+Rauchquarz%2C+Peridot%2C+Rutilquarz%2C+Achat%2C+Amazonit%2C+Apatit%2C+Aquamarin%2C+Auzurit%2C+Calcit%2C+Fluorit%2C+Chrysopras%2C+Chrysokoll%2C+Diamant%2C+Jade%2C+Dolomit%2C+Opal%2C+Gagat%2C+Gold%2C+Silber%2C+Howlith%2C+Quarz%2C+Kunzit%2C+Karneol%2C+Magnetit%2C+Mondstein%2C+Mookait%2C+Moosachat%2C+Sardonix%2C+Smaragd%2C+Spinell%2C+Sugilith%2C+Tigereisen%2C+Topas%2C+Anh%C3%A4nger%2C+Kristalle%2C+Kugeln%2C+Gl%C3%BCcksbringer%2C+Zoisit%2C+Scheiben%2C+Handschmeichler%2C+Beryll%2C+Feldspat%2C+Korund%2C+Metall%2C+Chakra%2C+Schneequarz%2C+Milchstein%2C+Kriens%2C+Obernau%2C+Luzern%2C+Schweiz%2C+Armband';
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();
};

