/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('Stallions'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','35201',jdecode('Rockin+N+Dirty'),jdecode(''),'/552/35201.html','true',[],'',''],
		['PAGE','2401',jdecode('Angelic+Assassin'),jdecode(''),'/552/2401.html','true',[],'',''],
		['PAGE','23501',jdecode('Im+Pale+Moon+Warior'),jdecode(''),'/552/23501.html','true',[],'',''],
		['PAGE','30701',jdecode('Kid+Jackie+Blue'),jdecode(''),'/552/30701.html','true',[],'',''],
		['PAGE','2443',jdecode('SA+Monozzarr'),jdecode(''),'/552/2443.html','true',[],'','']
	],'',''],
	['PAGE','573',jdecode('Services'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','594',jdecode('Breeding'),jdecode(''),'/573/594.html','true',[],'',''],
		['PAGE','615',jdecode('Training+%26+Marketing'),jdecode(''),'/573/615.html','true',[],'',''],
		['PAGE','636',jdecode('Current+Rates'),jdecode(''),'/573/636.html','true',[],'','']
	],'',''],
	['PAGE','31101',jdecode('Mares'),jdecode(''),'/31101.html','true',[],'',''],
	['PAGE','657',jdecode('Sale+Offerings'),jdecode(''),'/657/index.html','true',[ 
		['PAGE','699',jdecode('Arabians'),jdecode(''),'/657/699.html','true',[],'',''],
		['PAGE','10901',jdecode('Non-Arabian+Breeds'),jdecode(''),'/657/10901.html','true',[],'',''],
		['PAGE','2464',jdecode('Tack+and+Equipment'),jdecode(''),'/657/2464.html','true',[],'','']
	],'',''],
	['PAGE','16301',jdecode('Horse+Show+Photos'),jdecode(''),'/16301.html','true',[],'',''],
	['PAGE','720',jdecode('Contact+Stroud+Arabians'),jdecode(''),'/720/index.html','true',[ 
		['PAGE','14901',jdecode('Contact+Stroud+Arabians+%28follow+up+page%29'),jdecode(''),'/720/14901.html','false',[],'','']
	],'',''],
	['PAGE','6506',jdecode('Guestbook'),jdecode(''),'/6506/index.html','true',[ 
		['PAGE','6501',jdecode('Read+Guestbook'),jdecode(''),'/6506/6501.html','false',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='7C8EFE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11063';
theSitetree.graphicsetId='11838';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'7C8EFE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11063',
				graphicsetId: 	'11838',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100421-234003'
};
webappMappings['1002']=webappMappings['1002-6506AHW050INEKU4']={
webappId:    '1002',
documentId:  '6506',
internalId:  '6506AHW050INEKU4',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100502-181300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20100502-181653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20090512-171440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30701',
internalId:  '',
customField: '20081229-144730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100105-143532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20090512-171649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090122-125237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100421-234607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20090512-171915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20100320-205146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31101',
internalId:  '',
customField: '20100426-215617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090512-173814'
};
webappMappings['7008']=webappMappings['7008-7914']={
webappId:    '7008',
documentId:  '720',
internalId:  '7914',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20100320-210340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100320-210849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20100426-215345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20090512-181701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20090122-125222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20070322-145317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20061213-225526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20061213-225526'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEKU4';
var companyName   = 'Stroud+Arabians';
var htmlTitle	  = 'Stroud+Arabians+-+Halter++Performance+Horses';
var metaKeywords  = 'Arabians%2C+arab%2C+training%2C+services%2C+western%2C+breeding%2C+english%2C+halter%2C+saddleseat%2C+performance%2C+half-Arabians%2C+NSH%2C+National+Show+Horse%2C+Show%2C+showing%2C+Arabian+Horse+Registry%2C+Arabian%2C+Saddlebred%2C+park%2C+country+english+pleasure%2C+english+pleasure%2C+hunter%2C+jumper%2C+jumping%2C+show+horse%2C+trail+ride%2C+for+sale%2C+bred%2C+breed%2C+riding%2C+ride%2C+horse%2C+quarter+horse%2C+AQHA%2C+APHA%2C+international%2C+Class+A%2C+Champion%2C+championships%2C+win%2C+second%2C+Paint%2C+1%2F2%2C+winning%2C+get%2C+quality%2C+world%2C+national%2C+canadian%2C+US%2C+USA%2C+';
var metaContents  = 'Training%2C+Marketing%2C+Breeding%2C+Arabians+';
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();
};
