/* [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('About+us'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Bulldogs'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','69522',jdecode('Bulldog+Studs'),jdecode(''),'/69522.html','true',[],'',''],
	['PAGE','594',jdecode('French+Bulldogs'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','69564',jdecode('Frenchie+Stud+'),jdecode(''),'/69564.html','true',[],'',''],
	['PAGE','657',jdecode('Boston+Terriers'),jdecode(''),'/657.html','true',[],'',''],
	['PAGE','232723',jdecode('Smooth+Collies'),jdecode(''),'/232723.html','true',[],'',''],
	['PAGE','103701',jdecode('Mastiffs'),jdecode(''),'/103701.html','true',[],'',''],
	['PAGE','101901',jdecode('Show+Results'),jdecode(''),'/101901.html','true',[],'',''],
	['PAGE','69585',jdecode('Judging+%28photos%29'),jdecode(''),'/69585.html','true',[],'',''],
	['PAGE','220123',jdecode('Puppies+Available'),jdecode(''),'/220123.html','true',[],'',''],
	['PAGE','720',jdecode('Bulldog+Book+'),jdecode(''),'/720.html','true',[],'',''],
	['PAGE','90101',jdecode('Gallery'),jdecode(''),'/90101.html','true',[],'',''],
	['PAGE','136223',jdecode('LINKS'),jdecode(''),'/136223.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100112-220754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100211-221016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090422-213227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100114-001434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101901',
internalId:  '',
customField: '20091126-231253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20100304-105843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69522',
internalId:  '',
customField: '20100517-205059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103701',
internalId:  '',
customField: '20091126-230619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20090130-002556'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4964783']={
webappId:    '1501',
documentId:  '501',
internalId:  '4964783',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69564',
internalId:  '',
customField: '20091205-225328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69585',
internalId:  '',
customField: '20091009-222206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '220123',
internalId:  '',
customField: '20100504-221802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90101',
internalId:  '',
customField: '20090422-215420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232723',
internalId:  '',
customField: '20100804-145516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136223',
internalId:  '',
customField: '20100214-180753'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2RU2';
var companyName   = '+';
var htmlTitle	  = 'KINGROCK+SHOWDOGS';
var metaKeywords  = 'Bulldogs%2C+French+Bulldogs%2C+Boston+Terriers%2C+Deerhounds%2C+Bulldog+Stud+dogs%2C+French+Bulldog+Stud+dogs%2C+Bulldog+puppies+for+sale%2C+French+Bulldog+puppies+for+sale%2C+Bulldogs+Today%2C+Chris+Thomas%2C+Graham+Godfrey%2C+Kingrock+Bulldogs%2C+Kingrock+French+Bulldogs%2C+Kingrock%2C+Kingrock+Boston+Terriers%2C+Kingrock+Deerhounds%2C+Deerhound+puppies%2C+Kingrock+puppies+for+sale%2C+Bulldog+book%2C+Counthorpe+House.';
var metaContents  = 'Show+Dog+Kennels';
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();
};
