/* [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','23201',jdecode('About+Us+%2F+Home'),jdecode(''),'/23201.html','true',[],''],
	['PAGE','20201',jdecode('Contact+Us+%26+Map'),jdecode(''),'/20201.html','true',[],''],
	['PAGE','46002',jdecode('Current+Promotions'),jdecode(''),'/46002.html','true',[],''],
	['PAGE','45502',jdecode('Meet+Our+Doctors'),jdecode(''),'/45502.html','true',[],''],
	['PAGE','31601',jdecode('Tour+Our+Hospital'),jdecode(''),'/31601.html','true',[],''],
	['PAGE','23801',jdecode('Symptoms+Of+A+Sick+Cat'),jdecode(''),'/23801.html','true',[],''],
	['PAGE','23243',jdecode('Medicating+Your+Cat'),jdecode(''),'/23243.html','true',[],''],
	['PAGE','21301',jdecode('Rescue+%26+Adoption'),jdecode(''),'/21301/index.html','true',[ 
		['PAGE','53899',jdecode('Adopting+a+New+Cat'),jdecode(''),'/21301/53899.html','true',[],''],
		['PAGE','53908',jdecode('Giving+a+Cat+Away'),jdecode(''),'/21301/53908.html','true',[],'']
	],''],
	['PAGE','47002',jdecode('Preparing+For+Your+Visit'),jdecode(''),'/47002/index.html','true',[ 
		['PAGE','54444',jdecode('Anesthesia%2C+what+to+expect'),jdecode(''),'/47002/54444.html','true',[],'']
	],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='441';
theSitetree.graphicsetId='497';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='a1c6c6';
var theTemplate={
				name: 			'Round',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'441',
				graphicsetId: 	'497',
				contentColor: 	'FFFFFF',
				contentBGColor: 'a1c6c6',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'a1c6c6',
				b_color: 		'669999',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '20201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54444',
internalId:  '',
customField: '20100116-010523'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '23201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46002',
internalId:  '',
customField: '20100108-022500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45502',
internalId:  '',
customField: '20100116-005734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20100115-233713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100116-003924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20100116-004251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20100115-234031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23243',
internalId:  '',
customField: '20100116-004904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20100116-002451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47002',
internalId:  '',
customField: '20100108-013502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53908',
internalId:  '',
customField: '20100116-004743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53899',
internalId:  '',
customField: '20100116-004651'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXE2K';
var companyName   = 'All+About+Cats+Vet+Hospital+%28702%29+257-3222+';
var htmlTitle	  = 'All+About+Cats+Veterinary+Hospital++ph%3A%28702%29+257-3222';
var metaKeywords  = 'veterinarian%2C+cat+care%2C+veterinarian+in%2C+cat+food%2C+cat+health%2C+pet+care%2C+veterinarian+las+vegas%2C+veterinary+care+las+vegas%2C+las+vegas+vet%2C+cat+vet+las+vegas%2Cvet+for+cat+in+las+vegas%2C+sick+cat%2C+feline+veterinarian+las+vegas%2C+cat+veterinarian%2C+cat+vet%2C+cat+vaccines+in+las+vegas%2C+spay+and+neuter%2C+cat+grooming%2C+feline+grooming%2C+shave+a+cat%2C+cat+boarding%2C+cat+sitting%2C+nevada+veterinarian%2C+all+about+cats+veterinary+hospital%2C+all+about+cats%2C+heaven+can+wait+animal+sanctuary%2C+cat+food%2C+Science+diet+cat+food%2C+royal+canin+cat+food%2C+cat+supplies%2C+cat+health%2C+pet+food%2C+pet+supplies%2C+cat+behavior%2C+';
var metaContents  = 'Experienced%2C+loving+care+just+for+cats%21+We+offer+complete+feline+medical+and+surgical+care%2C+behavioral+counseling%2C+a+full+boarding+facility+and+grooming+services.';
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();
};
