/* [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','552',jdecode('Clinic+Hours'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('About+the+Practice'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','594',jdecode('About+Dr.+Crouch'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','5901',jdecode('Appointments'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','5922',jdecode('Your+First+Visit'),jdecode(''),'/5922.html','true',[],'',''],
	['PAGE','615',jdecode('Meet+Our+Staff'),jdecode(''),'/615.html','true',[],'',''],
	['PAGE','13522',jdecode('Patient+Registration+Forms'),jdecode(''),'/13522.html','true',[],'',''],
	['PAGE','13543',jdecode('Healthcare+Information'),jdecode(''),'/13543.html','true',[],'',''],
	['PAGE','13564',jdecode('Insurance+Plans+We+Accept'),jdecode(''),'/13564.html','true',[],'',''],
	['PAGE','13585',jdecode('Methods+of+Payment'),jdecode(''),'/13585.html','true',[],'',''],
	['PAGE','8301',jdecode('How+to+Find+Us'),jdecode(''),'/8301.html','true',[],'',''],
	['PAGE','14801',jdecode('After+Hours+'),jdecode(''),'/14801.html','true',[],'',''],
	['PAGE','14822',jdecode('Prescription+Refills'),jdecode(''),'/14822.html','true',[],'',''],
	['PAGE','741',jdecode('Contact+Us'),jdecode(''),'/741.html','true',[],'',''],
	['PAGE','17201',jdecode('Billing+Inquiries'),jdecode(''),'/17201.html','true',[],'',''],
	['PAGE','13501',jdecode('Our+Photo+Gallery'),jdecode(''),'/13501.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Layers';
theSitetree.paletteFamily='3FD2D2';
theSitetree.keyvisualId='608';
theSitetree.keyvisualName='artzttasche.jpg';
theSitetree.fontsetId='130';
theSitetree.graphicsetId='147';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='EBF0F0';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Layers',
				paletteFamily: 	'3FD2D2',
				keyvisualId: 	'608',
				keyvisualName: 	'artzttasche.jpg',
				fontsetId: 		'130',
				graphicsetId: 	'147',
				contentColor: 	'666666',
				contentBGColor: 'EBF0F0',
				a_color: 		'669999',
				b_color: 		'C1E0DA',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, 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: '20091203-151056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13564',
internalId:  '',
customField: '20090918-141626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13585',
internalId:  '',
customField: '20090105-195413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20080726-165801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20080801-070851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20090918-142533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13543',
internalId:  '',
customField: '20090918-142408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20080801-070218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14822',
internalId:  '',
customField: '20090918-141921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20080708-155220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20080801-064724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20090406-122926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20080708-155857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13522',
internalId:  '',
customField: '20090918-133802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20080801-065935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '741',
internalId:  '',
customField: '20080801-070639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090406-124644'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFHH4';
var companyName   = 'Crouch+Family+Medicine';
var htmlTitle	  = 'Crouch+Family+Medicine';
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();
};
