/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','652',jdecode('About+us'),jdecode(''),'/652.html','true',[],''],
	['PAGE','736',jdecode('Contact+us%2FForum'),jdecode(''),'/736.html','true',[],''],
	['PAGE','328021',jdecode('AWA+Urban'),jdecode(''),'/328021.html','true',[],''],
	['PAGE','328042',jdecode('AWA+Woodland'),jdecode(''),'/328042.html','true',[],''],
	['PAGE','673',jdecode('Game+Dates%2FPrices'),jdecode(''),'/673.html','true',[],''],
	['PAGE','5501',jdecode('Corporate'),jdecode(''),'/5501.html','true',[],''],
	['PAGE','10601',jdecode('Rentals'),jdecode(''),'/10601.html','true',[],''],
	['PAGE','10201',jdecode('Links+%26+Site+Map'),jdecode(''),'/10201.html','true',[],''],
	['PAGE','10622',jdecode('Site+Shop'),jdecode(''),'/10622.html','true',[],''],
	['PAGE','330221',jdecode('Urban+Gallery'),jdecode(''),'/330221.html','true',[],''],
	['PAGE','191201',jdecode('Woodland+Gallery'),jdecode(''),'/191201.html','true',[],''],
	['PAGE','367321',jdecode('New+page'),jdecode(''),'/367321.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-a53100d804878cf7d13a1470656f7bcc']={
webappId:    '7060',
documentId:  '191201',
internalId:  'a53100d804878cf7d13a1470656f7bcc',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100517-161358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100819-122206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090921-131354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20090921-134841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20060902-090408'
};
webappMappings['7060']=webappMappings['7060-4889b39ea6f40c7a4f84a1e6050a6403']={
webappId:    '7060',
documentId:  '330221',
internalId:  '4889b39ea6f40c7a4f84a1e6050a6403',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20100405-114943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20090330-145304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10622',
internalId:  '',
customField: '20100517-142315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191201',
internalId:  '',
customField: '20091124-163427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '328042',
internalId:  '',
customField: '20090921-133031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '328021',
internalId:  '',
customField: '20100517-141612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '330221',
internalId:  '',
customField: '20091124-163356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '367321',
internalId:  '',
customField: '20100809-123548'
};
webappMappings['7050']=webappMappings['7050-464']={
webappId:    '7050',
documentId:  '367321',
internalId:  '464',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN2J7W';
var companyName   = 'AWA+Herts+Airsoft+Site';
var htmlTitle	  = '';
var metaKeywords  = 'Airsoft%2CAirsoft+Herts%2CAirsoft+Essex%2Cpaintball%2Carmy+games%2Cwar+games%2Cshooting%2C+Herts%2C+Essex';
var metaContents  = 'AWA+Herts+have+an+enviable+reputation+for+fair+play%E2%80%A6well+thought+out+scenarios%E2%80%A6truly+huge+playing+area.+On+the+Herts%2C+Essex+borders';
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();
};
