/* [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','5301',jdecode('Home'),jdecode(''),'/5301/index.html','true',[ 
		['PAGE','5901',jdecode('The+TAPS+Team'),jdecode(''),'/5301/5901.html','true',[],'','']
	],'',''],
	['PAGE','6027',jdecode('Horses+For+Sale'),jdecode(''),'/6027/index.html','true',[ 
		['PAGE','6048',jdecode('Mares'),jdecode(''),'/6027/6048.html','true',[],'',''],
		['PAGE','6069',jdecode('Geldings'),jdecode(''),'/6027/6069.html','true',[],'',''],
		['PAGE','6090',jdecode('Weanlings%2FYealings'),jdecode(''),'/6027/6090.html','true',[],'',''],
		['PAGE','59910',jdecode('On+Consignment'),jdecode(''),'/6027/59910.html','true',[],'',''],
		['PAGE','35592',jdecode('Horses+Sold'),jdecode(''),'/6027/35592.html','true',[],'','']
	],'',''],
	['PAGE','5964',jdecode('Services+Available'),jdecode(''),'/5964/index.html','true',[ 
		['PAGE','5985',jdecode('Boarding'),jdecode(''),'/5964/5985.html','true',[],'',''],
		['PAGE','21992',jdecode('Board+Packages'),jdecode(''),'/5964/21992.html','true',[],'',''],
		['PAGE','6006',jdecode('Arena+Rental'),jdecode(''),'/5964/6006.html','true',[],'',''],
		['PAGE','18378',jdecode('Training+Services'),jdecode(''),'/5964/18378.html','true',[],'','']
	],'',''],
	['PAGE','6111',jdecode('Online+Payment'),jdecode(''),'/6111.html','true',[],'',''],
	['PAGE','6174',jdecode('Upcoming+Events'),jdecode(''),'/6174.html','true',[],'',''],
	['PAGE','6153',jdecode('News'),jdecode(''),'/6153.html','true',[],'',''],
	['PAGE','6258',jdecode('Contact+TAPS'),jdecode(''),'/6258/index.html','true',[ 
		['PAGE','6237',jdecode('TAPS+Guestbook'),jdecode(''),'/6258/6237.html','true',[],'','']
	],'',''],
	['PAGE','18399',jdecode('Gallery'),jdecode(''),'/18399/index.html','true',[ 
		['PAGE','63910',jdecode('TAPS+Widget'),jdecode(''),'/18399/63910.html','false',[],'','']
	],'',''],
	['PAGE','6216',jdecode('Links'),jdecode(''),'/6216.html','true',[],'',''],
	['PAGE','83610',jdecode('Saddle+4+Sale'),jdecode(''),'/83610.html','false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Cable';
theSitetree.paletteFamily='D30303';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10575';
theSitetree.graphicsetId='10527';
theSitetree.contentColor='FF0000';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cable',
				paletteFamily: 	'D30303',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10575',
				graphicsetId: 	'10527',
				contentColor: 	'FF0000',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100201-155934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63910',
internalId:  '',
customField: '20090901-183049'
};
webappMappings['4001']=webappMappings['4001-16635820']={
webappId:    '4001',
documentId:  '6111',
internalId:  '16635820',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-6237aen330inzyzd']={
webappId:    '1002',
documentId:  '6237',
internalId:  '6237aen330inzyzd',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-27']={
webappId:    '7008',
documentId:  '6258',
internalId:  '27',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18378',
internalId:  '',
customField: '20091206-082224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59910',
internalId:  '',
customField: '20100120-110934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5964',
internalId:  '',
customField: '20091204-182444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6027',
internalId:  '',
customField: '20100519-192730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6153',
internalId:  '',
customField: '20100217-075442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6069',
internalId:  '',
customField: '20100315-162007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6237',
internalId:  '',
customField: '20090226-003404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6258',
internalId:  '',
customField: '20100104-163722'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-16636926']={
webappId:    '1501',
documentId:  '5301',
internalId:  '16636926',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35592',
internalId:  '',
customField: '20100129-102706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100120-124402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5985',
internalId:  '',
customField: '20091204-173740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6006',
internalId:  '',
customField: '20091204-181010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6174',
internalId:  '',
customField: '20100315-162508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6216',
internalId:  '',
customField: '20100201-161654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6111',
internalId:  '',
customField: '20090619-093548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21992',
internalId:  '',
customField: '20091204-180804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6048',
internalId:  '',
customField: '20100217-080258'
};
webappMappings['7060']=webappMappings['7060-4c03dd6c44a2456a8ad68b8fdc84bab0']={
webappId:    '7060',
documentId:  '18399',
internalId:  '4c03dd6c44a2456a8ad68b8fdc84bab0',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6090',
internalId:  '',
customField: '20100527-065828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18399',
internalId:  '',
customField: '20100120-115511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83610',
internalId:  '',
customField: '20100201-161203'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INZYZD';
var companyName   = 'TAPS+EQUESTRIAN+CENTER';
var htmlTitle	  = 'TAPS+EQUESTRIAN+CENTER+-+TAPS+RIVER+OAKS+FARMS%2C+INC.';
var metaKeywords  = 'Horse%2C+horses+for+sale%2C+equestrian%2C+stable%2C+boarding+in+Illinois%2C+Stables+in+Illinois%2C+Gaited+horse%2C+AQHA%2C+TWH%2C+Fox+Trotter%2C+Paints%2C+Rocky+Mountain+Horse%2C+Tennessee+Walkers%2C+Horse+sales%2C+horse+breeder%2C+horse+trainer%2C+training+Illinois%2C+arena+rental%2C+equestrian+clinics%2C+haul+in+arena+rental%2C+American+Quarter+Horse';
var metaContents  = 'TAPS+EQUESTRIAN+CENTER%3A+Horse+Sales%2C+Boarding%2C+Clinics%2C+Arena+Rental%2C+Training+217-832-9404+We+offers+well+bred+quality+horses+for+sale+at+our+facility.++We+have+Full+Service+Board+including+daily+turnout+with+other+package+options+available.++Arena+Rental+-+Haul-In+arena+riding%2C+clinics%2C+club+meetings%2C+equestrian+educational+programs.+Gaited+horses+and+AQHA+available+most+times.++';
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();
};
