/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('News'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('About+us'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','594',jdecode('About+the+breed'),jdecode(''),'/594/index.html','true',[ 
		['PAGE','24001',jdecode('FCI-Standard+N%C2%B0+193+%2F22.+11.+06'),jdecode(''),'/594/24001.html','true',[],'',''],
		['PAGE','69501',jdecode('Hunting+impressions'),jdecode(''),'/594/69501.html','true',[],'','']
	],'',''],
	['PAGE','615',jdecode('My+Borzoi'),jdecode(''),'/615/index.html','true',[ 
		['PAGE','7301',jdecode('Pedigree+Sveta'),jdecode(''),'/615/7301.html','true',[],'','']
	],'',''],
	['PAGE','14001',jdecode('Photo+of+the+month'),jdecode(''),'/14001.html','true',[],'',''],
	['PAGE','636',jdecode('Photo+gallery'),jdecode(''),'/636/index.html','true',[ 
		['PAGE','82201',jdecode('Sveta+%2F+%D0%A1%D0%B2%D0%B5%D1%82%D0%B0'),jdecode(''),'/636/82201.html','true',[],'',''],
		['PAGE','7343',jdecode('Horse+%2F+%D0%9B%D0%BE%D1%88%D0%B0%D0%B4%D1%8C'),jdecode(''),'/636/7343.html','false',[],'',''],
		['PAGE','7364',jdecode('Cats+%2F+%D0%9A%D0%BE%D1%88%D0%BA%D0%B8+'),jdecode(''),'/636/7364.html','false',[],'',''],
		['PAGE','7385',jdecode('Garden+%2F+%D0%A1%D0%B0%D0%B4'),jdecode(''),'/636/7385.html','true',[],'',''],
		['PAGE','13501',jdecode('Russia+%2F+%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F'),jdecode(''),'/636/13501.html','true',[],'','']
	],'',''],
	['PAGE','8706',jdecode('Guestbook'),jdecode(''),'/8706.html','true',[],'',''],
	['PAGE','7022',jdecode('Links+and+more'),jdecode(''),'/7022.html','true',[],'',''],
	['PAGE','657',jdecode('Contact+us'),jdecode(''),'/657.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Activate';
theSitetree.paletteFamily='ADA89E';
theSitetree.keyvisualId='2026';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='338';
theSitetree.graphicsetId='393';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='ADA89E';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Activate',
				paletteFamily: 	'ADA89E',
				keyvisualId: 	'2026',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'338',
				graphicsetId: 	'393',
				contentColor: 	'FFFFFF',
				contentBGColor: 'ADA89E',
				a_color: 		'ADA89E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-8706abw0x0in2r7l']={
webappId:    '1002',
documentId:  '8706',
internalId:  '8706abw0x0in2r7l',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100526-144914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100525-201229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090806-015430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20091123-235624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20090927-171841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82201',
internalId:  '',
customField: '20090405-002315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100511-175532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20070921-154809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69501',
internalId:  '',
customField: '20080806-165011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100526-143517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20091119-225711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20090623-021302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7364',
internalId:  '',
customField: '20090404-223745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7385',
internalId:  '',
customField: '20090404-222555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090404-215036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8706',
internalId:  '',
customField: '20090404-234421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20090404-225932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090404-235037'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2R7L';
var companyName   = 'my+borzoi';
var htmlTitle	  = 'MY+BORZOI+%E2%80%93+Site+about+the+Russian+sighthound';
var metaKeywords  = 'Barsoi%2C+Borzoi%2C+Barso%C3%AF%2C+Russischer+Windhund%2C+Russian+sighthound%2C++L%C3%A9vrier+russe%2C+Levriero+russo%2C+Lebrel+ruso%2C+Galgo+ruso++Russkaya+Psovaya+Borzaya%2C+%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B0%D1%8F+%D0%9F%D1%81%D0%BE%D0%B2%D0%B0%D1%8F+%D0%91%D0%BE%D1%80%D0%B7%D0%B0%D1%8F%2C';
var metaContents  = 'MY+BORZOI+is+first+of+all+a+site+about+our+own+Borzoi+female%2C+but+also+about+the+Russian+sighthound+in+general.+Here+you+can+find+a+lot+of+information+about+the+breed+and+the+personality+of+this+aristocrat+under+the+sighthounds.';
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();
};
