/* [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','8601',jdecode('Home'),jdecode(''),'/8601.html','true',[],'',''],
	['PAGE','9443',jdecode('The+Practice'),jdecode(''),'/9443/index.html','true',[ 
		['PAGE','35801',jdecode('Tonsils+%26+Adenoids'),jdecode(''),'/9443/35801.html','true',[],'',''],
		['PAGE','35822',jdecode('Tubes'),jdecode(''),'/9443/35822.html','true',[],'',''],
		['PAGE','35864',jdecode('Nasal+Surgery'),jdecode(''),'/9443/35864.html','true',[],'',''],
		['PAGE','35885',jdecode('Sinus+Surgery'),jdecode(''),'/9443/35885.html','true',[],'','']
	],'',''],
	['PAGE','9464',jdecode('Our+Team'),jdecode(''),'/9464/index.html','true',[ 
		['PAGE','30301',jdecode('Dr.+William+Spencer'),jdecode(''),'/9464/30301.html','true',[],'',''],
		['PAGE','31801',jdecode('Kristine+Colleluori%2C+PA-C'),jdecode(''),'/9464/31801.html','true',[],'',''],
		['PAGE','30343',jdecode('Our+Staff'),jdecode(''),'/9464/30343.html','true',[],'','']
	],'',''],
	['PAGE','14201',jdecode('Contact+Info'),jdecode(''),'/14201/index.html','true',[ 
		['PAGE','34701',jdecode('Office+Hours'),jdecode(''),'/14201/34701.html','true',[],'',''],
		['PAGE','34722',jdecode('Directions'),jdecode(''),'/14201/34722.html','true',[],'',''],
		['PAGE','34743',jdecode('Staff+Extensions'),jdecode(''),'/14201/34743.html','true',[],'','']
	],'',''],
	['PAGE','26801',jdecode('Patient+Portal'),jdecode(''),'/26801/index.html','true',[ 
		['PAGE','19201',jdecode('Patient+Forms'),jdecode(''),'/26801/19201.html','true',[],'',''],
		['PAGE','36101',jdecode('Online+Portal'),jdecode(''),'/26801/36101.html','true',[],'','']
	],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Avocation';
theSitetree.paletteFamily='9590D2';
theSitetree.keyvisualId='4601';
theSitetree.keyvisualName='kv_4601.jpg';
theSitetree.fontsetId='10825';
theSitetree.graphicsetId='11277';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='9590D2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Avocation',
				paletteFamily: 	'9590D2',
				keyvisualId: 	'4601',
				keyvisualName: 	'kv_4601.jpg',
				fontsetId: 		'10825',
				graphicsetId: 	'11277',
				contentColor: 	'FFFFFF',
				contentBGColor: '9590D2',
				a_color: 		'9590D2',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'312C6A',
				e_color: 		'312C6A',
				f_color: 		'312C6A',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20100506-093612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9464',
internalId:  '',
customField: '20100419-152706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100422-092728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20100419-154120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20100519-140731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9443',
internalId:  '',
customField: '20100419-154227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100519-140417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20100419-153557'
};
webappMappings['1501']=webappMappings['1501-7532526']={
webappId:    '1501',
documentId:  '8601',
internalId:  '7532526',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20100519-140532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30343',
internalId:  '',
customField: '20100519-140142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34743',
internalId:  '',
customField: '20100419-152746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34722',
internalId:  '',
customField: '20100422-092803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20100419-152914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35822',
internalId:  '',
customField: '20100419-154120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35864',
internalId:  '',
customField: '20100419-154120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35885',
internalId:  '',
customField: '20100419-154120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20100419-154407'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INLEY2';
var companyName   = 'Long+Island+Otolaryngology+%26+Pediatric+Airway%2C+P.C.';
var htmlTitle	  = 'Long+Island+Otolaryngology+%26+Pediatric+Airway';
var metaKeywords  = '';
var metaContents  = '';
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();
};

