/* [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','9401',jdecode('Home'),jdecode(''), jdecode('%2F9401.html'), 'true',[],'',''],
	['PAGE','31001',jdecode('Patient+Portal+%28Email%29'),jdecode(''), jdecode('%2F31001.html'), 'true',[],'',''],
	['PAGE','9452',jdecode('Services+Offered'),jdecode(''), jdecode('%2F9452%2Findex.html'), 'true',[ 
		['PAGE','9473',jdecode('Thyroid'),jdecode(''), jdecode('%2F9452%2F9473.html'), 'true',[],'',''],
		['PAGE','9494',jdecode('Endocrinology'),jdecode(''), jdecode('%2F9452%2F9494.html'), 'true',[],'',''],
		['PAGE','9515',jdecode('Diabetes'),jdecode(''), jdecode('%2F9452%2F9515.html'), 'true',[],'','']
	],'',''],
	['PAGE','9641',jdecode('Patients'),jdecode(''), jdecode('%2F9641%2Findex.html'), 'true',[ 
		['PAGE','9662',jdecode('Appointments'),jdecode(''), jdecode('%2F9641%2F9662.html'), 'true',[],'',''],
		['PAGE','9683',jdecode('Results'),jdecode(''), jdecode('%2F9641%2F9683.html'), 'true',[],'',''],
		['PAGE','15601',jdecode('New+Patients'),jdecode(''), jdecode('%2F9641%2F15601.html'), 'true',[],'','']
	],'',''],
	['PAGE','10101',jdecode('Clinical+Trials'),jdecode(''), jdecode('%2F10101.html'), 'true',[],'',''],
	['PAGE','9536',jdecode('About+Us'),jdecode(''), jdecode('%2F9536%2Findex.html'), 'true',[ 
		['PAGE','9557',jdecode('The+practice'),jdecode(''), jdecode('%2F9536%2F9557.html'), 'true',[],'',''],
		['PAGE','9578',jdecode('Our+team'),jdecode(''), jdecode('%2F9536%2F9578.html'), 'true',[],'',''],
		['PAGE','9599',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F9536%2F9599.html'), 'true',[],'','']
	],'',''],
	['PAGE','9704',jdecode('Contact+Us'),jdecode(''), jdecode('%2F9704.html'), 'true',[],'',''],
	['PAGE','9620',jdecode('Hours+of+Operation'),jdecode(''), jdecode('%2F9620.html'), 'true',[],'',''],
	['PAGE','16701',jdecode('Insurance+Plans'),jdecode(''), jdecode('%2F16701.html'), 'true',[],'',''],
	['PAGE','9725',jdecode('Interesting+Links'),jdecode(''), jdecode('%2F9725.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='315881';
theSitetree.keyvisualId='2285';
theSitetree.keyvisualName='treatment.jpg';
theSitetree.fontsetId='369';
theSitetree.graphicsetId='419';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='315881';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-cbeyon',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Steps',
				paletteFamily: 	'315881',
				keyvisualId: 	'2285',
				keyvisualName: 	'treatment.jpg',
				fontsetId: 		'369',
				graphicsetId: 	'419',
				contentColor: 	'FFFFFF',
				contentBGColor: '315881',
				a_color: 		'315881',
				b_color: 		'2985B5',
				c_color: 		'3366CC',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20120205-222832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9536',
internalId:  '',
customField: '20120203-095043'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14097549']={
webappId:    '1501',
documentId:  '9401',
internalId:  '14097549',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9452',
internalId:  '',
customField: '20090813-165829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9473',
internalId:  '',
customField: '20110425-121649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9494',
internalId:  '',
customField: '20090813-174544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9515',
internalId:  '',
customField: '20110909-164139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9557',
internalId:  '',
customField: '20091014-160856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9578',
internalId:  '',
customField: '20120205-224523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9599',
internalId:  '',
customField: '20100126-131110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9620',
internalId:  '',
customField: '20120103-093832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9641',
internalId:  '',
customField: '20090814-183039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9662',
internalId:  '',
customField: '20090817-122713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9683',
internalId:  '',
customField: '20090817-123531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20110909-180227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9704',
internalId:  '',
customField: '20090817-125222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9725',
internalId:  '',
customField: '20090817-131927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20100126-100435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20110214-183717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20110909-164036'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHS1A';
var companyName   = 'Thyroid%2C+Endocrinology%2C+and+Diabetes';
var htmlTitle	  = 'Thyroid%2C+Endocrinology%2C+and+Diabetes%2C+PA.++%28Dr.+Steve+Fordan%29';
var metaKeywords  = 'endocrinlogist%2C+dallas+endocrinology%2C+dallas+endocrine%2C+endocrine%2C+endocrine+associates+of+dallas%2C+thyroid%2C+endocrinology%2C+diabetes%2C+dallas+thyroid%2C+endocrinologist+dallas%2C+dallas+endocrinologists%2C+diabetes+center%2C+endocrine+associates%2C+dallas+endocrinologist%2C+steve+fordan%2C+north+texas+endocrinology%2C+diabetes+america%2C+osteoporosis%2C+hormone%2C+fordan';
var metaContents  = 'Endocrinologist+conveniently+located+near+Downtown+Dallas.';
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();
};

