/* [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','1401',jdecode('Home'),jdecode(''),'/1401.html','true',[],''],
	['PAGE','7001',jdecode('Physicians'),jdecode(''),'/7001.html','true',[],''],
	['PAGE','1578',jdecode('Patient+Information'),jdecode(''),'/1578.html','true',[],''],
	['PAGE','38601',jdecode('Weight+Loss+With+HCG'),jdecode(''),'/38601.html','true',[],''],
	['PAGE','39001',jdecode('Bioidentical+HRT'),jdecode(''),'/39001.html','true',[],''],
	['PAGE','39401',jdecode('Botox+and+Fillers'),jdecode(''),'/39401.html','true',[],''],
	['PAGE','1494',jdecode('Products'),jdecode(''),'/1494/index.html','true',[ 
		['PAGE','11701',jdecode('Testimonies'),jdecode(''),'/1494/11701.html','true',[],''],
		['PAGE','7022',jdecode('Gentle+Cleanser'),jdecode(''),'/1494/7022.html','true',[],''],
		['PAGE','7043',jdecode('Revitalizing+Toner'),jdecode(''),'/1494/7043.html','true',[],''],
		['PAGE','9601',jdecode('Acne+Lotion'),jdecode(''),'/1494/9601.html','true',[],''],
		['PAGE','1515',jdecode('12%25+%2B+10+Lotion+'),jdecode(''),'/1494/1515.html','true',[],''],
		['PAGE','1536',jdecode('12%25+Antioxidant+Lotion+'),jdecode(''),'/1494/1536.html','true',[],''],
		['PAGE','1557',jdecode('12%25+Firming+Cream'),jdecode(''),'/1494/1557.html','true',[],''],
		['PAGE','24901',jdecode('Nutraceutical+System'),jdecode(''),'/1494/24901.html','true',[],''],
		['PAGE','24922',jdecode('Joint%2FArthritis+Supple'),jdecode(''),'/1494/24922.html','true',[],'']
	],''],
	['PAGE','7064',jdecode('News'),jdecode(''),'/7064.html','true',[],''],
	['PAGE','9901',jdecode('Driving+directions'),jdecode(''),'/9901.html','true',[],''],
	['PAGE','13601',jdecode('Shop'),jdecode(''),'/13601.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='993333';
theSitetree.keyvisualId='16';
theSitetree.keyvisualName='verlegener_junge.jpg';
theSitetree.fontsetId='20';
theSitetree.graphicsetId='14';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Care',
				paletteFamily: 	'993333',
				keyvisualId: 	'16',
				keyvisualName: 	'verlegener_junge.jpg',
				fontsetId: 		'20',
				graphicsetId: 	'14',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'993333',
				b_color: 		'FFFFCC',
				c_color: 		'000000',
				d_color: 		'6A8493',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '9901',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['4001']=webappMappings['4001-4617909']={
webappId:    '4001',
documentId:  '13601',
internalId:  '4617909',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20090511-191547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20090505-124644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1578',
internalId:  '',
customField: '20080822-122731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38601',
internalId:  '',
customField: '20090912-093430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1494',
internalId:  '',
customField: '20070305-214808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20070304-225650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20070306-201256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20070306-193828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20070306-194819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1515',
internalId:  '',
customField: '20070306-194107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1536',
internalId:  '',
customField: '20070306-195039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1557',
internalId:  '',
customField: '20070306-191632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20070306-192627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24922',
internalId:  '',
customField: '20070306-201728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7064',
internalId:  '',
customField: '20090527-212700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20070227-104517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20070228-141741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20090912-090816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20100101-230839'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INE7S2';
var companyName   = 'Wattles+Park+Family+Practice';
var htmlTitle	  = 'Wattles+Park+Family+Practice';
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();
};
