/* [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','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],''],
	['PAGE','1152',jdecode('About+WFC'),jdecode(''),'/1152.html','true',[],''],
	['PAGE','1173',jdecode('Wrestlers+%26+Talent'),jdecode(''),'/1173.html','true',[],''],
	['PAGE','1257',jdecode('Events'),jdecode(''),'/1257.html','true',[],''],
	['PAGE','12722',jdecode('Results%2FHistory'),jdecode(''),'/12722.html','true',[],''],
	['PAGE','21949',jdecode('Ministry'),jdecode(''),'/21949.html','true',[],''],
	['PAGE','1299',jdecode('Fundraising'),jdecode(''),'/1299.html','true',[],''],
	['PAGE','15101',jdecode('Support+WFC'),jdecode(''),'/15101.html','true',[],''],
	['PAGE','12701',jdecode('Links'),jdecode(''),'/12701.html','true',[],''],
	['PAGE','21958',jdecode('Message+Board'),jdecode(''),'/21958.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Kingston';
theSitetree.paletteFamily='042287';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11146';
theSitetree.graphicsetId='11955';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='88BAEE';
var theTemplate={
				name: 			'Kingston',
				paletteFamily: 	'042287',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11146',
				graphicsetId: 	'11955',
				contentColor: 	'000000',
				contentBGColor: '88BAEE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20100225-114456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20090714-162038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1173',
internalId:  '',
customField: '20090714-162242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1257',
internalId:  '',
customField: '20090714-162317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12722',
internalId:  '',
customField: '20090714-162917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1299',
internalId:  '',
customField: '20090714-163241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090714-163318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090714-163656'
};
webappMappings['1501']=webappMappings['1501-5047714']={
webappId:    '1501',
documentId:  '1101',
internalId:  '5047714',
customField: '1501'
};
webappMappings['1003']=webappMappings['1003-ahw050ineqpk12705881221']={
webappId:    '1003',
documentId:  '21958',
internalId:  'ahw050ineqpk12705881221',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21949',
internalId:  '',
customField: '20100225-082915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21958',
internalId:  '',
customField: '20100225-082915'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEQPK';
var companyName   = 'Wrestling+For+Charity';
var htmlTitle	  = 'Wrestling+For+Charity';
var metaKeywords  = 'Wrestling%2C+Wrestling+for+Charity%2C+Lucha+Libre%2C+Live+professional+wrestling%2C+WWE%2C+pro+wrestling%2C+professional+wrestling%2C+Robert+Haugh%2C+Butch+Haugh%2C+APW%2C+Northern+California+wrestling%2C+Nor+Cal+wrestling%2C+BTW%2C+TnA+wrestling%2C+wrestling+fundraisers%2C+professional+wrestling+fundraisers%2C+wrestling+fund+raisers%2C+Wrestling+Witnesses+Ministry%2C+Wrestling+Ministry%2C+Silicon+Valley+Wrestling%2C+WWM%2C+WFC%2C+wrestling+and+charity%2C+ro+wrestling+charity%2C+charities';
var metaContents  = 'Wrestling+For+Charity%3A+Non-profit+professional+wrestling+organization+created+for+bringing+fund+raising+opportunities+for+needy+youth+sports+and+local+community+organizations+needing+funds+to+continue+their+wonderful+programs+within+the+community.';
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();
};
