/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','2420',jdecode('About+us'),jdecode(''),'/2420/index.html','true',[ 
		['PAGE','2441',jdecode('How+to+find+us'),jdecode(''),'/2420/2441.html','true',[],''],
		['PAGE','2462',jdecode('Our+team'),jdecode(''),'/2420/2462.html','true',[],''],
		['PAGE','2483',jdecode('The+practice'),jdecode(''),'/2420/2483.html','true',[],'']
	],''],
	['PAGE','2378',jdecode('Service'),jdecode(''),'/2378.html','true',[],''],
	['PAGE','2252',jdecode('Hours'),jdecode(''),'/2252.html','true',[],''],
	['PAGE','8833',jdecode('Email+Dr.+Atwal'),jdecode(''),'/8833.html','true',[],''],
	['PAGE','2399',jdecode('Contact'),jdecode(''),'/2399.html','true',[],''],
	['PAGE','9112',jdecode('Our+Location'),jdecode(''),'/9112.html','true',[],''],
	['PAGE','10912',jdecode('Your+Experience'),jdecode(''),'/10912.html','true',[],''],
	['PAGE','9133',jdecode('Guestbook'),jdecode(''),'/9133.html','true',[],''],
	['PAGE','2357',jdecode('Interesting+links'),jdecode(''),'/2357.html','true',[],''],
	['PAGE','8812',jdecode('Privacy+Policy'),jdecode(''),'/8812.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='315881';
theSitetree.keyvisualId='2287';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='367';
theSitetree.graphicsetId='419';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='315881';
var theTemplate={
				name: 			'Steps',
				paletteFamily: 	'315881',
				keyvisualId: 	'2287',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'367',
				graphicsetId: 	'419',
				contentColor: 	'FFFFFF',
				contentBGColor: '315881',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'315881',
				b_color: 		'2985B5',
				c_color: 		'3366CC',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20090307-155617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20090307-135532'
};
webappMappings['7008']=webappMappings['7008-2320']={
webappId:    '7008',
documentId:  '8833',
internalId:  '2320',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-3805082']={
webappId:    '1501',
documentId:  '2201',
internalId:  '3805082',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9112',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8833',
internalId:  '',
customField: '20090605-133727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8812',
internalId:  '',
customField: '20090307-132745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20090605-133433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20090213-181047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2399',
internalId:  '',
customField: '20090213-181421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2420',
internalId:  '',
customField: '20090213-181649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2441',
internalId:  '',
customField: '20090213-184647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2462',
internalId:  '',
customField: '20090213-175225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2483',
internalId:  '',
customField: '20090213-175225'
};
webappMappings['1002']=webappMappings['1002-9133ahw050invv5a']={
webappId:    '1002',
documentId:  '9133',
internalId:  '9133ahw050invv5a',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9112',
internalId:  '',
customField: '20090605-133529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9133',
internalId:  '',
customField: '20090605-134033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10912',
internalId:  '',
customField: '20090605-134654'
};
webappMappings['7005']=webappMappings['7005-359']={
webappId:    '7005',
documentId:  '10912',
internalId:  '359',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INVV5A';
var companyName   = 'Adam+Pet+Clinic';
var htmlTitle	  = 'Adam+Pet+Clinic';
var metaKeywords  = 'San+JoseVetVeterinarianBay+AreaPetPet+ClinicAnimal+Clinic';
var metaContents  = 'We+are+a+full+scale+veterinary+clinic+in+the+Bay+Area+servicing+all+of+your+pets+needs.';
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();
};
