/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','2422',jdecode('Show+Information'),jdecode(''), jdecode('%2F2422.html'), 'true',[],'',''],
	['PAGE','2401',jdecode('News'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','2569',jdecode('Member+Info'),jdecode(''), jdecode('%2F2569.html'), 'true',[],'',''],
	['PAGE','2464',jdecode('2011-2012+POINTS+'),jdecode(''), jdecode('%2F2464.html'), 'true',[],'',''],
	['PAGE','2443',jdecode('Club+Newsletter'),jdecode(''), jdecode('%2F2443.html'), 'true',[],'',''],
	['PAGE','146423',jdecode('2011%2F2012+Media+'),jdecode(''), jdecode('%2F146423.html'), 'true',[],'',''],
	['PAGE','47201',jdecode('Contact+Information'),jdecode(''), jdecode('%2F47201.html'), 'true',[],'',''],
	['PAGE','57001',jdecode('AAYHA+SPONSOR+LEVELS'),jdecode(''), jdecode('%2F57001.html'), 'true',[],'',''],
	['PAGE','61401',jdecode('Platinum+Sponsors'),jdecode(''), jdecode('%2F61401.html'), 'true',[],'',''],
	['PAGE','59801',jdecode('Friends+of+AAYHA'),jdecode(''), jdecode('%2F59801.html'), 'true',[],'',''],
	['PAGE','110423',jdecode('Youth'),jdecode(''), jdecode('%2F110423.html'), 'true',[],'',''],
	['PAGE','63101',jdecode('Fairground+Map'),jdecode(''), jdecode('%2F63101.html'), 'true',[],'',''],
	['PAGE','141823',jdecode('Volunteer+Rewards+NEW'),jdecode(''), jdecode('%2F141823.html'), 'true',[],'',''],
	['PAGE','145723',jdecode('New+page'),jdecode(''), jdecode('%2F145723.html'), 'true',[],'',''],
	['PAGE','106523',jdecode('2010+Media'),jdecode(''), jdecode('%2F106523.html'), 'true',[],'',''],
	['PAGE','161344',jdecode('New+page'),jdecode(''), jdecode('%2F161344.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2C2C2C';
theSitetree.keyvisualId='11074';
theSitetree.keyvisualName='kv_11074.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13797';
theSitetree.contentColor='FCFDFD';
theSitetree.contentBGColor='2C2C2C';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Displace',
				paletteFamily: 	'2C2C2C',
				keyvisualId: 	'11074',
				keyvisualName: 	'kv_11074.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13797',
				contentColor: 	'FCFDFD',
				contentBGColor: '2C2C2C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20120131-210214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20120131-210545'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2569',
internalId:  '',
customField: '20110908-233955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2422',
internalId:  '',
customField: '20120102-173013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59801',
internalId:  '',
customField: '20101014-224653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145723',
internalId:  '',
customField: '20111228-110323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20120131-213040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20120201-104306'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '145723',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-2401abr330inliw3']={
webappId:    '1002',
documentId:  '2401',
internalId:  '2401abr330inliw3',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-16615353']={
webappId:    '1501',
documentId:  '2101',
internalId:  '16615353',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-1502']={
webappId:    '7008',
documentId:  '47201',
internalId:  '1502',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110423',
internalId:  '',
customField: '20111104-103511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141823',
internalId:  '',
customField: '20111218-224131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47201',
internalId:  '',
customField: '20111202-121658'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '63101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106523',
internalId:  '',
customField: '20110610-002240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57001',
internalId:  '',
customField: '20120131-212247'
};
webappMappings['7060']=webappMappings['7060-b730f74f23ab2affbc3efebcd5c31892']={
webappId:    '7060',
documentId:  '106523',
internalId:  'b730f74f23ab2affbc3efebcd5c31892',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61401',
internalId:  '',
customField: '20101116-214001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63101',
internalId:  '',
customField: '20100104-232107'
};
webappMappings['7060']=webappMappings['7060-cd152aa38df3385765698cb088fd9663']={
webappId:    '7060',
documentId:  '146423',
internalId:  'cd152aa38df3385765698cb088fd9663',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146423',
internalId:  '',
customField: '20111109-012827'
};
webappMappings['7005']=webappMappings['7005-214']={
webappId:    '7005',
documentId:  '161344',
internalId:  '214',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161344',
internalId:  '',
customField: '20120122-202140'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLIW3';
var companyName   = 'AAYHA';
var htmlTitle	  = 'AAYHA';
var metaKeywords  = 'Horse+Shows+texas+Open+shows+horse+gazette';
var metaContents  = 'Texas+Open+Horse+Shows+san+antonio+horse+show';
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();
};

