/* [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','2601',jdecode('Farmer%26%23x27%3Bs+Market'),jdecode(''),'/2601.html','true',[],'',''],
	['PAGE','2622',jdecode('Corral+Barn'),jdecode(''),'/2622/index.html','true',[ 
		['PAGE','2643',jdecode('Facility+Prices'),jdecode(''),'/2622/2643.html','true',[],'',''],
		['PAGE','2664',jdecode('Alcohol+Prices'),jdecode(''),'/2622/2664.html','true',[],'',''],
		['PAGE','4701',jdecode('Catering+Menu'),jdecode(''),'/2622/4701.html','true',[],'',''],
		['PAGE','9701',jdecode('Pictures'),jdecode(''),'/2622/9701.html','true',[],'',''],
		['PAGE','6501',jdecode('Availability+Inquiry'),jdecode(''),'/2622/6501.html','true',[],'',''],
		['PAGE','2685',jdecode('FAQs'),jdecode(''),'/2622/2685.html','true',[],'','']
	],'',''],
	['PAGE','2706',jdecode('Fairview+Rental+Properties'),jdecode(''),'/2706.html','true',[],'',''],
	['PAGE','2748',jdecode('Contact%2FLocation'),jdecode(''),'/2748.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9683';
theSitetree.keyvisualName='kv_9683.gif';
theSitetree.fontsetId='10671';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9683',
				keyvisualName: 	'kv_9683.gif',
				fontsetId: 		'10671',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2748',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20110514-193811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20110514-193303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20080310-234020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20090121-213057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2664',
internalId:  '',
customField: '20080310-224200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2685',
internalId:  '',
customField: '20090121-213157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2706',
internalId:  '',
customField: '20080311-155328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20110228-094717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2748',
internalId:  '',
customField: '20100310-232528'
};
webappMappings['7008']=webappMappings['7008-637']={
webappId:    '7008',
documentId:  '6501',
internalId:  '637',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20080311-154545'
};
webappMappings['7060']=webappMappings['7060-ed916172586ff923bf0b8d3bf0ad6cf1']={
webappId:    '7060',
documentId:  '9701',
internalId:  'ed916172586ff923bf0b8d3bf0ad6cf1',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20080311-015908'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN24QY';
var companyName   = 'Fairview+Farms+Marketplace';
var htmlTitle	  = 'Fairview+Farms+Marketplace+Plano+-+Party+Facility%2C+Rent+Houses%2C+Farmers+Market';
var metaKeywords  = 'party+facility%2C+wedding+facility%2C+special+event+facility%2Cfarmers+market%2C+produce%2C+fresh+produce%2C+local+farmers%2C+organic+fruits%2C+organic+vegetables%2C+pumpkin+farms%2C+rental+homes%2C+rent+house%2C+Frisco+rent+homes%2C+Plano+rent+homes%2C+Allen+rent+homes%2C+houses+for+rent%2C+rent+houses%2C+rent+homes%2C+Plano%2C+Frisco%2C+Allen';
var metaContents  = 'Wester+themed+party+facility+in+Plano%2C+Texas.+Premier+rent+houses+in+the+North+Dallas+area.+Seasonal+farmers+market+with+farm+fresh+produce+and+plants.';
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();
};

