/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','74648',jdecode('Align+your+smile'),jdecode(''),'/74648.html','true',[],'',''],
	['PAGE','73859',jdecode('Preventative+Care'),jdecode(''),'/73859.html','true',[],'',''],
	['PAGE','73868',jdecode('Advanced+Care'),jdecode(''),'/73868.html','true',[],'',''],
	['PAGE','73877',jdecode('Treatment'),jdecode(''),'/73877.html','true',[],'',''],
	['PAGE','552',jdecode('Practice+Hours'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','762',jdecode('How+to+find+us'),jdecode(''),'/552/762.html','true',[],'','']
	],'',''],
	['PAGE','55422',jdecode('Smile+Gallery'),jdecode(''),'/55422.html','true',[],'',''],
	['PAGE','55443',jdecode('About+us'),jdecode(''),'/55443/index.html','true',[ 
		['PAGE','55464',jdecode('The+practice'),jdecode(''),'/55443/55464.html','true',[],'',''],
		['PAGE','720',jdecode('Your+Dentist'),jdecode(''),'/55443/720.html','true',[],'',''],
		['PAGE','55485',jdecode('Community'),jdecode(''),'/55443/55485.html','true',[],'','']
	],'',''],
	['PAGE','825',jdecode('Contact+us'),jdecode(''),'/825/index.html','true',[ 
		['PAGE','7001',jdecode('Imprint+%28follow+up+page%29'),jdecode(''),'/825/7001.html','false',[],'','']
	],'',''],
	['PAGE','30501',jdecode('Information'),jdecode(''),'/30501.html','true',[],'',''],
	['PAGE','55506',jdecode('Educational+links'),jdecode(''),'/55506.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='832A2A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11067';
theSitetree.graphicsetId='11840';
theSitetree.contentColor='2B0606';
theSitetree.contentBGColor='A34242';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Boston',
				paletteFamily: 	'832A2A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11067',
				graphicsetId: 	'11840',
				contentColor: 	'2B0606',
				contentBGColor: 'A34242',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100512-070500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74648',
internalId:  '',
customField: '20081107-171645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73859',
internalId:  '',
customField: '20090710-063442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73877',
internalId:  '',
customField: '20090330-171110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73868',
internalId:  '',
customField: '20081107-172920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100512-065210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20080208-195507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55422',
internalId:  '',
customField: '20071210-183621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55443',
internalId:  '',
customField: '20090330-172057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55464',
internalId:  '',
customField: '20090330-172205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20090330-172327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55485',
internalId:  '',
customField: '20090130-142006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '825',
internalId:  '',
customField: '20071206-144056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20060601-150839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20100222-173038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55506',
internalId:  '',
customField: '20100604-120548'
};
webappMappings['7008']=webappMappings['7008-8081']={
webappId:    '7008',
documentId:  '825',
internalId:  '8081',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX24Y';
var companyName   = 'If+you+are+looking+for+exceptional+dental+care...Look+no+further...';
var htmlTitle	  = 'Brooklyn+Dentist+%7C+Dentist+Brooklyn+NY';
var metaKeywords  = 'cosmetic%2C+dentist%2C+dentistry%2C+fillings%2C+implants%2C+root+canals%2C+endodontic+treatment%2C+dentures%2C+partials%2C+whitening%2C+ZOOM%2C+drill+less+dentistry%2C+Biolase%2C+laser+treatment%2C+family+dentistry%2C+nitrous+oxide%2C+sweet+air%2C+loves+kids%2C+apprehensive+patients%2C+pain+free+dentistry%2C+insurance%2C+financing+available%2C+interest+free+financing%2C+low+monthly+payments%2C+brighten+smile%2C+tooth+colored+fillings%2C+white+fillings%2C+mercury+free+fillings%2Cimplant+restoration%2C+crown%2C+bridges%2Cdigital+Xrays%2C+digital+panorex%2C+smiles%2C+smile+enhancement%2C+smile+make++overs%2C+laminates%2C+veneers%2C+s%2C+tooth+pain+%2C+throbbing%2C+emergency+treatment%2C+swelling%2C+emergency+care%2C+new+patients%2C+conveniently+located%2C+accesible+by+subway%2C+located+near+highway%2C+LIRR%2C+mercury+free%2C+flouride%2C+gum+surgery%2C+gingivectomy%2C+soft+tissue+management%2C+electric+toothbrush%2C+caring%2C+children%2C+geriatrics%2C+oral+evaluation%2C+xrays%2C+bitewings%2C+panoramic+film%2C+prophylaxis%2C+cleanings%2C+oral+hygien+instructions%2C+space+maintainers%2C+sealants%2C++inlay%2C+onlay%2C+stainless+steel+crowns%2C+posts%2C+crown+repair%2C+prosthetics%2C+prosthodontics%2C+implant+restoration%2C+teeth%2C+pediatric+dentistry%2C+wisdom+teeth%2C+consultations%2C+xerostomia%2C+';
var metaContents  = 'root+canal%2C+root+canals%2Ctooth+bleaching%2Ctooth+whitening%2Cteeth+whitening%2C+teeth+bleaching%2Cwedding+teeth+whitening+specials%2Clazer%2CZoom%2Czoom%2Cbleaching%2Cwhite+fillings%2Cwhitefillings%2Ctooth+colored+fillings%2Cno+pain%2Cpainless+dentistry%2Cfillings%2Cguadian+dental+insurance%2Cguardian+insurance%2Cguardian%2Cdentist%2Cdental+hygienist%2Cdental+laser%2Cdental+lazer%2Csmile%2Csmiles%2Cyouthful+smile%2C+younger+smile%2Cgentle%2Ccosmetic+dentistry%2Cgeneral+dentistry%2Croot+canals%2Cpainless+root+canals%2Cbridges%2Cdentures%2Cpartials%2Csmile+makeovers%2Cperiodontal+therapy%2Cemergency+treatment%2C100%25+financing%2Cno+insurance%2Cprivate+patients';
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();
};
