/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','7885',jdecode('Jr+High+Program+News'),jdecode(''), jdecode('%2F7885%2Findex.html'), 'true',[ 
		['PAGE','7906',jdecode('Schedule'),jdecode(''), jdecode('%2F7885%2F7906.html'), 'true',[],'',''],
		['PAGE','7927',jdecode('Highlights'),jdecode(''), jdecode('%2F7885%2F7927.html'), 'true',[],'',''],
		['PAGE','19801',jdecode('Team+Picture'),jdecode(''), jdecode('%2F7885%2F19801.html'), 'true',[],'','']
	],'',''],
	['PAGE','82401',jdecode('FAQs'),jdecode(''), jdecode('%2F82401.html'), 'true',[],'',''],
	['PAGE','7801',jdecode('Youth+Program+News'),jdecode(''), jdecode('%2F7801.html'), 'true',[],'',''],
	['PAGE','7822',jdecode('Practice+Schedule'),jdecode(''), jdecode('%2F7822.html'), 'true',[],'',''],
	['PAGE','7843',jdecode('Matches+and+Tourneys'),jdecode(''), jdecode('%2F7843.html'), 'true',[],'',''],
	['PAGE','18401',jdecode('Youth+Team+Picture'),jdecode(''), jdecode('%2F18401.html'), 'true',[],'',''],
	['PAGE','7864',jdecode('Highlights'),jdecode(''), jdecode('%2F7864.html'), 'true',[],'',''],
	['PAGE','9101',jdecode('Coaches'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'',''],
	['PAGE','9122',jdecode('Photos'),jdecode(''), jdecode('%2F9122.html'), 'true',[],'',''],
	['PAGE','9143',jdecode('Tournament+Forms'),jdecode(''), jdecode('%2F9143.html'), 'true',[],'',''],
	['PAGE','7948',jdecode('General+Information'),jdecode(''), jdecode('%2F7948.html'), 'true',[],'',''],
	['PAGE','7969',jdecode('Scoring'),jdecode(''), jdecode('%2F7969.html'), 'true',[],'',''],
	['PAGE','8322',jdecode('Contacts'),jdecode(''), jdecode('%2F8322.html'), 'true',[],'',''],
	['PAGE','9501',jdecode('Directions'),jdecode(''), jdecode('%2F9501.html'), 'true',[],'',''],
	['PAGE','8343',jdecode('Links'),jdecode(''), jdecode('%2F8343.html'), 'true',[],'',''],
	['PAGE','15901',jdecode('Map'),jdecode(''), jdecode('%2F15901.html'), 'true',[],'',''],
	['PAGE','52501',jdecode('End+of+Year+Slide+Show'),jdecode(''), jdecode('%2F52501.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Vista';
theSitetree.paletteFamily='C83030';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13647';
theSitetree.graphicsetId='12108';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='C83030';
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: 			'Vista',
				paletteFamily: 	'C83030',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13647',
				graphicsetId: 	'12108',
				contentColor: 	'FFFFFF',
				contentBGColor: 'C83030',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FD7272',
				e_color: 		'FD7272',
				f_color: 		'FD7272',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82401',
internalId:  '',
customField: '20101207-222941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20120123-192241'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8343',
internalId:  '',
customField: '20080312-171156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7864',
internalId:  '',
customField: '20120123-193015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20111110-224327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7822',
internalId:  '',
customField: '20101202-210251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7843',
internalId:  '',
customField: '20101202-210827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20101202-213250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20120102-221857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9122',
internalId:  '',
customField: '20101202-212446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9143',
internalId:  '',
customField: '20101202-213729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7885',
internalId:  '',
customField: '20091112-162756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7906',
internalId:  '',
customField: '20091120-122500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7927',
internalId:  '',
customField: '20100204-165339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20091218-152752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7948',
internalId:  '',
customField: '20091130-213437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7969',
internalId:  '',
customField: '20071214-195846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8322',
internalId:  '',
customField: '20101202-211416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20071231-143516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20071216-190533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20080414-150547'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INXLRC';
var companyName   = 'USC+Youth+Wrestling';
var htmlTitle	  = 'USC+Youth+Wrestling';
var metaKeywords  = 'Upper+St+Clair+Youth+Wrestling';
var metaContents  = 'USC+Youth+Wrestling';
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();
};

