/* [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','27601',jdecode('Home'),jdecode(''), jdecode('%2F27601.html'), 'true',[],'',''],
	['PAGE','35201',jdecode('Roster'),jdecode(''), jdecode('%2F35201.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Facility'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','29464',jdecode('Season'),jdecode(''), jdecode('%2F29464%2Findex.html'), 'true',[ 
		['PAGE','29506',jdecode('News'),jdecode(''), jdecode('%2F29464%2F29506.html'), 'true',[],'',''],
		['PAGE','29527',jdecode('Off+Season'),jdecode(''), jdecode('%2F29464%2F29527.html'), 'true',[],'','']
	],'',''],
	['PAGE','29401',jdecode('About+us'),jdecode(''), jdecode('%2F29401%2Findex.html'), 'true',[ 
		['PAGE','29443',jdecode('Coaches'),jdecode(''), jdecode('%2F29401%2F29443.html'), 'true',[],'',''],
		['PAGE','29422',jdecode('History'),jdecode(''), jdecode('%2F29401%2F29422.html'), 'true',[],'','']
	],'',''],
	['PAGE','35222',jdecode('Larry+Nelson+Classic'),jdecode(''), jdecode('%2F35222%2Findex.html'), 'true',[ 
		['PAGE','83322',jdecode('2011+Results'),jdecode(''), jdecode('%2F35222%2F83322.html'), 'true',[],'',''],
		['PAGE','70612',jdecode('2010+Results'),jdecode(''), jdecode('%2F35222%2F70612.html'), 'true',[],'',''],
		['PAGE','44301',jdecode('2009+Results'),jdecode(''), jdecode('%2F35222%2F44301.html'), 'true',[],'',''],
		['PAGE','67412',jdecode('2008+Results'),jdecode(''), jdecode('%2F35222%2F67412.html'), 'true',[],'',''],
		['PAGE','67433',jdecode('2007+Results'),jdecode(''), jdecode('%2F35222%2F67433.html'), 'true',[],'',''],
		['PAGE','67454',jdecode('2006+Results'),jdecode(''), jdecode('%2F35222%2F67454.html'), 'true',[],'','']
	],'',''],
	['PAGE','33001',jdecode('Parents'),jdecode(''), jdecode('%2F33001.html'), 'true',[],'',''],
	['PAGE','29611',jdecode('Youth+Club'),jdecode(''), jdecode('%2F29611.html'), 'true',[],'',''],
	['PAGE','29548',jdecode('Contact'),jdecode(''), jdecode('%2F29548.html'), 'true',[],'',''],
	['PAGE','29569',jdecode('Alumni'),jdecode(''), jdecode('%2F29569%2Findex.html'), 'true',[ 
		['PAGE','40701',jdecode('Alumni+College+Graduates'),jdecode(''), jdecode('%2F29569%2F40701.html'), 'true',[],'',''],
		['PAGE','41301',jdecode('Alumni+Wrestling+in+College'),jdecode(''), jdecode('%2F29569%2F41301.html'), 'true',[],'','']
	],'',''],
	['PAGE','29590',jdecode('Links'),jdecode(''), jdecode('%2F29590.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10556';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10556',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20120117-144714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29464',
internalId:  '',
customField: '20120115-101132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20100331-114419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29422',
internalId:  '',
customField: '20110722-145307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29443',
internalId:  '',
customField: '20110220-170334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29548',
internalId:  '',
customField: '20110918-191216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29611',
internalId:  '',
customField: '20111016-140634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29590',
internalId:  '',
customField: '20110212-234217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29569',
internalId:  '',
customField: '20110918-191258'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '27601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20111114-222413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29506',
internalId:  '',
customField: '20110212-234010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29527',
internalId:  '',
customField: '20101027-143145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20091119-113358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35222',
internalId:  '',
customField: '20110918-191029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20091209-123551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40701',
internalId:  '',
customField: '20100331-114347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41301',
internalId:  '',
customField: '20110918-191423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20091208-155006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67454',
internalId:  '',
customField: '20101013-145036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67433',
internalId:  '',
customField: '20101013-145212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67412',
internalId:  '',
customField: '20101013-145451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70612',
internalId:  '',
customField: '20110118-141357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83322',
internalId:  '',
customField: '20111204-201400'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE118';
var companyName   = 'Vacaville+High+School+Wrestling';
var htmlTitle	  = 'Vacaville+High+School+Wrestling';
var metaKeywords  = '';
var metaContents  = 'Vacaville+High+School+Wrestling+Official+Page';
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();
};

