/* [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','7401',jdecode('Home'),jdecode(''), jdecode('%2F7401.html'), 'true',[],'',''],
	['PAGE','7452',jdecode('About+us'),jdecode(''), jdecode('%2F7452.html'), 'true',[],'',''],
	['PAGE','7515',jdecode('Horses'),jdecode(''), jdecode('%2F7515%2Findex.html'), 'true',[ 
		['PAGE','85012',jdecode('Harley'),jdecode(''), jdecode('%2F7515%2F85012.html'), 'true',[],'',''],
		['PAGE','91012',jdecode('Sempatico'),jdecode(''), jdecode('%2F7515%2F91012.html'), 'true',[],'',''],
		['PAGE','91033',jdecode('Robert+Redford'),jdecode(''), jdecode('%2F7515%2F91033.html'), 'true',[],'',''],
		['PAGE','89412',jdecode('MAF+Absolute+Alex'),jdecode(''), jdecode('%2F7515%2F89412.html'), 'true',[],'',''],
		['PAGE','87412',jdecode('Rhett'),jdecode(''), jdecode('%2F7515%2F87412.html'), 'true',[],'',''],
		['PAGE','75722',jdecode('Barcelona+Bay'),jdecode(''), jdecode('%2F7515%2F75722.html'), 'true',[],'',''],
		['PAGE','57301',jdecode('SOLD-+S.G.R.F.+Cloudy+Feature'),jdecode(''), jdecode('%2F7515%2F57301.html'), 'true',[],'',''],
		['PAGE','87454',jdecode('SOLD-+Sunny'),jdecode(''), jdecode('%2F7515%2F87454.html'), 'true',[],'',''],
		['PAGE','83812',jdecode('SOLD-+Sunset+Sam'),jdecode(''), jdecode('%2F7515%2F83812.html'), 'true',[],'',''],
		['PAGE','87433',jdecode('SOLD-+Dakota'),jdecode(''), jdecode('%2F7515%2F87433.html'), 'true',[],'',''],
		['PAGE','77501',jdecode('SOLD-+Ima+Spooky+Rascal'),jdecode(''), jdecode('%2F7515%2F77501.html'), 'true',[],'',''],
		['PAGE','49101',jdecode('SOLD-+Red+October'),jdecode(''), jdecode('%2F7515%2F49101.html'), 'true',[],'',''],
		['PAGE','79101',jdecode('SOLD-+Crystal+Cleanmachine'),jdecode(''), jdecode('%2F7515%2F79101.html'), 'true',[],'',''],
		['PAGE','77522',jdecode('SOLD-+Franklin'),jdecode(''), jdecode('%2F7515%2F77522.html'), 'true',[],'',''],
		['PAGE','75743',jdecode('SOLD-+Scooters+Slick+Jet'),jdecode(''), jdecode('%2F7515%2F75743.html'), 'true',[],'',''],
		['PAGE','75701',jdecode('SOLD-+Keep+Zip+Company'),jdecode(''), jdecode('%2F7515%2F75701.html'), 'true',[],'',''],
		['PAGE','70801',jdecode('SOLD+-+Justa+Song'),jdecode(''), jdecode('%2F7515%2F70801.html'), 'true',[],'',''],
		['PAGE','72101',jdecode('SOLD+-+Politiek'),jdecode(''), jdecode('%2F7515%2F72101.html'), 'true',[],'',''],
		['PAGE','65601',jdecode('SOLD+-+Freckles+Echols'),jdecode(''), jdecode('%2F7515%2F65601.html'), 'true',[],'',''],
		['PAGE','49143',jdecode('SOLD+-+Redneck+Blondes+In+Town'),jdecode(''), jdecode('%2F7515%2F49143.html'), 'true',[],'',''],
		['PAGE','18401',jdecode('SOLD+-+Elegant+Treasure+'),jdecode(''), jdecode('%2F7515%2F18401.html'), 'true',[],'',''],
		['PAGE','42401',jdecode('SOLD+-+Sorcerer'),jdecode(''), jdecode('%2F7515%2F42401.html'), 'true',[],'','']
	],'',''],
	['PAGE','32501',jdecode('Our+Happy+Customers'),jdecode(''), jdecode('%2F32501.html'), 'true',[],'',''],
	['PAGE','7557',jdecode('Facilities'),jdecode(''), jdecode('%2F7557.html'), 'true',[],'',''],
	['PAGE','12301',jdecode('Boarding'),jdecode(''), jdecode('%2F12301.html'), 'true',[],'',''],
	['PAGE','12101',jdecode('Training'),jdecode(''), jdecode('%2F12101.html'), 'true',[],'',''],
	['PAGE','7536',jdecode('Contact'),jdecode(''), jdecode('%2F7536.html'), 'true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='CAB996';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11061';
theSitetree.graphicsetId='11834';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'CAB996',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11061',
				graphicsetId: 	'11834',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20120107-170734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7515',
internalId:  '',
customField: '20120125-215015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7536',
internalId:  '',
customField: '20110315-223808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7557',
internalId:  '',
customField: '20100106-080318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7452',
internalId:  '',
customField: '20110127-204742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20110723-165857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91012',
internalId:  '',
customField: '20120201-132722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20110124-133328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91033',
internalId:  '',
customField: '20120201-132722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20110124-133639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20100106-082705'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75743',
internalId:  '',
customField: '20110519-221122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49143',
internalId:  '',
customField: '20110321-142323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65601',
internalId:  '',
customField: '20110321-142437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20111003-191108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42401',
internalId:  '',
customField: '20110123-132610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75701',
internalId:  '',
customField: '20110519-204307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89412',
internalId:  '',
customField: '20120116-203248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87454',
internalId:  '',
customField: '20120108-124434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83812',
internalId:  '',
customField: '20111206-234653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87412',
internalId:  '',
customField: '20111110-101305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57301',
internalId:  '',
customField: '20111116-104533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70801',
internalId:  '',
customField: '20110502-131748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72101',
internalId:  '',
customField: '20110321-072653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75722',
internalId:  '',
customField: '20110802-203644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77501',
internalId:  '',
customField: '20110824-120143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77522',
internalId:  '',
customField: '20110622-230524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79101',
internalId:  '',
customField: '20110723-170018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85012',
internalId:  '',
customField: '20120107-165440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87433',
internalId:  '',
customField: '20111116-104657'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLESM';
var companyName   = 'Touch+of+Class+Farm';
var htmlTitle	  = 'Touch+of+Class+Farm+Howell%2C+NJ';
var metaKeywords  = 'horses+for+sale%2Cdressage%2Cquarterhorse%2Cboarding%2Chorses%2C+trail+horse%2C+NJ+horses+for+sale%2C+Barbara+Ebner%2C+Bob+Ebner%2C+Howell+horses%2C+warmbloods%2C+half-breds%2C+western+pleasure%2C+eventing%2C+paint+horse%2C+horse+boarding+New+Jersey%2C+quiet+horses+for+sale%2C+lesson+horses%2C+therapy+riding';
var metaContents  = 'Touch+of+Class+Farm+offers+horses+for+sale+and+dressage+training+with+USDF+judge+Barbara+Ebner.';
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();
};

