/* [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','3201',jdecode('Home'),jdecode(''), jdecode('%2F3201.html'), 'true',[],'',''],
	['PAGE','3252',jdecode('Ueber+uns'),jdecode(''), jdecode('%2F3252.html'), 'true',[],'',''],
	['PAGE','76801',jdecode('Bartagamen'),jdecode(''), jdecode('%2F76801.html'), 'true',[],'',''],
	['PAGE','88001',jdecode('Samojeden'),jdecode(''), jdecode('%2F88001.html'), 'true',[],'',''],
	['PAGE','87201',jdecode('Yakutian+Laika'),jdecode(''), jdecode('%2F87201.html'), 'true',[],'',''],
	['PAGE','3901',jdecode('Unsere+Hunde'),jdecode(''), jdecode('%2F3901%2Findex.html'), 'true',[ 
		['PAGE','10401',jdecode('Uhma'),jdecode(''), jdecode('%2F3901%2F10401.html'), 'true',[],'',''],
		['PAGE','10422',jdecode('Jary'),jdecode(''), jdecode('%2F3901%2F10422.html'), 'true',[],'',''],
		['PAGE','83101',jdecode('Cirinija'),jdecode(''), jdecode('%2F3901%2F83101.html'), 'true',[],'','']
	],'',''],
	['PAGE','3922',jdecode('Zucht'),jdecode(''), jdecode('%2F3922.html'), 'true',[],'',''],
	['PAGE','3943',jdecode('Sport'),jdecode(''), jdecode('%2F3943.html'), 'true',[],'',''],
	['PAGE','3964',jdecode('Bilder'),jdecode(''), jdecode('%2F3964.html'), 'true',[],'',''],
	['PAGE','48501',jdecode('Aktuell'),jdecode(''), jdecode('%2F48501.html'), 'true',[],'',''],
	['PAGE','4006',jdecode('News'),jdecode(''), jdecode('%2F4006.html'), 'true',[],'',''],
	['PAGE','53901',jdecode('Sponsoring'),jdecode(''), jdecode('%2F53901.html'), 'true',[],'',''],
	['PAGE','3985',jdecode('Kontakt'),jdecode(''), jdecode('%2F3985.html'), 'true',[],'',''],
	['PAGE','4027',jdecode('Links'),jdecode(''), jdecode('%2F4027.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
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: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20111213-072232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3252',
internalId:  '',
customField: '20110905-114730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4027',
internalId:  '',
customField: '20110720-130647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20110508-105205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4006',
internalId:  '',
customField: '20120111-095500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20120111-083854'
};
webappMappings['7008']=webappMappings['7008-8813']={
webappId:    '7008',
documentId:  '3985',
internalId:  '8813',
customField: 'language:de;country:CH;'
};
webappMappings['1501']=webappMappings['1501-33727037']={
webappId:    '1501',
documentId:  '3201',
internalId:  '33727037',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3964',
internalId:  '',
customField: '20110824-083546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3985',
internalId:  '',
customField: '20100131-165444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76801',
internalId:  '',
customField: '20110905-114256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3943',
internalId:  '',
customField: '20111031-081801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20110824-083817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20110905-112945'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '87201',
internalId:  '-',
customField: '20120112-064812'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48501',
internalId:  '',
customField: '20110928-090153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53901',
internalId:  '',
customField: '20111015-151236'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '88001',
internalId:  '-',
customField: '20120111-095538'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '83101',
internalId:  '-',
customField: '20120111-084342'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEIUH';
var companyName   = 'Karatayka+Samoyeds+%26+Yakutian+Laika';
var htmlTitle	  = 'Karatayka+Samoyeds+%26+Yakutian+Laika';
var metaKeywords  = 'Samoyeds%2C+Samojede%2C+Samojeden%2C+Karatayka%2C+Karatajka%2C+Karatayka+Samoyeds%2C+Samojedenwelpen%2C+Welpen%2C+Samojedenzucht%2C++Samojedenz%C3%BCchter%2C++Z%C3%BCchter%2C+Schlitten%2C+Schlittenhunde%2C+Schlittenhunderennen%2C+Hundeschlitten%2C+Wolfschmid%2C+Dogsled%2C+Sledog%2C+Dogsledge%2C+Schmid%2C+Irene%2C+Markus%2C+Kaja%2C+Jan%2C+Schlittenhundesport%2C+Nordische+Hunde%2C+Musher%2C++Wurfplanung%2C+Schlittenreparatur%2C+Jary%2C+Uhma%2C+Schlittenhundesack%2C+Schlittensack%2C+Wagenrennen%2C+Skij%C3%B6ring%2C+Scooter%2C+Epilepsie%2C+Jakuten%2C+Yakutian+Laika%2C+Jakutischer+Laika%2C+Cirinija%2CArctic+Travel%2C+Munha%2C+Kebi%2C+Sabine%2C+Erwin%2C+Nordicspirit%2C+Dunya';
var metaContents  = 'Samoyeds%2C+Samojede%2C+Samojeden%2C+Karatayka%2C+Karatajka%2C+Karatayka+Samoyeds%2C+Samojedenwelpen%2C+Welpen%2C+Samojedenzucht%2C+Samojedenz%C3%BCchter%2CZ%C3%BCchter%2C++Schlitten%2C+Schlittenhunde%2C+Schlittenhunderennen%2C+Hundeschlitten%2C+Wolfschmid%2C+Dogsled%2C+Sledog%2C+Dogsledge%2C+Schmid%2C+Irene%2C+Markus%2C+Kaja%2C+Jan%2C+Schlittenhundesport%2C+Nordische+Hunde%2C+Musher%2C++Wurfplanung%2C+Schlittenreparatur%2C+Jary%2C+Uhma%2C+Schlittenhundesack%2C+Schlittensack%2C+Wagenrennen%2C+Skij%C3%B6ring%2C+Scooter%2C+Epilepsie%2C+Jakuten%2C+Yakutian+Laika%2C+Jakutischer+Laika%2C+Cirinija%2C+Arctic+Travel%2C+Munha%2C+Kebi%2C+Sabine%2C+Erwin%2C+Nordicspirit%2C+Dunya';
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();
};

