/* [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','1712',jdecode('Home'),jdecode(''),'/1712.html','true',[],''],
	['PAGE','10301',jdecode('About+Us'),jdecode(''),'/10301.html','true',[],''],
	['PAGE','10353',jdecode('Puppy+Blog'),jdecode(''),'/10353.html','true',[],''],
	['PAGE','10379',jdecode('My+Photos'),jdecode(''),'/10379.html','true',[],''],
	['PAGE','10327',jdecode('Guestbook'),jdecode(''),'/10327.html','true',[],''],
	['PAGE','10405',jdecode('Contact'),jdecode(''),'/10405.html','true',[],''],
	['PAGE','1838',jdecode('Poodle+Friends'),jdecode(''),'/1838.html','true',[],''],
	['PAGE','1817',jdecode('Links'),jdecode(''),'/1817.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Corpus';
theSitetree.paletteFamily='374874';
theSitetree.keyvisualId='8953';
theSitetree.keyvisualName='kv_8953.jpg';
theSitetree.fontsetId='17257';
theSitetree.graphicsetId='12684';
theSitetree.contentColor='313131';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Corpus',
				paletteFamily: 	'374874',
				keyvisualId: 	'8953',
				keyvisualName: 	'kv_8953.jpg',
				fontsetId: 		'17257',
				graphicsetId: 	'12684',
				contentColor: 	'313131',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'798ABE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1712',
internalId:  '',
customField: '20090116-101424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090406-171049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10405',
internalId:  '',
customField: '20080813-133858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10379',
internalId:  '',
customField: '20090418-163634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10353',
internalId:  '',
customField: '20090418-163856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1817',
internalId:  '',
customField: '20090406-170523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1838',
internalId:  '',
customField: '20090214-142925'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1712',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6850320']={
webappId:    '1501',
documentId:  '1712',
internalId:  '6850320',
customField: '1501'
};
webappMappings['7002']=webappMappings['7002-819']={
webappId:    '7002',
documentId:  '10327',
internalId:  '819',
customField: 'language:en;country:GB;'
};
webappMappings['7050']=webappMappings['7050-951']={
webappId:    '7050',
documentId:  '10353',
internalId:  '951',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-7789826fe9a839747fe099ba5eb43043']={
webappId:    '7060',
documentId:  '10379',
internalId:  '7789826fe9a839747fe099ba5eb43043',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-2175']={
webappId:    '7008',
documentId:  '10405',
internalId:  '2175',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10327',
internalId:  '',
customField: '20080904-182132'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE0N3';
var companyName   = 'Starene+Poodles';
var htmlTitle	  = 'Starene+Poodles';
var metaKeywords  = 'Montravia%2C+Gibbs%2C+Rodgers%2C+Amberiffic.+Show+kennels.+Optigen.+Puppies.++Schneckenhaus.+Sherrygold.+Dechine.+Miniature+poodle.+Toy+poodle.+Standard+poodle.+Healthy.+Non-allergenic.+Kennel+Club.+KC.+Breeder.+Pet.+Show+dogs.';
var metaContents  = 'Home+of+miniature+and+toy+poodles.+We+are+a+small+show+kennels+where+all+our+dogs+are+pets+first+and+show+dogs+second.+We+have+been+involved+in+showing+dogs+since+the+1970s.+Our+dogs+come+from+renowned+show+and+breeding+kennels%3A++mins+from+Montravia+%28thanks+to+the+late+Pauline+Gibbs+and+Ms+Marita+Rodgers%29+and+our+toys+from+Amberiffic+%28thanks+to+Ms+J+Webb%29.+We+very+very+rarely+breed+from+our+girls+but+when+we+do+we+take+the+utmost+care%2C+not+just+over+the+choice+of+stud+but+over+health+issues+to+ensure+our+puppies+have+the+best+of+lives.+All+our+dogs+are+Optigen+DNA+tested+for+prcd+pra+%28hereditary+blindness%29+and+all+have+tested+genetically+normal.+We+also+have+our+dogs+certified+as+not+having+Luxated+Patella+%28which+can+cause+from+anything+from+a+hardly+noticeable+limp+to+total+lack+of+mobility+in+the+rear+legs%29.++We+are+keen+to+share+our+knowledge+of+dogs+and+happy+to+advise+on+matters+of+dog+handling+and+generally+how+to+look+after+your+dog+and+enjoy+him+or+her+for+many+many+years.';
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();
};
