/* [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','4594',jdecode('News'),jdecode(''),'/4594.html','true',[],'',''],
	['PAGE','41012',jdecode('Allright'),jdecode(''),'/41012.html','true',[],'',''],
	['PAGE','59312',jdecode('Energy'),jdecode(''),'/59312.html','true',[],'',''],
	['PAGE','59333',jdecode('Erinsjoy'),jdecode(''),'/59333.html','true',[],'',''],
	['PAGE','4732',jdecode('Pearl'),jdecode(''),'/4732.html','true',[],'',''],
	['PAGE','40613',jdecode('Agility'),jdecode(''),'/40613.html','true',[],'',''],
	['PAGE','40622',jdecode('Vereinsmeisterschaft+VATH'),jdecode(''),'/40622.html','true',[],'',''],
	['PAGE','81912',jdecode('Ausstellungen'),jdecode(''),'/81912.html','true',[],'',''],
	['PAGE','41021',jdecode('Allright%26%23x27%3Bs+Welpen'),jdecode(''),'/41021.html','true',[],'',''],
	['PAGE','40586',jdecode('Fotogalerie'),jdecode(''),'/40586.html','true',[],'',''],
	['PAGE','4678',jdecode('Rasse+Australian+Kelpie'),jdecode(''),'/4678.html','true',[],'',''],
	['PAGE','11012',jdecode('Links'),jdecode(''),'/11012.html','true',[],'',''],
	['PAGE','10554',jdecode('Kontakt+%2F+G%C3%A4stebuch'),jdecode(''),'/10554/index.html','true',[ 
		['PAGE','10555',jdecode('Eintr%C3%A4ge'),jdecode(''),'/10554/10555.html','false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Liveliness';
theSitetree.paletteFamily='BE9A5B';
theSitetree.keyvisualId='3265';
theSitetree.keyvisualName='kv_3265.jpg';
theSitetree.fontsetId='10693';
theSitetree.graphicsetId='10735';
theSitetree.contentColor='BE9A5B';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Liveliness',
				paletteFamily: 	'BE9A5B',
				keyvisualId: 	'3265',
				keyvisualName: 	'kv_3265.jpg',
				fontsetId: 		'10693',
				graphicsetId: 	'10735',
				contentColor: 	'BE9A5B',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'BE9A5B',
				e_color: 		'BCBCBC',
				f_color: 		'737373',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4594',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59312',
internalId:  '',
customField: '20091223-090440'
};
webappMappings['1002']=webappMappings['1002-10554ABW0X0INXXDJ']={
webappId:    '1002',
documentId:  '10554',
internalId:  '10554ABW0X0INXXDJ',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4594',
internalId:  '',
customField: '20100726-113219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41012',
internalId:  '',
customField: '20081212-194213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59333',
internalId:  '',
customField: '20091223-090355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4732',
internalId:  '',
customField: '20091222-201037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40613',
internalId:  '',
customField: '20100727-083034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40622',
internalId:  '',
customField: '20100208-205608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41021',
internalId:  '',
customField: '20100726-104607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40586',
internalId:  '',
customField: '20100705-114150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4678',
internalId:  '',
customField: '20080425-093748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81912',
internalId:  '',
customField: '20091005-212941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11012',
internalId:  '',
customField: '20100524-115948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10554',
internalId:  '',
customField: '20100315-212230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10555',
internalId:  '',
customField: '20060425-212411'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXDJ';
var companyName   = 'Australian+Kelpie+';
var htmlTitle	  = '';
var metaKeywords  = 'Hunderasse%2C+Australian+Kelpie%2C++Agility%2C++Ausstellungen%2C++Kelpiezucht%2C++Verein+Australischer+Treib-+und+H%C3%BCtehunde%2C+Welpen';
var metaContents  = 'Australian+Kelpie+Deckr%C3%BCde+Allright+Energy+Erinsjoy+Welpen';
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();
};
