/* [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','1413',jdecode('Home'),jdecode(''),'/1413.html','true',[],'',''],
	['PAGE','1470',jdecode('Unternehmen+%2F+Kontakt'),jdecode(''),'/1470.html','true',[],'',''],
	['PAGE','1497',jdecode('Unsere+Hundeboxen'),jdecode(''),'/1497/index.html','true',[ 
		['PAGE','1578',jdecode('Standard+Ausf%C3%BChrung'),jdecode(''),'/1497/1578.html','true',[],'',''],
		['PAGE','33313',jdecode('Diensthunde+Ausf%C3%BChrung'),jdecode(''),'/1497/33313.html','true',[],'','']
	],'',''],
	['PAGE','2901',jdecode('Absperrgitter+%2F+Rampen'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','5201',jdecode('Fotogalerie'),jdecode(''),'/5201.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Canvas';
theSitetree.paletteFamily='FFB11A';
theSitetree.keyvisualId='3702';
theSitetree.keyvisualName='kv_3702.jpg';
theSitetree.fontsetId='10577';
theSitetree.graphicsetId='10936';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCF6E5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Canvas',
				paletteFamily: 	'FFB11A',
				keyvisualId: 	'3702',
				keyvisualName: 	'kv_3702.jpg',
				fontsetId: 		'10577',
				graphicsetId: 	'10936',
				contentColor: 	'000000',
				contentBGColor: 'FCF6E5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AF7A13',
				e_color: 		'AF7A13',
				f_color: 		'AF7A13',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1413',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1413',
internalId:  '',
customField: '20080920-092554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1497',
internalId:  '',
customField: '20090502-085138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1578',
internalId:  '',
customField: '20100105-165626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33313',
internalId:  '',
customField: '20071222-124335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100105-173159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1470',
internalId:  '',
customField: '20080920-092643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20080920-092524'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN2BIX';
var companyName   = 'Bienz+Hundeboxen';
var htmlTitle	  = 'Hundebox';
var metaKeywords  = 'Hundebox%2C+Hundeboxen%2C+Alu-Box%2C+Alubox%2C+Aluhundebox%2C+Alu-Hundebox%2C+Alu-Hundeboxen%2C+Aluhundeboxen%2C+Aluminium-Hundebox%2C+Absperrgitter%2C+Doppelbox%2C+Doppelhundebox%2C+Doppel-Alu-Hundebox%2C+Doppel-Hundebox%2C+Auto-Hundeboxen%2C+Auto-Hunde-Boxen%2C+Autohundeboxen%2C+Hunde-Boxen%2C+Hundeboxen%2C+Doppel-Hundeboxen%2C+Hunderampen%2C+Rampe%2C+Einstieghilfe%2C+portable%2C+Absperrgitter%2CHund%2C+Hunde%2C+Welpen%2C+Hundetransport%2C+Bienz%2C+Unter%C3%A4geri%2C+Koni+Bienz%2C+Massboxen%2C+Hundegitter%2C+Zug%2C+Auto%2C+Hund%2C+Hunde%2C+Hundeboxen+f%C3%BCrs+Auto%2C+Vermietung%2C+zu+vermieten+Hunderampen%2C+Rampen%2C+Polizei%2C+massiv%2C+Sicherheitsdienst%2C+Diensthund%2C+Schutzhund%2C+Sporthund';
var metaContents  = 'Die+Web-Seite+zeigt+unser+Hundeboxen+Sortiment+aus+Aluminium.+Wir+produzieren+Alu-Hundeboxen%2C+Doppelboxen+aus+Alu+und+nat%C3%BCrlich+auch+Massboxen+und+Absperrgitter.+%28Wir+bauen+Hundebox%2C+Hundeboxen%2C+Alu-Box%2C+Alubox%2C+Aluhundebox%2C+Alu-Hundebox%2C+Alu-Hundeboxen%2C+Aluhundeboxen%2C+Aluminium-Hundebox%2C+Absperrgitter%2C+Doppelbox%2C+Doppelhundebox%2C+Doppel-Alu-Hundebox%2C+Doppel-Hundebox%2C+Auto-Hundeboxen%2C+Auto-Hunde-Boxen%2C+Autohundeboxen%2C+Hunde-Boxen%2C+Hundeboxen%2C+Doppel-Hundeboxen%2C+Hundegitter+f%C3%BCr+Hund%2C+Hunde%2C+Welpen+%29.+Neu+im+Sortiment+finden+Sie+Rampen+und+das+portable+Asperrgitter.+Wir+bauen+auch+massive+Hundeboxen+aus+Alu+f%C3%BCr+Polizei+und+Sicherheitsdienst%2C+Schutzhunde+und+Diensthunde.';
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();
};
