/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','5252',jdecode('About+us'),jdecode(''),'/5252.html','true',[],'',''],
	['PAGE','5278',jdecode('News'),jdecode(''),'/5278.html','true',[],'',''],
	['PAGE','5304',jdecode('Equine'),jdecode(''),'/5304/index.html','true',[ 
		['PAGE','5330',jdecode('A+%26+R'),jdecode(''),'/5304/5330.html','true',[],'',''],
		['PAGE','5601',jdecode('Dream+Mover'),jdecode(''),'/5304/5601.html','true',[],'',''],
		['PAGE','5627',jdecode('Nava+Flow'),jdecode(''),'/5304/5627.html','true',[],'',''],
		['PAGE','5653',jdecode('Ice+Berg'),jdecode(''),'/5304/5653.html','true',[],'',''],
		['PAGE','5679',jdecode('Clean+as+a+Whistle'),jdecode(''),'/5304/5679.html','true',[],'',''],
		['PAGE','5705',jdecode('Steady+Neddy'),jdecode(''),'/5304/5705.html','true',[],'',''],
		['PAGE','5731',jdecode('Happy+Days'),jdecode(''),'/5304/5731.html','true',[],'',''],
		['PAGE','5757',jdecode('Loose+%26+Free'),jdecode(''),'/5304/5757.html','true',[],'',''],
		['PAGE','5783',jdecode('Fight+Back'),jdecode(''),'/5304/5783.html','true',[],'',''],
		['PAGE','5809',jdecode('Slut+Mix'),jdecode(''),'/5304/5809.html','true',[],'',''],
		['PAGE','5835',jdecode('Millennium+Gold'),jdecode(''),'/5304/5835.html','true',[],'','']
	],'',''],
	['PAGE','5356',jdecode('Canine'),jdecode(''),'/5356/index.html','true',[ 
		['PAGE','5861',jdecode('Champion+Dog'),jdecode(''),'/5356/5861.html','true',[],'',''],
		['PAGE','5887',jdecode('Free+%26+Easy'),jdecode(''),'/5356/5887.html','true',[],'','']
	],'',''],
	['PAGE','13501',jdecode('Order+Now'),jdecode(''),'/13501.html','true',[],'',''],
	['PAGE','5382',jdecode('Suppliers'),jdecode(''),'/5382.html','true',[],'',''],
	['PAGE','5408',jdecode('Contact+Us'),jdecode(''),'/5408.html','true',[],'',''],
	['PAGE','13301',jdecode('Links'),jdecode(''),'/13301.html','true',[],'',''],
	['PAGE','18301',jdecode('HAPPY+CUSTOMERS'),jdecode(''),'/18301.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='D24C59';
theSitetree.keyvisualId='605';
theSitetree.keyvisualName='pflanzen.jpg';
theSitetree.fontsetId='127';
theSitetree.graphicsetId='143';
theSitetree.contentColor='F877A1';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'D24C59',
				keyvisualId: 	'605',
				keyvisualName: 	'pflanzen.jpg',
				fontsetId: 		'127',
				graphicsetId: 	'143',
				contentColor: 	'F877A1',
				contentBGColor: '000000',
				a_color: 		'D24C59',
				b_color: 		'F877A1',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20110118-114009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5304',
internalId:  '',
customField: '20081118-134622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20090223-125049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080714-173154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5627',
internalId:  '',
customField: '20080714-173217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5653',
internalId:  '',
customField: '20080714-173237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5679',
internalId:  '',
customField: '20080714-173226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5330',
internalId:  '',
customField: '20080714-173205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5705',
internalId:  '',
customField: '20080714-173247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5731',
internalId:  '',
customField: '20080714-173257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5757',
internalId:  '',
customField: '20080714-173307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5783',
internalId:  '',
customField: '20080714-173317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5809',
internalId:  '',
customField: '20080714-173327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5835',
internalId:  '',
customField: '20080714-173337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5408',
internalId:  '',
customField: '20101019-102958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5356',
internalId:  '',
customField: '20110118-115028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5382',
internalId:  '',
customField: '20100615-122016'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5278',
internalId:  '',
customField: '20081006-171828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5861',
internalId:  '',
customField: '20110118-120601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5887',
internalId:  '',
customField: '20110118-120751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100615-122905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20080714-132355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20090205-105746'
};
var canonHostname = 'wc1.hosting.digiweb.ie';
var accountId     = 'AGW010INXZ7C';
var companyName   = 'Herbal+Wise+Ltd';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

