/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','1801',jdecode('Care+Philosophy'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1822',jdecode('Professional+Bio'),jdecode(''),'/1822.html','true',[],'',''],
	['PAGE','21701',jdecode('New+Appointments'),jdecode(''),'/21701.html','true',[],'',''],
	['PAGE','4701',jdecode('Why+a+Child+Psychiatrist%3F'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','1843',jdecode('Services+Provided'),jdecode(''),'/1843/index.html','true',[ 
		['PAGE','1864',jdecode('Child+%26+Adolescent+Psychiatry'),jdecode(''),'/1843/1864.html','true',[],'',''],
		['PAGE','1885',jdecode('Adult+Psychiatry'),jdecode(''),'/1843/1885.html','true',[],'',''],
		['PAGE','1906',jdecode('Family+Psychiatry'),jdecode(''),'/1843/1906.html','true',[],'','']
	],'',''],
	['PAGE','6401',jdecode('Helpful+Resource+Links'),jdecode(''),'/6401/index.html','true',[ 
		['PAGE','6422',jdecode('Professional+Organizations'),jdecode(''),'/6401/6422.html','true',[],'',''],
		['PAGE','6443',jdecode('Medical+Excellence'),jdecode(''),'/6401/6443.html','true',[],'',''],
		['PAGE','6464',jdecode('Mental+Health+on+Line'),jdecode(''),'/6401/6464.html','true',[],'',''],
		['PAGE','12101',jdecode('Support+and+Advocacy'),jdecode(''),'/6401/12101.html','true',[],'','']
	],'',''],
	['PAGE','2011',jdecode('Online+Screening+Forms'),jdecode(''),'/2011.html','true',[],'',''],
	['PAGE','7201',jdecode('Discounted+Medications'),jdecode(''),'/7201.html','true',[],'',''],
	['PAGE','28201',jdecode('Free+Learning+Programs'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','1927',jdecode('Contact'),jdecode(''),'/1927.html','true',[],'',''],
	['PAGE','3601',jdecode('Map'),jdecode(''),'/3601.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='AC2E53';
theSitetree.keyvisualId='7103';
theSitetree.keyvisualName='kv_7103.jpg';
theSitetree.fontsetId='16395';
theSitetree.graphicsetId='12128';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'AC2E53',
				keyvisualId: 	'7103',
				keyvisualName: 	'kv_7103.jpg',
				fontsetId: 		'16395',
				graphicsetId: 	'12128',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090309-115513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20100430-105746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20080901-181410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1822',
internalId:  '',
customField: '20091218-133227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20080901-181450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1843',
internalId:  '',
customField: '20090309-115409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1864',
internalId:  '',
customField: '20090309-120130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1885',
internalId:  '',
customField: '20090601-073740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1906',
internalId:  '',
customField: '20090309-092014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20080830-164957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20080827-151120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6443',
internalId:  '',
customField: '20080815-203707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6464',
internalId:  '',
customField: '20080822-143657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20080822-143121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2011',
internalId:  '',
customField: '20100106-204900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20090802-132652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1927',
internalId:  '',
customField: '20080830-174630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20080830-175311'
};
webappMappings['1501']=webappMappings['1501-3451911']={
webappId:    '1501',
documentId:  '701',
internalId:  '3451911',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20090226-121855'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INV4UD';
var companyName   = 'Child+Adolescent+and+Adult+Psychiatry';
var htmlTitle	  = 'www.mmunirmd.com';
var metaKeywords  = 'Psychiatrist+Carmel%2Cfishers%2Cchild+psychiatrist+carmel%2Cfishers%2Ccouples+therapy%2Cmedication+management%2C+psychotherapy%2C+child+psychiatrist%2C+adolescent+psychiatrist%2C+Fishers%2C+Carmel%2C+Munir%2C+SMA%2C+Depression%2C+Anxiety%2C+Bipolar+disorder%2C+psychosis%2C+school+refusal%2C+emotional+outbursts%2C+teenage+issues%2C+Teenagers+depression+%2Cteenagers+anger%2C+teenager+anxiety%2C+childhood+abuse%2C+martial+problems%2C+infidelity%2C+divorce%2C+adult+psychiatrist%2C+benzodiazepine+medications%2C+job+issues%2C+job+problems%2C+Cognitive+behavioral+therapy%2C+CBT%2CPsychodynamic+therapy%2C+couples+therapy%2C+family+therapy%2C+Prozac%2C+celexa+%2Cklonopin%2Cantidepressants%2C+anti+anxiety+medications%2Chealthgrades.com%2C+vitals.com%2Csuicide';
var metaContents  = 'Serenity+Medical+Associates+treats+child+adolescent+and+adult+psychiatry+patients+with+goals+of+providing+psychiatric+care%2C+improving+their+quality+of+life%2C+and+increasing+their+activity+level.';
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();
};
