/* [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','5901',jdecode('About+us'),jdecode(''), jdecode('%2F5901%2Findex.html'), 'true',[ 
		['PAGE','6501',jdecode('Services'),jdecode(''), jdecode('%2F5901%2F6501.html'), 'true',[],'',''],
		['PAGE','6543',jdecode('Our+team'),jdecode(''), jdecode('%2F5901%2F6543.html'), 'true',[],'',''],
		['PAGE','6564',jdecode('The+practice'),jdecode(''), jdecode('%2F5901%2F6564.html'), 'true',[],'',''],
		['ITEM','11501',jdecode('Directions'),jdecode(''), jdecode('http%3A%2F%2Fmaps.google.com%2Fmaps%3Fhl%3Den%26ie%3DUTF8%26cid%3D0%2C0%2C14439273737368253816%26fb%3D1%26hq%3Dhampstead%2Bveterinary%2Bhospital%26hnear%3Dnc%26gl%3Dus%26daddr%3D62%2BHighway%2B210%2BWest%2C%2BHampstead%2C%2BNC%2B28443%26geocode%3D12011378068318426225%2C34.367031%2C-77.712564%26ei%3Du1CzS4_ZOsKC8gbrgMm-DA%26ved%3D0CAkQngIwAA%26t%3Dh%26z%3D16'), 'true',[],'','_blank'],
		['PAGE','25501',jdecode('Adoptions'),jdecode(''), jdecode('%2F5901%2F25501.html'), 'true',[],'','']
	],'',''],
	['PAGE','28301',jdecode('New+client+forms'),jdecode(''), jdecode('%2F28301.html'), 'true',[],'',''],
	['PAGE','26301',jdecode('Employment'),jdecode(''), jdecode('%2F26301.html'), 'true',[],'',''],
	['PAGE','6627',jdecode('Contact'),jdecode(''), jdecode('%2F6627.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='363C95';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16629';
theSitetree.graphicsetId='12215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Contrast',
				paletteFamily: 	'363C95',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16629',
				graphicsetId: 	'12215',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20110907-154003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20101222-113948'
};
webappMappings['7008']=webappMappings['7008-16003']={
webappId:    '7008',
documentId:  '6627',
internalId:  '16003',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6543',
internalId:  '',
customField: '20110907-112425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6564',
internalId:  '',
customField: '20110108-114416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28301',
internalId:  '',
customField: '20110416-140720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20110907-135047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6627',
internalId:  '',
customField: '20110108-164507'
};
webappMappings['7060']=webappMappings['7060-16a833356e74bca6e9b646bf5380827d']={
webappId:    '7060',
documentId:  '6543',
internalId:  '16a833356e74bca6e9b646bf5380827d',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-ae298b1df8f876b164b4884f20228394']={
webappId:    '7060',
documentId:  '6564',
internalId:  'ae298b1df8f876b164b4884f20228394',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20110219-110251'
};
webappMappings['7060']=webappMappings['7060-ad74119fe66071bd17b0d5a1dff86978']={
webappId:    '7060',
documentId:  '25501',
internalId:  'ad74119fe66071bd17b0d5a1dff86978',
customField: 'language:en;country:US;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CO7K';
var companyName   = 'HAMPSTEAD+ANIMAL+HOSPITAL+++910-270-4VET+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++';
var htmlTitle	  = '';
var metaKeywords  = 'hamsptead+animal+hospital%2C+hamsptead+animal+hospital+NC%2C+North+Carolina+animal+hospital%2C+vet+clinic+hampstead+NC%2C+hampstead+vet+clinic%2C+hampstead+vet+clinic+NC%2C+hampstead+vet%2C+hampstead+vet+nc%2C+hampstead+nc+vet%2C+hampstead+animal+nc%2C+North+carolina+vet+clinic+hampstead%2C++hampstead+vet+nc%2Chempstead+vet+clinic%2Chempstead+animal+hosptial%2C+hamstead+animal+hospital%2C+hamstead+vet+nc';
var metaContents  = 'Hampsted+Animal+Hospital+North+Carolina';
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();
};

