/* [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 theSitetree=[ 
	['PAGE','1001',jdecode('Home'),jdecode(''),'/1001.html','true',[],''],
	['PAGE','1052',jdecode('Our+Cats'),jdecode(''),'/1052/index.html','true',[ 
		['PAGE','12501',jdecode('FIFe+IP+Lunaris+Tessa+Rose'),jdecode(''),'/1052/12501.html','true',[],''],
		['PAGE','18301',jdecode('FIFe+Ch+Lunaris+Misty+Mountain'),jdecode(''),'/1052/18301.html','true',[],''],
		['PAGE','18322',jdecode('FIFe+GIP+Lunaris+Sonny%26%23x27%3Bs+Boy'),jdecode(''),'/1052/18322.html','true',[],''],
		['PAGE','18343',jdecode('FIFe+Pr+Mistymaine+Sweet+Dreams'),jdecode(''),'/1052/18343.html','true',[],''],
		['PAGE','38601',jdecode('Lunaris+Chiquitita'),jdecode(''),'/1052/38601.html','true',[],'']
	],''],
	['PAGE','1073',jdecode('Kittens'),jdecode(''),'/1073.html','true',[],''],
	['PAGE','8001',jdecode('Past+kittens'),jdecode(''),'/8001/index.html','true',[ 
		['PAGE','9201',jdecode('8+April+2006'),jdecode(''),'/8001/9201.html','true',[],''],
		['PAGE','18385',jdecode('30+January+2007'),jdecode(''),'/8001/18385.html','true',[],''],
		['PAGE','48301',jdecode('7+December+2008'),jdecode(''),'/8001/48301.html','true',[],'']
	],''],
	['PAGE','18406',jdecode('Show+News'),jdecode(''),'/18406/index.html','true',[ 
		['PAGE','32501',jdecode('2007'),jdecode(''),'/18406/32501.html','true',[],''],
		['PAGE','32522',jdecode('2008'),jdecode(''),'/18406/32522.html','true',[],''],
		['PAGE','49801',jdecode('2009'),jdecode(''),'/18406/49801.html','true',[],'']
	],''],
	['PAGE','32543',jdecode('Lost+Friends'),jdecode(''),'/32543/index.html','true',[ 
		['PAGE','32564',jdecode('Dude'),jdecode(''),'/32543/32564.html','true',[],''],
		['PAGE','32585',jdecode('Rosie'),jdecode(''),'/32543/32585.html','true',[],'']
	],''],
	['PAGE','8022',jdecode('Cat+Moments+at+Mistymaine'),jdecode(''),'/8022.html','true',[],''],
	['PAGE','5506',jdecode('Guestbook'),jdecode(''),'/5506/index.html','true',[ 
		['PAGE','5501',jdecode('Read+Guestbook'),jdecode(''),'/5506/5501.html','false',[],'']
	],''],
	['PAGE','8043',jdecode('Links'),jdecode(''),'/8043.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='9C42BD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10897';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'9C42BD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10897',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9C42BD',
				e_color: 		'9C42BD',
				f_color: 		'9C42BD',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-5506anbt10inxllf']={
webappId:    '1002',
documentId:  '5506',
internalId:  '5506anbt10inxllf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20090207-111652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20090914-213229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18406',
internalId:  '',
customField: '20090525-115010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1052',
internalId:  '',
customField: '20090401-222809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20090215-123428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20080917-223539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18322',
internalId:  '',
customField: '20090401-222850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18343',
internalId:  '',
customField: '20090215-125615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20081205-120756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1073',
internalId:  '',
customField: '20070508-212533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20070413-220611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20070508-210730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18385',
internalId:  '',
customField: '20090207-104925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20090401-221308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5506',
internalId:  '',
customField: '20070409-224657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20070409-224657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20090525-115609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32543',
internalId:  '',
customField: '20080324-201339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32585',
internalId:  '',
customField: '20080325-230854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32564',
internalId:  '',
customField: '20080324-211516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32522',
internalId:  '',
customField: '20081207-215228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38601',
internalId:  '',
customField: '20090215-123121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49801',
internalId:  '',
customField: '20090914-215118'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXLLF';
var companyName   = 'Mistymaine+Maine+Coons';
var htmlTitle	  = 'Mistymaine+Maine+Coons';
var metaKeywords  = 'Mistymaine+Maine+Coons%2C+Maine+Coons%2C++Maine+Coon+cats%2C++kittens%2C++Maine';
var metaContents  = 'Home+of+Mistymaine+Maine+Coons';
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();
};
