/* [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(''), jdecode('%2F2601%2Findex.html'), 'true',[ 
		['PAGE','125500',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2601%2F125500.html'), 'true',[],'',''],
		['PAGE','138011',jdecode('Map'),jdecode(''), jdecode('%2F2601%2F138011.html'), 'true',[],'',''],
		['PAGE','139311',jdecode('Directions'),jdecode(''), jdecode('%2F2601%2F139311.html'), 'true',[],'','']
	],'',''],
	['PAGE','2694',jdecode('The+practice'),jdecode(''), jdecode('%2F2694%2Findex.html'), 'true',[ 
		['PAGE','2673',jdecode('Medical+Team'),jdecode(''), jdecode('%2F2694%2F2673.html'), 'true',[],'',''],
		['PAGE','56843',jdecode('Chinese+Medical+Dpt'),jdecode(''), jdecode('%2F2694%2F56843.html'), 'true',[],'',''],
		['PAGE','56822',jdecode('Physical+Therapy+Dpt.'),jdecode(''), jdecode('%2F2694%2F56822.html'), 'true',[],'','']
	],'',''],
	['PAGE','2715',jdecode('Patient+Information'),jdecode(''), jdecode('%2F2715%2Findex.html'), 'true',[ 
		['PAGE','44401',jdecode('New+patients'),jdecode(''), jdecode('%2F2715%2F44401.html'), 'true',[],'',''],
		['PAGE','44422',jdecode('Follow+up+patients'),jdecode(''), jdecode('%2F2715%2F44422.html'), 'true',[],'',''],
		['PAGE','7143',jdecode('Forms'),jdecode(''), jdecode('%2F2715%2F7143.html'), 'true',[],'','']
	],'',''],
	['PAGE','51001',jdecode('Other+Information'),jdecode(''), jdecode('%2F51001%2Findex.html'), 'true',[ 
		['PAGE','53301',jdecode('Recent+Articles'),jdecode(''), jdecode('%2F51001%2F53301.html'), 'true',[],'',''],
		['PAGE','84123',jdecode('Seminars'),jdecode(''), jdecode('%2F51001%2F84123.html'), 'true',[],'',''],
		['PAGE','52543',jdecode('Intersting+Links'),jdecode(''), jdecode('%2F51001%2F52543.html'), 'true',[],'','']
	],'',''],
	['PAGE','181484',jdecode('Articles'),jdecode(''), jdecode('%2F181484%2Findex.html'), 'true',[ 
		['PAGE','181605',jdecode('Hormones'),jdecode(''), jdecode('%2F181484%2F181605.html'), 'true',[],'',''],
		['PAGE','181584',jdecode('Prostate'),jdecode(''), jdecode('%2F181484%2F181584.html'), 'true',[],'',''],
		['PAGE','181626',jdecode('Pelvic+pain'),jdecode(''), jdecode('%2F181484%2F181626.html'), 'true',[],'',''],
		['PAGE','181647',jdecode('Cancer'),jdecode(''), jdecode('%2F181484%2F181647.html'), 'true',[],'','']
	],'',''],
	['PAGE','228806',jdecode('Blog'),jdecode(''), jdecode('%2F228806.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Time';
theSitetree.paletteFamily='330066';
theSitetree.keyvisualId='2288';
theSitetree.keyvisualName='apotheke.jpg';
theSitetree.fontsetId='268';
theSitetree.graphicsetId='337';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC210'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Time',
				paletteFamily: 	'330066',
				keyvisualId: 	'2288',
				keyvisualName: 	'apotheke.jpg',
				fontsetId: 		'268',
				graphicsetId: 	'337',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'330066',
				b_color: 		'07EC28',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '139311',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139311',
internalId:  '',
customField: '20110905-113428'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20111218-113616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2694',
internalId:  '',
customField: '20111218-114602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2715',
internalId:  '',
customField: '20110905-120411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20110905-121203'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '138011',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53301',
internalId:  '',
customField: '20110905-123057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2673',
internalId:  '',
customField: '20110905-120110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84123',
internalId:  '',
customField: '20091216-071241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56822',
internalId:  '',
customField: '20110905-122058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56843',
internalId:  '',
customField: '20110905-121425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51001',
internalId:  '',
customField: '20111218-121457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20111203-173200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44422',
internalId:  '',
customField: '20110905-120805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138011',
internalId:  '',
customField: '20110104-082434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52543',
internalId:  '',
customField: '20110905-124023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125500',
internalId:  '',
customField: '20110905-112823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181484',
internalId:  '',
customField: '20111207-141538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181626',
internalId:  '',
customField: '20110422-204810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181584',
internalId:  '',
customField: '20110616-135036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181605',
internalId:  '',
customField: '20110422-183202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181647',
internalId:  '',
customField: '20110628-161538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '228806',
internalId:  '',
customField: '20110905-130534'
};
var webAppHostname = 'wsc.ehost-services.com:80';
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+Pudental+nerve+neuralgia+Chronic+urologic+conditions+penile+pain+testicular+pain++stones+testosterone+andropause+menopause+bioidentical+homone+replacement+growth+hormone+sexual+dysfunction';
var metaContents  = 'Dr.+Ripoll%E2%80%99s+training+as+a+urologic+oncologist+with+an+emphasis+in+prostate+cancer+and+her+in-depth+knowledge+of+male+hormone+physiology%2C+gives+her+a+unique+ability+to+treat+men+with+hormone+deficiencies+in+a+safe+manner.+++%0AHer+knowledge+and+experience+in+male+hormone+re-balancing+helps+men+improve+their+sense+of+well+being%2C+sexual+desire+and+function%2C+physical+stamina+and+strength%2C+mental+function+and+clarity%2C+memory%2C+and+emotional+well+being.+This+results+in+feeling+rejuvenated+and+capable+of+functioning+at+a+higher+level.+%0A%0A';
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();
};

