/* [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 theSitetree=[ 
	['PAGE','5001',jdecode('Home'),jdecode(''),'/5001.html','true',[],''],
	['PAGE','5052',jdecode('About+Practitioner'),jdecode(''),'/5052.html','true',[],''],
	['PAGE','36101',jdecode('Types+of+Treatment'),jdecode(''),'/36101.html','true',[],''],
	['PAGE','5073',jdecode('About+Acupuncture'),jdecode(''),'/5073.html','true',[],''],
	['PAGE','5094',jdecode('FAQ'),jdecode(''),'/5094.html','true',[],''],
	['PAGE','5115',jdecode('Payment+Options'),jdecode(''),'/5115.html','true',[],''],
	['PAGE','5136',jdecode('Hours+%26+Location'),jdecode(''),'/5136.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8815';
theSitetree.keyvisualName='KV_01.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8815',
				keyvisualName: 	'KV_01.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FFFFFF',
				contentBGColor: '262626',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20091203-202452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20091201-161654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20091203-200255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20091203-204540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20091203-201828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5136',
internalId:  '',
customField: '20091203-205541'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20091128-173546'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2GXO';
var companyName   = 'Marcus+Smith+Acupuncture';
var htmlTitle	  = 'Marcus+Smith+Acupuncture+-+Coral+Spring%2C+Florida';
var metaKeywords  = 'Acupuncture%2C+Pain+Management%2C+Coral+Springs%2C+Florida%2C+Oriental+Medicine%2C+Health%2C+Chronic%2C+Alternative+Health%2C+Auto-Immune%2C+Allergies%2C+Infertility%2C+Chinese%2C+Chinese+Medicine%2C+Mind%2C+Body%2C+Living%2C+Alternative+Medicine%2C+Healthy+Living%2C+Get+Well%2C+Drug+Free%2C+Boca+Raton+Acupuncture%2C+Boca+Raton+Acupuncturist%2C+Coral+Springs+Acupuncture%2C+Coral+Springs+Acupuncturist%2C+33065%2C+33067%2C+Ft.+Lauderdale%2C+Ft.+Lauderdale+Acupuncture%2C+Ft.+Lauderdale+Acupuncturist%2C+Acupuncture+Boca+Raton%2C+Acupuncturist+Boca+Raton%2C+Acupuncturist+Coral+Springs%2C+Acupuncturist+Ft.+Lauderdale%2C+NMT%2C+NMT+Practitioner%2C+Neuro-Modulation+Technique%2C+Micro-Current%2C++Pain+Relief%2C+Deerfield+Beach%2C+Delray+Beach%2C+Pompano+Beach%2C+Acupuncturist%2C+Acupuncture+Physician%2C+Licensed+Acupuncturist%2C+Board-Certified+Acupuncturist%2C+Board-Certified';
var metaContents  = 'Safe%2C+effective%2C+alternative+treatment+which+produces+positive+results+quickly.+Specializing+in+Pain+Management%2C+Internal+and+Preventive+Medicine.+Coral+Springs+Acupuncture';
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();
};
