/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','9301',jdecode('About+Toggs'),jdecode(''),'/9301.html','true',[],'',''],
	['PAGE','473',jdecode('Our+Does'),jdecode(''),'/473.html','true',[],'',''],
	['PAGE','494',jdecode('Our+Bucks'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','20091',jdecode('Our+Kids'),jdecode(''),'/20091.html','true',[],'',''],
	['PAGE','31801',jdecode('For+Sale'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','19526',jdecode('Photo+Gallery'),jdecode(''),'/19526.html','true',[],'',''],
	['PAGE','17201',jdecode('Shows'),jdecode(''),'/17201.html','true',[],'',''],
	['PAGE','5506',jdecode('Farm+Events'),jdecode(''),'/5506.html','true',[],'',''],
	['PAGE','5401',jdecode('Other+Animals'),jdecode(''),'/5401/index.html','true',[ 
		['PAGE','5422',jdecode('Chickens'),jdecode(''),'/5401/5422.html','true',[],'',''],
		['PAGE','5443',jdecode('Rabbits'),jdecode(''),'/5401/5443.html','true',[],'',''],
		['PAGE','5464',jdecode('Our+Protectors'),jdecode(''),'/5401/5464.html','true',[],'',''],
		['PAGE','5485',jdecode('Barn+Cats'),jdecode(''),'/5401/5485.html','true',[],'',''],
		['PAGE','31822',jdecode('Ducks'),jdecode(''),'/5401/31822.html','true',[],'','']
	],'',''],
	['PAGE','5527',jdecode('Articles'),jdecode(''),'/5527.html','true',[],'',''],
	['PAGE','5548',jdecode('Links'),jdecode(''),'/5548.html','true',[],'',''],
	['PAGE','515',jdecode('Contact+Us'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','5106',jdecode('Guestbook'),jdecode(''),'/5106/index.html','true',[ 
		['PAGE','5101',jdecode('Read+Guestbook'),jdecode(''),'/5106/5101.html','false',[],'','']
	],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20080921-084054'
};
webappMappings['1002']=webappMappings['1002-5106AHW050INX3NG']={
webappId:    '1002',
documentId:  '5106',
internalId:  '5106AHW050INX3NG',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20080725-222557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100720-173721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20091122-211717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19526',
internalId:  '',
customField: '20100720-103551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20090624-204505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5506',
internalId:  '',
customField: '20100311-210352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100720-101034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20080401-151028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20090228-111556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20081219-231642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20100720-102846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5527',
internalId:  '',
customField: '20080316-153056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5548',
internalId:  '',
customField: '20090228-011251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090610-213138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5106',
internalId:  '',
customField: '20080315-235320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20080315-235320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20091',
internalId:  '',
customField: '20100228-111209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20100720-191823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31822',
internalId:  '',
customField: '20100720-101607'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3NG';
var companyName   = 'Togg+Valley+Farm';
var htmlTitle	  = 'Togg+Valley+Farm';
var metaKeywords  = 'Togg+Valley+Farm%2C+Togg%2C+Togg+Valley%2C+Toggenburg%2C+Goats%2C+Dairy%2C+Goat+Milk%2C+Does%2C+Buck%2C+Doe%2C+Bucks';
var metaContents  = 'Small+family+farm+in+Western+Pennsylvania+specializing+in+the+breeding+of+Toggenburg+goats.++We+also+have+Dominique+chickens+and+several+rabbits.';
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();
};
