/* [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','18701',jdecode('Bend+Pet+Resort'),jdecode(''),'/18701.html','true',[],''],
	['PAGE','18752',jdecode('Boarding'),jdecode(''),'/18752.html','true',[],''],
	['PAGE','18773',jdecode('Grooming'),jdecode(''),'/18773/index.html','true',[ 
		['PAGE','18794',jdecode('Specials'),jdecode(''),'/18773/18794.html','true',[],'']
	],''],
	['PAGE','18815',jdecode('Doggy+Daycare'),jdecode(''),'/18815.html','true',[],''],
	['PAGE','18836',jdecode('Training'),jdecode(''),'/18836.html','true',[],''],
	['PAGE','18857',jdecode('What+to+expect'),jdecode(''),'/18857.html','true',[],''],
	['PAGE','18878',jdecode('Boarding+Checklist'),jdecode(''),'/18878.html','true',[],''],
	['PAGE','18899',jdecode('Resources'),jdecode(''),'/18899.html','true',[],''],
	['PAGE','33901',jdecode('Directions'),jdecode(''),'/33901.html','true',[],''],
	['PAGE','38301',jdecode('Email+B.P.R'),jdecode(''),'/38301.html','true',[],''],
	['PAGE','35001',jdecode('F.A.Q'),jdecode(''),'/35001.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Celebration';
theSitetree.paletteFamily='4B9055';
theSitetree.keyvisualId='3790';
theSitetree.keyvisualName='kv_3790.jpg';
theSitetree.fontsetId='10583';
theSitetree.graphicsetId='10985';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Celebration',
				paletteFamily: 	'4B9055',
				keyvisualId: 	'3790',
				keyvisualName: 	'kv_3790.jpg',
				fontsetId: 		'10583',
				graphicsetId: 	'10985',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4B9055',
				e_color: 		'4B9055',
				f_color: 		'4B9055',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20090602-141736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18752',
internalId:  '',
customField: '20090518-093958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18857',
internalId:  '',
customField: '20090513-184848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18773',
internalId:  '',
customField: '20090513-112202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18794',
internalId:  '',
customField: '20090513-190621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18815',
internalId:  '',
customField: '20090518-093905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18836',
internalId:  '',
customField: '20090602-113034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18878',
internalId:  '',
customField: '20090513-140727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18899',
internalId:  '',
customField: '20090602-133130'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '33901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20090513-123709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20090518-094406'
};
webappMappings['7008']=webappMappings['7008-3525']={
webappId:    '7008',
documentId:  '38301',
internalId:  '3525',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20090602-142059'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INE01P';
var companyName   = 'Bend+Pet+Resort+LLC';
var htmlTitle	  = 'Bend+Pet+Resort+LLC';
var metaKeywords  = 'dog%2C+cat%2C+boarding%2C+kennel%2C+grooming%2C+trim+nails%2C+training%2C+Meridith+Gage%2C+Ken+Granacki%2C+Snowater+Samoyeds%2C+doggie+daycare%2C+Central+Oregon%2C+Bend+Oregon%2C+handling%2C+samoyed';
var metaContents  = 'Bend+Pet+Resort+is+an+interactive+pet+care+facility%2C+that+caters+to+the+pet+owner+who+wants+the+best+care+and+accommodations+for+their+pets.++Central+Oregons+%231+Choice+for+Boarding%2C+Grooming%2C+Doggy-Daycare%2C+and+Training.+Awarded+Bend+Livings+Best+of+Bend+Award+2008+for+Central+Oregons+Best+Lodging+for+Pets.';
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();
};
