/* [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','33401',jdecode('MIRROR+MAD'),jdecode(''),'/33401.html','true',[],'',''],
	['PAGE','1701',jdecode('Mirror+Home'),jdecode(''),'/1701.html','true',[],'',''],
	['PAGE','32201',jdecode('Pictures+in+Wild+frames'),jdecode(''),'/32201.html','true',[],'',''],
	['PAGE','21001',jdecode('NEW+2010+Mirror+Photos+'),jdecode(''),'/21001.html','true',[],'',''],
	['PAGE','1752',jdecode('Mirror+Photos+1'),jdecode(''),'/1752.html','true',[],'',''],
	['PAGE','1830',jdecode('Mirror+Photos+2'),jdecode(''),'/1830.html','true',[],'',''],
	['PAGE','1778',jdecode('Mirror+Photos+3'),jdecode(''),'/1778.html','true',[],'',''],
	['PAGE','15001',jdecode('Mirror+Photos+4'),jdecode(''),'/15001.html','true',[],'',''],
	['PAGE','26901',jdecode('Mirror+Photos+5+new+2010'),jdecode(''),'/26901.html','true',[],'',''],
	['PAGE','21027',jdecode('Mirror+Photos+6'),jdecode(''),'/21027.html','true',[],'',''],
	['PAGE','21053',jdecode('Mirror+Photos+7'),jdecode(''),'/21053.html','true',[],'',''],
	['PAGE','21079',jdecode('Mirror+Photos++8'),jdecode(''),'/21079.html','true',[],'',''],
	['PAGE','23301',jdecode('Mirror+Photos+9'),jdecode(''),'/23301.html','true',[],'',''],
	['PAGE','30401',jdecode('Your+home...Your+Mirror%21'),jdecode(''),'/30401.html','true',[],'',''],
	['PAGE','12301',jdecode('Flossys+toy+box'),jdecode(''),'/12301.html','true',[],'',''],
	['PAGE','26501',jdecode('flossys+Chair+Christmas'),jdecode(''),'/26501.html','true',[],'',''],
	['PAGE','1856',jdecode('Contact+Me...'),jdecode(''),'/1856.html','true',[],'',''],
	['PAGE','25401',jdecode('Guestbook+new+2010'),jdecode(''),'/25401.html','true',[],'',''],
	['PAGE','28201',jdecode('www.Treesilove.com'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','28801',jdecode('Sample+Wedding+Photos'),jdecode(''),'/28801.html','true',[],'',''],
	['PAGE','17801',jdecode('Location'),jdecode(''),'/17801.html','true',[],'',''],
	['PAGE','17601',jdecode('Driving+Directions'),jdecode(''),'/17601.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='do-it-yourself';
theSitetree.paletteFamily='AE713F';
theSitetree.keyvisualId='10327';
theSitetree.keyvisualName='kv_10327.jpg';
theSitetree.fontsetId='21216';
theSitetree.graphicsetId='13321';
theSitetree.contentColor='824F17';
theSitetree.contentBGColor='F1E5D3';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'do-it-yourself',
				paletteFamily: 	'AE713F',
				keyvisualId: 	'10327',
				keyvisualName: 	'kv_10327.jpg',
				fontsetId: 		'21216',
				graphicsetId: 	'13321',
				contentColor: 	'824F17',
				contentBGColor: 'F1E5D3',
				a_color: 		'000000',
				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['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '17601',
internalId:  'routing',
customField: 'en_GB'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20090723-144702'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17801',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-3373']={
webappId:    '7008',
documentId:  '1856',
internalId:  '3373',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100206-160711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20100108-155439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1778',
internalId:  '',
customField: '20090723-142954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1830',
internalId:  '',
customField: '20090723-142816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1856',
internalId:  '',
customField: '20090218-140757'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '33401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20090723-122758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20090723-144035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20100123-173101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100123-173329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21027',
internalId:  '',
customField: '20090729-155518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21053',
internalId:  '',
customField: '20090729-155405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21079',
internalId:  '',
customField: '20090730-145425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20090730-144915'
};
webappMappings['7002']=webappMappings['7002-3171']={
webappId:    '7002',
documentId:  '25401',
internalId:  '3171',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20100108-162852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20100108-162500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20100108-164435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20100109-170929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20100115-123708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20100207-162128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20100206-155127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20100206-162147'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE7H9';
var companyName   = 'Mirror+Mad+for+Mirrors';
var htmlTitle	  = 'mirrors%2C+sheffield%2C+mirror+mad%2C+framed+mirrors%2C+reclaimed+wood%2C+reclaimed+oak%2C+reclaimed+pine%2Csheffield+wedding+photographer%2C';
var metaKeywords  = 'sheffieldmirrors%2Cmirrors%2Cmade%2Cto%2Corder%2Cmirrors%2Ctimber%2Cwood%2Creclaimed%2Cmirrorframes%2Creclaimed+timber%2Coak%2Cash%2Cyew%2Celm%2Cwaney+edged%2Clarge+mirrors%2Csheffield%2Cmirror+mad%2C+mirror+mad%2C+sheffield+mirrors%2Cframed%2Cpolished%2C+edge%2Cbevel%2Cwedding+photographer%2C';
var metaContents  = 'framed+mirrors+sheffield+bespoke+loads+in+stock+old+oak+old+pinemirrors+made+of+reclaimed+wood+chunky+with+bark+on+both+sides+if+wanted+upto+5+foot+by+8+foot+all+types+of+timber+in+stock+reclaimed+wood+and+dead+felled+old+floor+boards+and+timber%2Csheffield+wedding+photographer%2C+';
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();
};
