/* [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','3101',jdecode('Home'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('What%26%23x27%3Bs+the+latest%3F'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','9822',jdecode('Schedule'),jdecode(''), jdecode('%2F9822.html'), 'true',[],'',''],
	['PAGE','3222',jdecode('Contacts+%26+Links'),jdecode(''), jdecode('%2F3222%2Findex.html'), 'true',[ 
		['PAGE','22601',jdecode('Email+us'),jdecode(''), jdecode('%2F3222%2F22601.html'), 'true',[],'','']
	],'',''],
	['PAGE','9801',jdecode('Practice+and+field+location'),jdecode(''), jdecode('%2F9801%2Findex.html'), 'true',[ 
		['PAGE','10201',jdecode('Map'),jdecode(''), jdecode('%2F9801%2F10201.html'), 'true',[],'','']
	],'',''],
	['PAGE','9843',jdecode('Team'),jdecode(''), jdecode('%2F9843%2Findex.html'), 'true',[ 
		['PAGE','23501',jdecode('CIPP+%26+School+Club+Registration'),jdecode(''), jdecode('%2F9843%2F23501.html'), 'true',[],'','']
	],'',''],
	['PAGE','9864',jdecode('Alumni'),jdecode(''), jdecode('%2F9864.html'), 'true',[],'',''],
	['PAGE','9885',jdecode('Sign+our+Guestbook'),jdecode(''), jdecode('%2F9885.html'), 'true',[],'',''],
	['PAGE','36301',jdecode('Photo+Album'),jdecode(''), jdecode('%2F36301%2Findex.html'), 'true',[ 
		['PAGE','56812',jdecode('Alumni+2011'),jdecode(''), jdecode('%2F36301%2F56812.html'), 'true',[],'',''],
		['PAGE','40501',jdecode('Alumni+Day+2010'),jdecode(''), jdecode('%2F36301%2F40501.html'), 'true',[],'',''],
		['PAGE','40601',jdecode('Alumni+Game+2010'),jdecode(''), jdecode('%2F36301%2F40601.html'), 'true',[],'',''],
		['PAGE','40522',jdecode('Alumni+Golf+Outing+2010'),jdecode(''), jdecode('%2F36301%2F40522.html'), 'true',[],'',''],
		['PAGE','39001',jdecode('WCSU+vs+Sacred+Heart'),jdecode(''), jdecode('%2F36301%2F39001.html'), 'true',[],'',''],
		['PAGE','36901',jdecode('WCSU+vs.+Amherst'),jdecode(''), jdecode('%2F36301%2F36901.html'), 'true',[],'',''],
		['PAGE','52312',jdecode('WCSU+vs+Mitchell'),jdecode(''), jdecode('%2F36301%2F52312.html'), 'true',[],'','']
	],'',''],
	['PAGE','19101',jdecode('Team+History'),jdecode(''), jdecode('%2F19101.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='080245';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10616';
theSitetree.graphicsetId='10811';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='080245';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delta',
				paletteFamily: 	'080245',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10616',
				graphicsetId: 	'10811',
				contentColor: 	'FFFFFF',
				contentBGColor: '080245',
				a_color: 		'221785',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20120121-094228'
};
webappMappings['1002']=webappMappings['1002-9885aendu0in3puh']={
webappId:    '1002',
documentId:  '9885',
internalId:  '9885aendu0in3puh',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20090807-135414'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090807-133830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9822',
internalId:  '',
customField: '20110916-145542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9843',
internalId:  '',
customField: '20090810-134127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3222',
internalId:  '',
customField: '20110823-223440'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-21026215']={
webappId:    '1501',
documentId:  '3101',
internalId:  '21026215',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9864',
internalId:  '',
customField: '20100419-105502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9885',
internalId:  '',
customField: '20090810-135114'
};
webappMappings['7008']=webappMappings['7008-19575']={
webappId:    '7008',
documentId:  '22601',
internalId:  '19575',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090810-094742'
};
webappMappings['7050']=webappMappings['7050-11388']={
webappId:    '7050',
documentId:  '21001',
internalId:  '11388',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20090810-131544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20090810-144208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20110906-154828'
};
webappMappings['7008']=webappMappings['7008-27485']={
webappId:    '7008',
documentId:  '9864',
internalId:  '27485',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-fed70346e23df7da6c78a4ba1c5d855b']={
webappId:    '7060',
documentId:  '36301',
internalId:  'fed70346e23df7da6c78a4ba1c5d855b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20110320-191455'
};
webappMappings['7060']=webappMappings['7060-061bb687a670267b8a6c6c21194b11b9']={
webappId:    '7060',
documentId:  '36901',
internalId:  '061bb687a670267b8a6c6c21194b11b9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20100428-151858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40601',
internalId:  '',
customField: '20100520-101109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20100428-153209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40522',
internalId:  '',
customField: '20100520-100517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20111130-143129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52312',
internalId:  '',
customField: '20110320-192312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56812',
internalId:  '',
customField: '20111130-143023'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3PUH';
var companyName   = 'W.C.S.U.++Men%E2%80%99s+Rugby';
var htmlTitle	  = 'WCSU+Rugby';
var metaKeywords  = 'WCSU+Rugby%2CW.C.S.U.+Rugby';
var metaContents  = 'Western+Connecticut+State+University+Rugby%2CWestConn+Rugby%2CWCSU+RFC%2CWCSU+Rugby';
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();
};

