/* [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','40701',jdecode('News'),jdecode(''), jdecode('%2F40701.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Home'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','37201',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F37201.html'), 'true',[],'',''],
	['PAGE','14901',jdecode('Twain'),jdecode(''), jdecode('%2F14901%2Findex.html'), 'true',[ 
		['PAGE','30501',jdecode('Stammbaum-Twain'),jdecode(''), jdecode('%2F14901%2F30501.html'), 'true',[],'',''],
		['PAGE','46101',jdecode('Ausstellungen-Twain'),jdecode(''), jdecode('%2F14901%2F46101.html'), 'true',[],'','']
	],'',''],
	['PAGE','14922',jdecode('Bajouk'),jdecode(''), jdecode('%2F14922%2Findex.html'), 'true',[ 
		['PAGE','30522',jdecode('Stammbaum-Bajouk'),jdecode(''), jdecode('%2F14922%2F30522.html'), 'true',[],'',''],
		['PAGE','46122',jdecode('Ausstellungen-Bajouk'),jdecode(''), jdecode('%2F14922%2F46122.html'), 'true',[],'','']
	],'',''],
	['PAGE','30001',jdecode('Hundesport'),jdecode(''), jdecode('%2F30001%2Findex.html'), 'true',[ 
		['PAGE','78101',jdecode('Schafe-h%C3%BCten'),jdecode(''), jdecode('%2F30001%2F78101.html'), 'true',[],'',''],
		['PAGE','125401',jdecode('Bajouks-Tagebuch'),jdecode(''), jdecode('%2F30001%2F125401.html'), 'true',[],'',''],
		['PAGE','105901',jdecode('Agility-Twain'),jdecode(''), jdecode('%2F30001%2F105901.html'), 'true',[],'',''],
		['PAGE','105922',jdecode('Agility-Bajouk'),jdecode(''), jdecode('%2F30001%2F105922.html'), 'true',[],'','']
	],'',''],
	['PAGE','133901',jdecode('Unsere+Norweger+Katzen'),jdecode(''), jdecode('%2F133901%2Findex.html'), 'true',[ 
		['PAGE','133922',jdecode('Eyleen'),jdecode(''), jdecode('%2F133901%2F133922.html'), 'true',[],'',''],
		['PAGE','133943',jdecode('Finnlay'),jdecode(''), jdecode('%2F133901%2F133943.html'), 'true',[],'','']
	],'',''],
	['PAGE','5252',jdecode('Kontakt'),jdecode(''), jdecode('%2F5252.html'), 'true',[],'',''],
	['PAGE','10422',jdecode('Links'),jdecode(''), jdecode('%2F10422.html'), 'true',[],'',''],
	['PAGE','43001',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F43001.html'), 'true',[],'',''],
	['PAGE','38301',jdecode(''),jdecode(''), jdecode('%2F38301.html'), 'true',[],'',''],
	['PAGE','101801',jdecode('update%2C20.02.2012'),jdecode(''), jdecode('%2F101801.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='666699';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='493';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='a1a1c6';
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: 			'Round',
				paletteFamily: 	'666699',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'493',
				contentColor: 	'666666',
				contentBGColor: 'a1a1c6',
				a_color: 		'a1a1c6',
				b_color: 		'666699',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20110808-150014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14922',
internalId:  '',
customField: '20110629-101104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20100726-162843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20110527-110532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46101',
internalId:  '',
customField: '20110527-110803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20100706-114924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20111022-165033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20110808-145735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30522',
internalId:  '',
customField: '20100709-140735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46122',
internalId:  '',
customField: '20110927-155635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20100709-155752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37201',
internalId:  '',
customField: '20120110-182219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20100702-145024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40701',
internalId:  '',
customField: '20120220-111845'
};
webappMappings['1002']=webappMappings['1002-43001abw330ine6md']={
webappId:    '1002',
documentId:  '43001',
internalId:  '43001abw330ine6md',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101801',
internalId:  '',
customField: '20110520-095414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78101',
internalId:  '',
customField: '20110922-130406'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '40701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105901',
internalId:  '',
customField: '20110610-165913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105922',
internalId:  '',
customField: '20110610-165442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125401',
internalId:  '',
customField: '20111022-164657'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '133901',
internalId:  '-',
customField: '20120220-122809'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '133922',
internalId:  '-',
customField: '20120220-121403'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '133943',
internalId:  '-',
customField: '20120220-121403'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INE6MD';
var companyName   = 'Beardes-of-new-well';
var htmlTitle	  = 'beardesofnewwell';
var metaKeywords  = 'Hundeschule%2CBearded+Collie%2C+Collie%2C+Deckr%C3%BCden%2CBeardes%2CNeubrunn%2CTwain%2CBajouk%2CAgility%2CSchafeh%C3%BCtten%2CHundefutter%2CHundesport%2CHundezucht%2CHunde%2CHundeartikel%2CBeardies%2CTurbenthal%2CHundesportartikel%2CSchweiz%2Cbeardes-of-new-well.ch%2Cbeardesofnewwell%2CAusstellung%2CSmoky%2CShaggy%2CScooter%2CEyleen%2CAlfi';
var metaContents  = 'Deckr%C3%BCden%2CBearded+Collie%2CBeardes%2CHunde%2CSchweiz%2Cbeardes-of-new-well%2Cbeardesofnewwell%2CAusstellungen';
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();
};

