/* [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','301',jdecode('NVP'),jdecode(''),'/301.html','true',[],''],
	['PAGE','15601',jdecode('Game+Schedule'),jdecode(''),'/15601.html','true',[],''],
	['PAGE','7901',jdecode('Photos'),jdecode(''),'/7901.html','true',[],''],
	['PAGE','60983',jdecode('2009+SEASON'),jdecode(''),'/60983.html','true',[],''],
	['PAGE','56683',jdecode('Videos'),jdecode(''),'/56683.html','true',[],''],
	['PAGE','61283',jdecode('Dans+camera'),jdecode(''),'/61283.html','true',[],''],
	['PAGE','61304',jdecode('Kens+Camera'),jdecode(''),'/61304.html','true',[],''],
	['PAGE','61325',jdecode('Lees+Camera'),jdecode(''),'/61325.html','true',[],''],
	['PAGE','61346',jdecode('Toms+Camera'),jdecode(''),'/61346.html','true',[],''],
	['PAGE','48701',jdecode('Business+Cards'),jdecode(''),'/48701.html','true',[],''],
	['PAGE','52617',jdecode('HALLOWEEN'),jdecode(''),'/52617.html','true',[],''],
	['PAGE','5206',jdecode('Guestbook'),jdecode(''),'/5206/index.html','true',[ 
		['PAGE','5201',jdecode('Read+Guestbook'),jdecode(''),'/5206/5201.html','false',[],'']
	],''],
	['PAGE','6901',jdecode('Contact'),jdecode(''),'/6901.html','true',[],''],
	['PAGE','22401',jdecode('PLAYERS'),jdecode(''),'/22401.html','true',[],''],
	['PAGE','24301',jdecode('Classifieds'),jdecode(''),'/24301.html','true',[],''],
	['PAGE','25801',jdecode('Wanted'),jdecode(''),'/25801.html','true',[],''],
	['PAGE','13401',jdecode('LINKS'),jdecode(''),'/13401.html','true',[],''],
	['PAGE','33801',jdecode('DISCLAIMER'),jdecode(''),'/33801.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='4A587F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10449';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A587F';
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'4A587F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10449',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A587F',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'4A587F',
				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['1501']=webappMappings['1501-2580399']={
webappId:    '1501',
documentId:  '301',
internalId:  '2580399',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-5206ahw050invdf0']={
webappId:    '1002',
documentId:  '5206',
internalId:  '5206ahw050invdf0',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-e4e81173b360d06922e5af018283aec4']={
webappId:    '7060',
documentId:  '7901',
internalId:  'e4e81173b360d06922e5af018283aec4',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-8ced199cbba5b8a2b9940cf9cb79882f']={
webappId:    '7060',
documentId:  '60983',
internalId:  '8ced199cbba5b8a2b9940cf9cb79882f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090407-140148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090529-133711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20080902-144854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5206',
internalId:  '',
customField: '20080826-213047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20080826-213047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20081016-081445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20090520-133247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52617',
internalId:  '',
customField: '20081111-154558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20090425-121207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20081009-135033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20081215-131800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33801',
internalId:  '',
customField: '20081014-134126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20081110-113125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56683',
internalId:  '',
customField: '20081215-130739'
};
webappMappings['7060']=webappMappings['7060-8e18bfc9318863f07570da2c20847d5e']={
webappId:    '7060',
documentId:  '52617',
internalId:  '8e18bfc9318863f07570da2c20847d5e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60983',
internalId:  '',
customField: '20090426-143757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61283',
internalId:  '',
customField: '20090426-144959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61304',
internalId:  '',
customField: '20090426-144959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61325',
internalId:  '',
customField: '20090426-144959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61346',
internalId:  '',
customField: '20090426-144959'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVDF0';
var companyName   = 'Naugatuck+Valley+Paintball';
var htmlTitle	  = '';
var metaKeywords  = 'paintball%2Cwatertown+ct+';
var metaContents  = '';
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();
};

