/* [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','1347',jdecode('Home'),jdecode(''), jdecode('%2F1347.html'), 'true',[],'',''],
	['PAGE','16001',jdecode('photos'),jdecode(''), jdecode('%2F16001%2Findex.html'), 'true',[ 
		['PAGE','35401',jdecode('6mm+Figures'),jdecode(''), jdecode('%2F16001%2F35401.html'), 'true',[],'',''],
		['PAGE','27501',jdecode('10%2F15%2F20+mm+figures'),jdecode(''), jdecode('%2F16001%2F27501.html'), 'true',[],'',''],
		['PAGE','27601',jdecode('25%2F28mm+figures'),jdecode(''), jdecode('%2F16001%2F27601.html'), 'true',[],'',''],
		['PAGE','33901',jdecode('other'),jdecode(''), jdecode('%2F16001%2F33901.html'), 'true',[],'','']
	],'',''],
	['PAGE','1779',jdecode('Armies+4+U+'),jdecode(''), jdecode('%2F1779.html'), 'true',[],'',''],
	['PAGE','16901',jdecode('Contact'),jdecode(''), jdecode('%2F16901.html'), 'true',[],'',''],
	['PAGE','23701',jdecode('Links'),jdecode(''), jdecode('%2F23701.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='5C512E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12687';
theSitetree.contentColor='D3A62A';
theSitetree.contentBGColor='484132';
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: 			'Rivet',
				paletteFamily: 	'5C512E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12687',
				contentColor: 	'D3A62A',
				contentBGColor: '484132',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20100209-140405'
};
webappMappings['7008']=webappMappings['7008-4415']={
webappId:    '7008',
documentId:  '16901',
internalId:  '4415',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20100701-122448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1347',
internalId:  '',
customField: '20110709-132729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20110209-135746'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1347',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8945081']={
webappId:    '1501',
documentId:  '1347',
internalId:  '8945081',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20090415-125343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20110209-140218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1779',
internalId:  '',
customField: '20110209-140532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20100209-134723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20110209-134519'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INER8X';
var companyName   = 'Gun+Of+August+Painting+Service';
var htmlTitle	  = 'Gun+Of+August+Painting+Service++';
var metaKeywords  = 'gun+of+august%2C+Wargame+%2C+wargames+%2C+painting%2C+service%2C+warhammer%2C+40k+%2C+world+war+1+%2C+WW1+%2C+World+war+2+%2C+WW2%2C+Historical+%2C+fantasy+%2C+armati+%2C+shako+%2C+FOW+%2C+flames+of+war+%2C+epic+%2C+napoleonic+%2C+awi+%2C+american+civil+war+%2C+ACW+%2C+german+%2C+british+%2C+polish+%2C+french+%2C+roman+%2C+carthaginian+%2C+persian+%2C+model+%2C+napoleon+%2C+wellington+%2C+prussian+%2C+russian+%2C+russia+%2C+france+%2C+england+%2C+painting+service+%2C+ready+made+%2C+FOG+%2C+fields+of+glory+%2C+Persian+%2C+Roman+%2C+Carthaginian+%2C+dice+';
var metaContents  = 'A+Quality+Painting+service+for+all+your+wargaming+needs+for+a+competive+cheap+service.';
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();
};

