/* [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','124801',jdecode('Start'),jdecode(''), jdecode('%2F124801.html'), 'true',[],'',''],
	['PAGE','120701',jdecode('Kontakt'),jdecode(''), jdecode('%2F120701.html'), 'true',[],'',''],
	['PAGE','196712',jdecode('Prislista+sm%C3%A5djur'),jdecode(''), jdecode('%2F196712.html'), 'true',[],'',''],
	['PAGE','208212',jdecode('Prislista+h%C3%A4st'),jdecode(''), jdecode('%2F208212.html'), 'true',[],'',''],
	['PAGE','7527',jdecode('Best%C3%A4llning+varor'),jdecode(''), jdecode('%2F7527.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Polar+pulsm%C3%A4tare'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','7443',jdecode('CS600X+H%C3%A4st'),jdecode(''), jdecode('%2F7443.html'), 'true',[],'',''],
	['PAGE','7485',jdecode('Health+check'),jdecode(''), jdecode('%2F7485.html'), 'true',[],'',''],
	['PAGE','7506',jdecode('Tillbeh%C3%B6r'),jdecode(''), jdecode('%2F7506.html'), 'true',[],'',''],
	['PAGE','473',jdecode('Pulstr%C3%A4ning'),jdecode(''), jdecode('%2F473.html'), 'true',[],'',''],
	['PAGE','85901',jdecode('Tr%C3%A4ningsl%C3%A4ra+f%C3%B6r...'),jdecode(''), jdecode('%2F85901.html'), 'true',[],'',''],
	['PAGE','204112',jdecode('e-Bok%3ATraining...'),jdecode(''), jdecode('%2F204112.html'), 'true',[],'',''],
	['PAGE','107901',jdecode('Stigra+Equine+SW'),jdecode(''), jdecode('%2F107901.html'), 'true',[],'',''],
	['PAGE','14422',jdecode('Tr%C3%A4ningsanalys'),jdecode(''), jdecode('%2F14422.html'), 'true',[],'',''],
	['PAGE','14401',jdecode('Kurser'),jdecode(''), jdecode('%2F14401.html'), 'true',[],'',''],
	['PAGE','21301',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F21301%2Findex.html'), 'true',[ 
		['PAGE','21701',jdecode('H%C3%A4stbilder'),jdecode(''), jdecode('%2F21301%2F21701.html'), 'true',[],'',''],
		['PAGE','22701',jdecode('Monteringsanvisning'),jdecode(''), jdecode('%2F21301%2F22701.html'), 'true',[],'','']
	],'',''],
	['PAGE','133401',jdecode('ENGLISH'),jdecode(''), jdecode('%2F133401%2Findex.html'), 'true',[ 
		['PAGE','53722',jdecode('HR+based+training'),jdecode(''), jdecode('%2F133401%2F53722.html'), 'true',[],'',''],
		['PAGE','109501',jdecode('e-Book%3ATraining...'),jdecode(''), jdecode('%2F133401%2F109501.html'), 'true',[],'',''],
		['PAGE','107922',jdecode('Stigra+Equine+SW'),jdecode(''), jdecode('%2F133401%2F107922.html'), 'true',[],'',''],
		['PAGE','123401',jdecode('Web+shop'),jdecode(''), jdecode('%2F133401%2F123401.html'), 'true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='FF9B5E';
theSitetree.keyvisualId='2346';
theSitetree.keyvisualName='aerzte4.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='430';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC210'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'FF9B5E',
				keyvisualId: 	'2346',
				keyvisualName: 	'aerzte4.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'430',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'CC3300',
				e_color: 		'FF3300',
				f_color: 		'FF9966',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-e0381153a2cfd9b5d918ca539aad4391']={
webappId:    '7060',
documentId:  '21701',
internalId:  'e0381153a2cfd9b5d918ca539aad4391',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-7ef2293f0df18d7bb4070218f9b49dae']={
webappId:    '7060',
documentId:  '22701',
internalId:  '7ef2293f0df18d7bb4070218f9b49dae',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20110629-025826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120701',
internalId:  '',
customField: '20120105-052728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204112',
internalId:  '',
customField: '20120106-113447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85901',
internalId:  '',
customField: '20120106-112700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107901',
internalId:  '',
customField: '20120106-115448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20120106-054647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7443',
internalId:  '',
customField: '20120107-034728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20120106-102135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7506',
internalId:  '',
customField: '20120107-034423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7527',
internalId:  '',
customField: '20120106-063105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20120106-113558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14422',
internalId:  '',
customField: '20090316-090245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20081026-090715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20080125-063123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20080125-063316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '196712',
internalId:  '',
customField: '20120106-120038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53722',
internalId:  '',
customField: '20100812-070322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107922',
internalId:  '',
customField: '20120106-123634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133401',
internalId:  '',
customField: '20120107-040712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109501',
internalId:  '',
customField: '20120106-115541'
};
webappMappings['4001']=webappMappings['4001-17105702']={
webappId:    '4001',
documentId:  '123401',
internalId:  '17105702',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '124801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123401',
internalId:  '',
customField: '20090316-030746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124801',
internalId:  '',
customField: '20120107-041908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208212',
internalId:  '',
customField: '20120106-120153'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INVVBU';
var companyName   = 'horseandtraining.com';
var htmlTitle	  = 'HORSEANDTRAINING+eBookTraining+Stigra+Eq+sw+Polar+pulsm%C3%A4tare';
var metaKeywords  = 'polar+pulsm%C3%A4tare+%2C+pulsm%C3%A4tare+f%C3%B6r+h%C3%A4star-produkter-b%C3%B6cker-kurser+%2C+stigra+equine+software+%2C+eBook+Training+the+racehorse+and+the+riding+horse+%2C+Leif+Stilling+%2C+polar+heart+rate+monitors+for+horses+%2C+polar+equine+heart+rate+monitors+%2C+heart+rate+monitors+horse+%2C+equine+heart+rate+monitors+%2C+horse+training+books+%2C+horse+tips+%2C+horse+training+aid+%2C+horse+bits+%2C+horse+tack+%2C+equine+training+%2C+how+to+train+horses+%2C+horse+training+%2C+horse+trainer%2C+training+a+horse+%2C+horse+riding+training+%2C+training+exercises+%2C+basic+training+%2C+harness+racing+%2C+standardbred+training+%2C+horse+racing+%2C+horse+jumping+%2C+jumping+horse+%2C+dressage+horse+%2C+western+training+%2C+endurance+training+%2C+jump+training+%2C+quarter+horse+%2C+training+equipment+%2C+chevaux';
var metaContents  = 'Get+a+deeper+insight+of+training+with+heart+rate+monitors%2CStigra+Equine+software+for+training+analysis+and+the+eBook+Training+the...written+in+english+';
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();
};

