/* [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(''), jdecode('%2F33401.html'), 'true',[],'',''],
	['PAGE','1856',jdecode('Contact+Me...'),jdecode(''), jdecode('%2F1856.html'), 'true',[],'',''],
	['PAGE','66301',jdecode('oh+no+its+dec...again%21'),jdecode(''), jdecode('%2F66301.html'), 'true',[],'',''],
	['PAGE','62501',jdecode('eeek%21%21+its+oct+already'),jdecode(''), jdecode('%2F62501.html'), 'true',[],'',''],
	['PAGE','64501',jdecode('September+just+gone%21'),jdecode(''), jdecode('%2F64501.html'), 'true',[],'',''],
	['PAGE','60801',jdecode('July+into+Aug'),jdecode(''), jdecode('%2F60801.html'), 'true',[],'',''],
	['PAGE','58901',jdecode('Spring+into+May'),jdecode(''), jdecode('%2F58901.html'), 'true',[],'',''],
	['PAGE','57101',jdecode('March+2011'),jdecode(''), jdecode('%2F57101.html'), 'true',[],'',''],
	['PAGE','54501',jdecode('Feb+2011'),jdecode(''), jdecode('%2F54501.html'), 'true',[],'',''],
	['PAGE','52901',jdecode('Dec+2010+Snow+oh+no%21'),jdecode(''), jdecode('%2F52901.html'), 'true',[],'',''],
	['PAGE','48701',jdecode('Nov+2010+windy+month'),jdecode(''), jdecode('%2F48701.html'), 'true',[],'',''],
	['PAGE','45301',jdecode('AUG+2010+odds+and+ends'),jdecode(''), jdecode('%2F45301.html'), 'true',[],'',''],
	['PAGE','44301',jdecode('May+New+frames'),jdecode(''), jdecode('%2F44301.html'), 'true',[],'',''],
	['PAGE','1701',jdecode('Mirror+at+Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','40001',jdecode('April+New+Photos'),jdecode(''), jdecode('%2F40001.html'), 'true',[],'',''],
	['PAGE','32201',jdecode('Pictures+in+Woody+frames'),jdecode(''), jdecode('%2F32201.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('+Mirror+Photos+'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','1752',jdecode('Mirror+Photos+1'),jdecode(''), jdecode('%2F1752.html'), 'true',[],'',''],
	['PAGE','1830',jdecode('Mirror+Photos+2'),jdecode(''), jdecode('%2F1830.html'), 'true',[],'',''],
	['PAGE','1778',jdecode('Mirror+Photos+3'),jdecode(''), jdecode('%2F1778.html'), 'true',[],'',''],
	['PAGE','15001',jdecode('Mirror+Photos+4'),jdecode(''), jdecode('%2F15001.html'), 'true',[],'',''],
	['PAGE','26901',jdecode('Mirror+Photos+5+'),jdecode(''), jdecode('%2F26901.html'), 'true',[],'',''],
	['PAGE','21027',jdecode('Mirror+Photos+6'),jdecode(''), jdecode('%2F21027.html'), 'true',[],'',''],
	['PAGE','21053',jdecode('Mirror+Photos+7'),jdecode(''), jdecode('%2F21053.html'), 'true',[],'',''],
	['PAGE','21079',jdecode('Mirror+Photos++8'),jdecode(''), jdecode('%2F21079.html'), 'true',[],'',''],
	['PAGE','23301',jdecode('Mirror+Photos+9'),jdecode(''), jdecode('%2F23301.html'), 'true',[],'',''],
	['PAGE','30401',jdecode('Your+home...Your+Mirror%21'),jdecode(''), jdecode('%2F30401.html'), 'true',[],'',''],
	['PAGE','12301',jdecode('Flossys+toy+box'),jdecode(''), jdecode('%2F12301.html'), 'true',[],'',''],
	['PAGE','26501',jdecode('flossys+Chair+Christmas'),jdecode(''), jdecode('%2F26501.html'), 'true',[],'',''],
	['PAGE','28801',jdecode('Lyndseys+big+day%21%21'),jdecode(''), jdecode('%2F28801.html'), 'true',[],'',''],
	['PAGE','25401',jdecode('Guestbook+new+2010'),jdecode(''), jdecode('%2F25401.html'), 'false',[],'',''],
	['PAGE','28201',jdecode('www.trees-into-lumber.com'),jdecode(''), jdecode('%2F28201.html'), 'true',[],'',''],
	['PAGE','17801',jdecode('Location'),jdecode(''), jdecode('%2F17801.html'), 'true',[],'',''],
	['PAGE','17601',jdecode('Driving+Directions'),jdecode(''), jdecode('%2F17601.html'), 'true',[],'','']];
var siteelementCount=34;
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 prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKQS'
};
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: '20100415-152548'
};
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: '20111006-005255'
};
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: '20100219-154308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21027',
internalId:  '',
customField: '20110722-135058'
};
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: '20120201-111536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20100815-152156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20100506-141805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20101114-170816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20111209-171056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40001',
internalId:  '',
customField: '20100415-152150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20110215-144803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45301',
internalId:  '',
customField: '20110215-144414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20110215-144155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20101206-235901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54501',
internalId:  '',
customField: '20110226-161146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57101',
internalId:  '',
customField: '20110312-172231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58901',
internalId:  '',
customField: '20110508-222309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60801',
internalId:  '',
customField: '20111003-134625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62501',
internalId:  '',
customField: '20111003-044145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20111003-141521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66301',
internalId:  '',
customField: '20111206-124944'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE7H9';
var companyName   = 'Mirror+Mad+for+Mirrors';
var htmlTitle	  = 'Gallery+mirrors%2Cmirrors%2C+sheffield%2C+mirror+mad%2C+framed+mirrors%2C+reclaimed+wood%2C+reclaimed+oak%2C+reclaimed+pine%2Cwoodysmirrors.com%2Cwww.trees-into-lumber.com';
var metaKeywords  = 'sheffield+mirrors%2Cmirrors+made+to+order%2CGallery+Mirrors%2C+mirrors%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%2Ctrees-into-lumber.com%2Cwoodysmirrors.com%2C+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();
};

