/* [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(''),'/2101.html','true',[],'',''],
	['PAGE','3001',jdecode('Artist%26%23x27%3Bs+Bio'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','2152',jdecode('The+Ranch'),jdecode(''),'/2152/index.html','true',[ 
		['PAGE','2173',jdecode('What%26%23x27%3Bs+New'),jdecode(''),'/2152/2173.html','true',[],'',''],
		['PAGE','2194',jdecode('Guest+Quarters'),jdecode(''),'/2152/2194.html','true',[],'',''],
		['PAGE','25401',jdecode('Location+Map'),jdecode(''),'/2152/25401.html','true',[],'','']
	],'',''],
	['PAGE','2215',jdecode('Art+Galleries'),jdecode(''),'/2215/index.html','true',[ 
		['PAGE','2278',jdecode('Country+Life+in+Oil'),jdecode(''),'/2215/2278.html','true',[],'',''],
		['PAGE','10601',jdecode('Ropin'),jdecode(''),'/2215/10601.html','false',[],'',''],
		['PAGE','10622',jdecode('Waitin+For+the+Dudes'),jdecode(''),'/2215/10622.html','false',[],'',''],
		['PAGE','10643',jdecode('Milton+%26+Friend'),jdecode(''),'/2215/10643.html','false',[],'',''],
		['PAGE','10664',jdecode('Gates'),jdecode(''),'/2215/10664.html','false',[],'',''],
		['PAGE','10685',jdecode('DQ+Dude'),jdecode(''),'/2215/10685.html','false',[],'',''],
		['PAGE','10706',jdecode('Stage+Stop'),jdecode(''),'/2215/10706.html','false',[],'',''],
		['PAGE','10727',jdecode('The+Farrier'),jdecode(''),'/2215/10727.html','false',[],'',''],
		['PAGE','3022',jdecode('City+Life+in+Oil'),jdecode(''),'/2215/3022.html','true',[],'',''],
		['PAGE','8001',jdecode('Montague+Courthouse'),jdecode(''),'/2215/8001.html','false',[],'',''],
		['PAGE','8022',jdecode('Insiders'),jdecode(''),'/2215/8022.html','false',[],'',''],
		['PAGE','8043',jdecode('Taos+Afternoon'),jdecode(''),'/2215/8043.html','false',[],'',''],
		['PAGE','8064',jdecode('Hat+Shopping'),jdecode(''),'/2215/8064.html','false',[],'',''],
		['PAGE','8085',jdecode('Golf+Lesson'),jdecode(''),'/2215/8085.html','false',[],'',''],
		['PAGE','10748',jdecode('Body+Language'),jdecode(''),'/2215/10748.html','false',[],'',''],
		['PAGE','2299',jdecode('Still+Life+in+Oil'),jdecode(''),'/2215/2299.html','true',[],'',''],
		['PAGE','16901',jdecode('Blossoms'),jdecode(''),'/2215/16901.html','false',[],'',''],
		['PAGE','2257',jdecode('Portraits+in+Oil'),jdecode(''),'/2215/2257.html','true',[],'',''],
		['PAGE','13701',jdecode('Dudley'),jdecode(''),'/2215/13701.html','false',[],'',''],
		['PAGE','13722',jdecode('Wagon+Master'),jdecode(''),'/2215/13722.html','false',[],'',''],
		['PAGE','13743',jdecode('Shannon'),jdecode(''),'/2215/13743.html','false',[],'',''],
		['PAGE','13764',jdecode('Meditation'),jdecode(''),'/2215/13764.html','false',[],'',''],
		['PAGE','13785',jdecode('Dan'),jdecode(''),'/2215/13785.html','false',[],'',''],
		['PAGE','13806',jdecode('Mooch'),jdecode(''),'/2215/13806.html','false',[],'',''],
		['PAGE','13827',jdecode('Scotty'),jdecode(''),'/2215/13827.html','false',[],'',''],
		['PAGE','13848',jdecode('Roger'),jdecode(''),'/2215/13848.html','false',[],'',''],
		['PAGE','13869',jdecode('G'),jdecode(''),'/2215/13869.html','false',[],'',''],
		['PAGE','6201',jdecode('Figures+in+Oil'),jdecode(''),'/2215/6201.html','true',[],'',''],
		['PAGE','16701',jdecode('Uncertain'),jdecode(''),'/2215/16701.html','false',[],'',''],
		['PAGE','16722',jdecode('Drawing+Studio'),jdecode(''),'/2215/16722.html','false',[],'',''],
		['PAGE','16743',jdecode('Undecided'),jdecode(''),'/2215/16743.html','false',[],'',''],
		['PAGE','16764',jdecode('Morning+Light'),jdecode(''),'/2215/16764.html','false',[],'',''],
		['PAGE','16785',jdecode('Shannon+in+Repose'),jdecode(''),'/2215/16785.html','false',[],'',''],
		['PAGE','16806',jdecode('Counter+Girl'),jdecode(''),'/2215/16806.html','false',[],'',''],
		['PAGE','2236',jdecode('Figure+Drawing'),jdecode(''),'/2215/2236.html','true',[],'',''],
		['PAGE','19101',jdecode('6839'),jdecode(''),'/2215/19101.html','false',[],'',''],
		['PAGE','19122',jdecode('6517'),jdecode(''),'/2215/19122.html','false',[],'',''],
		['PAGE','19143',jdecode('8950'),jdecode(''),'/2215/19143.html','false',[],'',''],
		['PAGE','19164',jdecode('6520'),jdecode(''),'/2215/19164.html','false',[],'',''],
		['PAGE','19185',jdecode('6856'),jdecode(''),'/2215/19185.html','false',[],'',''],
		['PAGE','19206',jdecode('1751'),jdecode(''),'/2215/19206.html','false',[],'',''],
		['PAGE','19227',jdecode('8937'),jdecode(''),'/2215/19227.html','false',[],'',''],
		['PAGE','19248',jdecode('1757'),jdecode(''),'/2215/19248.html','false',[],'',''],
		['PAGE','19269',jdecode('8928'),jdecode(''),'/2215/19269.html','false',[],'',''],
		['PAGE','19290',jdecode('1748'),jdecode(''),'/2215/19290.html','false',[],'','']
	],'',''],
	['PAGE','2320',jdecode('Art+Workshops'),jdecode(''),'/2320.html','true',[],'',''],
	['PAGE','2341',jdecode('Contact+Us'),jdecode(''),'/2341.html','true',[],'',''],
	['PAGE','23801',jdecode('Helpful+Links'),jdecode(''),'/23801.html','true',[],'','']];
var siteelementCount=55;
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 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:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-35267']={
webappId:    '7008',
documentId:  '2341',
internalId:  '35267',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20110518-133451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20110523-085201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2341',
internalId:  '',
customField: '20110422-161028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20110425-092636'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20110425-093109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20110422-165432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20110503-111759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20110518-164751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2257',
internalId:  '',
customField: '20110518-144639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2299',
internalId:  '',
customField: '20110518-151647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2278',
internalId:  '',
customField: '20110518-140734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20110518-134313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2320',
internalId:  '',
customField: '20110425-095010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20110518-153457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20110503-121328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20110503-121423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20110503-121526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8064',
internalId:  '',
customField: '20110503-121618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8085',
internalId:  '',
customField: '20110503-121711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20110518-140920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10622',
internalId:  '',
customField: '20110518-141050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10643',
internalId:  '',
customField: '20110518-141238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10664',
internalId:  '',
customField: '20110518-141417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10685',
internalId:  '',
customField: '20110518-141559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10706',
internalId:  '',
customField: '20110518-141731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10727',
internalId:  '',
customField: '20110518-141923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10748',
internalId:  '',
customField: '20110518-134516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20110518-145202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13722',
internalId:  '',
customField: '20110518-145107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13743',
internalId:  '',
customField: '20110518-145336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13764',
internalId:  '',
customField: '20110518-145525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13785',
internalId:  '',
customField: '20110518-145736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13806',
internalId:  '',
customField: '20110518-145919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13827',
internalId:  '',
customField: '20110518-150056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13848',
internalId:  '',
customField: '20110518-150239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13869',
internalId:  '',
customField: '20110518-150432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20110518-151843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20110518-153650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20110518-153842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16743',
internalId:  '',
customField: '20110518-154020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16764',
internalId:  '',
customField: '20110518-154228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16785',
internalId:  '',
customField: '20110518-154624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16806',
internalId:  '',
customField: '20110518-154804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20110518-165023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20110518-165236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19143',
internalId:  '',
customField: '20110518-165453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19164',
internalId:  '',
customField: '20110518-165652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19185',
internalId:  '',
customField: '20110518-170544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19206',
internalId:  '',
customField: '20110518-171243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19227',
internalId:  '',
customField: '20110518-172202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19248',
internalId:  '',
customField: '20110518-172359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19269',
internalId:  '',
customField: '20110518-172755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19290',
internalId:  '',
customField: '20110518-172930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20110523-091230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20110728-112103'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INFWQS';
var companyName   = 'MacLaughlin+Ranch';
var htmlTitle	  = 'MacLaughlin+Ranch+in+north+central+Texas+offers+both+an+art+retreat+and+a+chance+to+view+cowboys+working+cattle.';
var metaKeywords  = 'MacLaughlin+Ranch%2C+Montague+Institute+of+Art%2C+Texas+ranch%2C+artist+retreat%2C+Don+MacLaughlin%2C+Texas+Art+Workshops';
var metaContents  = 'MacLaughlin+Ranch+in+north+central+Texas+is+both+an+artist+retreat+and+a+working+cattle+ranch.++Owned+and+operated+by+rancher+and+artist%2C+Don+MacLaughlin%2C+The+Ranch+hosts+many+different+art+workshops+presented+by+Montague+Institute+of+Art.';
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();
};

