/* [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','2601',jdecode('Home'),jdecode(''),'/2601.html','true',[],'',''],
	['PAGE','2694',jdecode('The+practice'),jdecode(''),'/2694.html','true',[],'',''],
	['PAGE','2652',jdecode('About+us'),jdecode(''),'/2652/index.html','true',[ 
		['PAGE','2673',jdecode('Emilia+Ripoll%2C+MD'),jdecode(''),'/2652/2673.html','true',[],'',''],
		['PAGE','56822',jdecode('F.E.+Boswell%2C+MSPT'),jdecode(''),'/2652/56822.html','true',[],'',''],
		['PAGE','56843',jdecode('Tom+Bunn%2C+Lac'),jdecode(''),'/2652/56843.html','true',[],'',''],
		['PAGE','51001',jdecode('Dr+Ripoll+CV'),jdecode(''),'/2652/51001.html','true',[],'','']
	],'',''],
	['PAGE','2715',jdecode('Patient+Information'),jdecode(''),'/2715/index.html','true',[ 
		['PAGE','44401',jdecode('New+patients'),jdecode(''),'/2715/44401.html','true',[],'',''],
		['PAGE','44422',jdecode('Follow+up+patients'),jdecode(''),'/2715/44422.html','true',[],'','']
	],'',''],
	['PAGE','7143',jdecode('Forms'),jdecode(''),'/7143.html','true',[],'',''],
	['PAGE','52501',jdecode('How+to+find+us'),jdecode(''),'/52501/index.html','true',[ 
		['PAGE','7501',jdecode('Driving+directions'),jdecode(''),'/52501/7501.html','true',[],'',''],
		['PAGE','8601',jdecode('Map'),jdecode(''),'/52501/8601.html','true',[],'','']
	],'',''],
	['PAGE','53301',jdecode('Recent+Articles'),jdecode(''),'/53301.html','true',[],'',''],
	['PAGE','84123',jdecode('Seminars'),jdecode(''),'/84123.html','true',[],'',''],
	['PAGE','52543',jdecode('Intersting+Links'),jdecode(''),'/52543.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='993333';
theSitetree.keyvisualId='209';
theSitetree.keyvisualName='chirug.jpg';
theSitetree.fontsetId='19';
theSitetree.graphicsetId='14';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Care',
				paletteFamily: 	'993333',
				keyvisualId: 	'209',
				keyvisualName: 	'chirug.jpg',
				fontsetId: 		'19',
				graphicsetId: 	'14',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'993333',
				b_color: 		'FFFFCC',
				c_color: 		'000000',
				d_color: 		'6A8493',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '7501',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '8601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090519-142227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2694',
internalId:  '',
customField: '20090311-072441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2652',
internalId:  '',
customField: '20091116-233936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2715',
internalId:  '',
customField: '20090519-142532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20090311-071358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20090311-071526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53301',
internalId:  '',
customField: '20090311-071953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2673',
internalId:  '',
customField: '20081109-121708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84123',
internalId:  '',
customField: '20091216-071241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56822',
internalId:  '',
customField: '20080505-150633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56843',
internalId:  '',
customField: '20081109-124320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51001',
internalId:  '',
customField: '20091216-072518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20061012-153701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44422',
internalId:  '',
customField: '20090519-142825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20060422-192533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20060422-193825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52543',
internalId:  '',
customField: '20071007-185353'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010IN217R';
var companyName   = 'Choices+in+Health%2C+PC';
var htmlTitle	  = 'choicesinehalth';
var metaKeywords  = 'Prostate+cancer++incontinence+++interstitial+cystitis+++pelvic+pain++acupuncture++urology+oncology+HIFU+brachytherapy+seed+implants+radical+prostatectomy+prostatitis+vulvadynia+';
var metaContents  = 'Holistic+urology+practice+++';
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();
};
