/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','20501',jdecode('News'),jdecode(''), jdecode('%2F20501.html'), 'true',[],'',''],
	['PAGE','42101',jdecode('Lunkarya'),jdecode(''), jdecode('%2F42101.html'), 'true',[],'',''],
	['PAGE','248101',jdecode('Curly'),jdecode(''), jdecode('%2F248101.html'), 'true',[],'',''],
	['PAGE','87101',jdecode('Peruaner'),jdecode(''), jdecode('%2F87101.html'), 'true',[],'',''],
	['PAGE','144401',jdecode('Liebhabermeeris'),jdecode(''), jdecode('%2F144401.html'), 'true',[],'',''],
	['PAGE','225801',jdecode('Verpaarungen'),jdecode(''), jdecode('%2F225801.html'), 'true',[],'',''],
	['PAGE','70801',jdecode('Meeri-Babys'),jdecode(''), jdecode('%2F70801.html'), 'true',[],'',''],
	['PAGE','58401',jdecode('Abgabetiere'),jdecode(''), jdecode('%2F58401.html'), 'true',[],'',''],
	['PAGE','20522',jdecode('Hunde'),jdecode(''), jdecode('%2F20522.html'), 'true',[],'',''],
	['PAGE','24001',jdecode('Hutsch'),jdecode(''), jdecode('%2F24001.html'), 'true',[],'',''],
	['PAGE','417001',jdecode('Jolie+'),jdecode(''), jdecode('%2F417001.html'), 'true',[],'',''],
	['PAGE','24043',jdecode('Peachy'),jdecode(''), jdecode('%2F24043.html'), 'true',[],'',''],
	['PAGE','318101',jdecode('Shana'),jdecode(''), jdecode('%2F318101%2Findex.html'), 'true',[ 
		['PAGE','39701',jdecode('+Nino+Kater'),jdecode(''), jdecode('%2F318101%2F39701.html'), 'true',[],'','']
	],'',''],
	['PAGE','382301',jdecode('Ouessant+und+Skudden'),jdecode(''), jdecode('%2F382301.html'), 'true',[],'',''],
	['PAGE','20543',jdecode('Unser+Zuhause'),jdecode(''), jdecode('%2F20543.html'), 'true',[],'',''],
	['PAGE','3701',jdecode('Diverse+Bilder'),jdecode(''), jdecode('%2F3701.html'), 'true',[],'',''],
	['PAGE','74401',jdecode('Haltung'),jdecode(''), jdecode('%2F74401.html'), 'true',[],'',''],
	['PAGE','304101',jdecode('Welpenspielgruppe'),jdecode(''), jdecode('%2F304101.html'), 'true',[],'',''],
	['PAGE','68301',jdecode('Kontakt'),jdecode(''), jdecode('%2F68301.html'), 'true',[],'',''],
	['PAGE','5706',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5706.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5701.html'), 'false',[],'',''],
	['PAGE','17701',jdecode('links'),jdecode(''), jdecode('%2F17701.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Citadel';
theSitetree.paletteFamily='414E8C';
theSitetree.keyvisualId='8138';
theSitetree.keyvisualName='kv_8138.jpg';
theSitetree.fontsetId='17013';
theSitetree.graphicsetId='12397';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='414E8C';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Citadel',
				paletteFamily: 	'414E8C',
				keyvisualId: 	'8138',
				keyvisualName: 	'kv_8138.jpg',
				fontsetId: 		'17013',
				graphicsetId: 	'12397',
				contentColor: 	'FFFFFF',
				contentBGColor: '414E8C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5706abw0x0in2rw1']={
webappId:    '1002',
documentId:  '5706',
internalId:  '5706abw0x0in2rw1',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20120222-173844'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20120101-171716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20120222-172556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '248101',
internalId:  '',
customField: '20120222-164533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87101',
internalId:  '',
customField: '20120222-172651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144401',
internalId:  '',
customField: '20120222-172910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '225801',
internalId:  '',
customField: '20120222-173216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70801',
internalId:  '',
customField: '20120222-170721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58401',
internalId:  '',
customField: '20120101-193846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20522',
internalId:  '',
customField: '20080224-131117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20080530-203410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24043',
internalId:  '',
customField: '20100414-200223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20120101-194259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20543',
internalId:  '',
customField: '20071120-203429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20080629-145532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74401',
internalId:  '',
customField: '20110419-201844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68301',
internalId:  '',
customField: '20080102-201831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20070131-210833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20070131-210833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20110523-122804'
};
webappMappings['1501']=webappMappings['1501-32587010']={
webappId:    '1501',
documentId:  '2201',
internalId:  '32587010',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '304101',
internalId:  '',
customField: '20090131-190933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '318101',
internalId:  '',
customField: '20100621-142956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '382301',
internalId:  '',
customField: '20100720-132140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417001',
internalId:  '',
customField: '20120101-195857'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2RW1';
var companyName   = 'Lueg-Meeris';
var htmlTitle	  = 'Huutsch.ch';
var metaKeywords  = '';
var metaContents  = '';
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();
};

