/* [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','5101',jdecode('Home'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','18701',jdecode('LINKS+%26+Search+this+Site'),jdecode(''), jdecode('%2F18701.html'), 'true',[],'',''],
	['PAGE','5152',jdecode('About+the+Clinic'),jdecode(''), jdecode('%2F5152.html'), 'true',[],'',''],
	['PAGE','5173',jdecode('Our+Good+Health+Team+'),jdecode(''), jdecode('%2F5173.html'), 'true',[],'',''],
	['PAGE','48301',jdecode('Meet+Jill+Sheorn+FNP'),jdecode(''), jdecode('%2F48301.html'), 'true',[],'',''],
	['PAGE','5194',jdecode('Our+Location'),jdecode(''), jdecode('%2F5194.html'), 'true',[],'',''],
	['PAGE','5215',jdecode('Clinic+Hours'),jdecode(''), jdecode('%2F5215.html'), 'true',[],'',''],
	['PAGE','5236',jdecode('After+Hours'),jdecode(''), jdecode('%2F5236.html'), 'true',[],'',''],
	['PAGE','5257',jdecode('Hospital+Services'),jdecode(''), jdecode('%2F5257.html'), 'true',[],'',''],
	['PAGE','5299',jdecode('Insurance'),jdecode(''), jdecode('%2F5299.html'), 'true',[],'',''],
	['PAGE','5278',jdecode('Suboxone+%2F+Addictions'),jdecode(''), jdecode('%2F5278.html'), 'true',[],'',''],
	['PAGE','13501',jdecode('Diabetes+Information'),jdecode(''), jdecode('%2F13501.html'), 'true',[],'',''],
	['PAGE','5320',jdecode('Hypertension+Information'),jdecode(''), jdecode('%2F5320.html'), 'true',[],'',''],
	['PAGE','28401',jdecode('Weight+Loss%2F+Obesity'),jdecode(''), jdecode('%2F28401.html'), 'true',[],'',''],
	['PAGE','5341',jdecode('Email+Dr.+Smith'),jdecode(''), jdecode('%2F5341.html'), 'true',[],'',''],
	['PAGE','8801',jdecode('Contact+Us'),jdecode(''), jdecode('%2F8801.html'), 'true',[],'',''],
	['PAGE','26601',jdecode('The+Office+Blog'),jdecode(''), jdecode('%2F26601.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2494';
theSitetree.keyvisualName='arzt.jpg';
theSitetree.fontsetId='436';
theSitetree.graphicsetId='483';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2494',
				keyvisualName: 	'arzt.jpg',
				fontsetId: 		'436',
				graphicsetId: 	'483',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20110327-222614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20111124-233205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20110110-074338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20111022-225035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20100515-145549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5215',
internalId:  '',
customField: '20101127-212659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5236',
internalId:  '',
customField: '20111124-231220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5257',
internalId:  '',
customField: '20111124-231411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5278',
internalId:  '',
customField: '20111124-233744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5299',
internalId:  '',
customField: '20101127-212638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5341',
internalId:  '',
customField: '20110205-182419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5320',
internalId:  '',
customField: '20090512-222426'
};
webappMappings['7008']=webappMappings['7008-13149']={
webappId:    '7008',
documentId:  '8801',
internalId:  '13149',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20111124-230221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090511-223102'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-15603788']={
webappId:    '1501',
documentId:  '5101',
internalId:  '15603788',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20111124-232410'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5194',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '18701',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-8762']={
webappId:    '7050',
documentId:  '26601',
internalId:  '8762',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20100515-152120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20091101-140808'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEFOH';
var companyName   = 'The+Roy+Smith+Family+Clinic';
var htmlTitle	  = 'Roy+Smith+Family+Clinic+';
var metaKeywords  = 'Family+Practice+Medicine+Care+Clinic+Dr+Roy+Smith+Camden+South+Carolina+29020+SC+Suboxone+Addictions+Medical+Office+Primary+Inpatient+Hospital+Prevention++naltrexone+implants+Vivitrol+suboxone+camden+suboxone+camden+addiction+suboxone+camden+sc+south+carolina+naltrexone';
var metaContents  = 'Private+Family+Practice+Medical+Office+in+Camden+South+Carolina.++We+offer+Suboxone+and+Naltrexone+%2F+Vivitrol+Treatment.+We+care+for+the+entire+family%2C+from+babies+to+Grandparents.+We+stress+Preventive+Care+and+agressively+manage+chronic+illnesses+such+as+Diabetes%2C+Hypertension%2C+Lipids.++We+also+have+a+special+interest+in+addictions+care%2C+including+alcohol%2C+narcotics%2C+and+prescription+medications.++We+also+take+care+of+our+patients+admitted+to+our+local+hospital%2C+Kershaw+County+Medical+Center.+++';
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();
};

