/* [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 theSitetree=[ 
	['PAGE','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','17801',jdecode('Animal+Chiropractic'),jdecode(''),'/17801.html','true',[],''],
	['PAGE','23801',jdecode('NEW+Class+IV+Laser+Therapy'),jdecode(''),'/23801.html','true',[],''],
	['PAGE','26501',jdecode('About+the+Doctor'),jdecode(''),'/26501.html','true',[],''],
	['PAGE','17843',jdecode('Business+Hours'),jdecode(''),'/17843.html','true',[],''],
	['PAGE','17864',jdecode('Directions'),jdecode(''),'/17864.html','true',[],''],
	['PAGE','26701',jdecode('Upcoming+Events+%26+Seminars'),jdecode(''),'/26701.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='064B91';
theSitetree.keyvisualId='6717';
theSitetree.keyvisualName='kv_6717.jpg';
theSitetree.fontsetId='11204';
theSitetree.graphicsetId='12013';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E9F3FF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Porthole',
				paletteFamily: 	'064B91',
				keyvisualId: 	'6717',
				keyvisualName: 	'kv_6717.jpg',
				fontsetId: 		'11204',
				graphicsetId: 	'12013',
				contentColor: 	'000000',
				contentBGColor: 'E9F3FF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20090516-071859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20090807-085004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20100319-084456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17843',
internalId:  '',
customField: '20100319-085327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17864',
internalId:  '',
customField: '20090515-230454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20090807-090133'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20100319-090454'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3M2E';
var companyName   = 'PAWSitively+Balanced%2C+Ltd.';
var htmlTitle	  = 'PAWSitively+Balanced%2C+Ltd.+++Dr.+Michelle+Herlihy+veterinary+chiropractic';
var metaKeywords  = 'pawsitively+balanced%2C+veternarian%2C+veterinary%2C+chiropractic%2C+chiropractor%2C+acupuncture%2C+animal%2C+dog%2C+cat%2C+canine%2C+K9%2C+certified%2C+AVCA%2C+American+Veterinary+Chiropractic+Association%2C+AVMA%2C+western+suburb%2C+Chicago%2C+Downers+Grove%2C+IL%2C+Illinois%2C+800+Ogden+Avenue+suite+8%2C+60515';
var metaContents  = 'PAWSitively+Balanced%2C+Ltd.+is+a+veterinary+practice+devoted+to+animal+chiropractic+care+for+dogs+and+cats+in+the+western+suburbs+of+Chicago.800+Ogden+Avenue%2C+Suite+8%2C+Downers+Grove%2C+IL+60515++630-399-5725.+Dr.+Michelle+Herlihy+is+a+veterinarian+certified+in+animal+chiropractic+by+the+American+Veterinary+Chiropractic+Association+and+has+over+10+years+experience+in+traditional+and+alternative+medicine.';
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();
};
