/* [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','4001',jdecode('Home'),jdecode(''),'/4001.html','true',[],'',''],
	['PAGE','4052',jdecode('About+Us'),jdecode(''),'/4052.html','true',[],'',''],
	['PAGE','8001',jdecode('Services+%26+Rates'),jdecode(''),'/8001/index.html','true',[ 
		['PAGE','10101',jdecode('Individual+Daily+Visits'),jdecode(''),'/8001/10101.html','true',[],'',''],
		['PAGE','10122',jdecode('Vacation+Package'),jdecode(''),'/8001/10122.html','true',[],'',''],
		['PAGE','10143',jdecode('PetExec+Package'),jdecode(''),'/8001/10143.html','true',[],'',''],
		['PAGE','10164',jdecode('New+Puppy%2FKitten+Package'),jdecode(''),'/8001/10164.html','true',[],'',''],
		['PAGE','10185',jdecode('Barn+Sitting'),jdecode(''),'/8001/10185.html','true',[],'',''],
		['PAGE','10206',jdecode('House+Sitting'),jdecode(''),'/8001/10206.html','true',[],'',''],
		['PAGE','10227',jdecode('Pet+Taxi'),jdecode(''),'/8001/10227.html','true',[],'',''],
		['PAGE','15601',jdecode('Pet+Supply+Delivery'),jdecode(''),'/8001/15601.html','true',[],'','']
	],'',''],
	['PAGE','8022',jdecode('Our+Customers'),jdecode(''),'/8022.html','true',[],'',''],
	['PAGE','4157',jdecode('Contact+Us'),jdecode(''),'/4157.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='61926E';
theSitetree.keyvisualId='6919';
theSitetree.keyvisualName='kv_6919.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12037';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='80AF8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'61926E',
				keyvisualId: 	'6919',
				keyvisualName: 	'kv_6919.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12037',
				contentColor: 	'FFFFFF',
				contentBGColor: '80AF8C',
				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:  '4001',
internalId:  '',
customField: '20090610-092731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4052',
internalId:  '',
customField: '20090610-092731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20101011-181335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4157',
internalId:  '',
customField: '20090610-092731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20101011-181335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10122',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10143',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10164',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10185',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10206',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10227',
internalId:  '',
customField: '20101011-184139'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20101103-171324'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INLGG4';
var companyName   = 'PawPrints+%26+HoofBeats';
var htmlTitle	  = 'www.PawPrints-n-HoofBeats.com';
var metaKeywords  = 'Pet+sitting%2C+dog+sitting%2C+cat+sitting%2C+dog+care%2C+cat+care%2C+animal+care%2C+horse+care%2C+animal+care%2C+animal+sitting%2C+dog+walking%2C+house+sitting%2C+pet+taxi%2C+equine+care%2C+barn+sitting%2C+pet+care%2C+pet+exercising%2C+pet%2C+dog%2C+cat%2C+horse%2C+livestock%2C+birds%2C+avian+care%2C+reptile+care%2C+bird+care%2C+horse+care%2C+livestock+care';
var metaContents  = 'Pet+Sitting+Service.++Provides+in-home+care+to+pets+an+alternative+to+kennels.++Reliable+and+knowledgeable+pet+care.++';
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();
};

