/* [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','4901',jdecode('Home'),jdecode(''),'/4901.html','true',[],'',''],
	['PAGE','4952',jdecode('About+us'),jdecode(''),'/4952.html','true',[],'',''],
	['PAGE','4973',jdecode('Services'),jdecode(''),'/4973/index.html','true',[ 
		['PAGE','65023',jdecode('CPAP'),jdecode(''),'/4973/65023.html','true',[],'',''],
		['PAGE','65623',jdecode('CPAP+Masks'),jdecode(''),'/4973/65623.html','true',[],'',''],
		['PAGE','67423',jdecode('Supplies'),jdecode(''),'/4973/67423.html','true',[],'',''],
		['PAGE','27744',jdecode('Respiratory+Services'),jdecode(''),'/4973/27744.html','true',[],'',''],
		['PAGE','27765',jdecode('Oxygen+Therapy'),jdecode(''),'/4973/27765.html','true',[],'','']
	],'',''],
	['PAGE','21323',jdecode('Patient+Education'),jdecode(''),'/21323/index.html','true',[ 
		['PAGE','69523',jdecode('Sleep+Studies'),jdecode(''),'/21323/69523.html','true',[],'',''],
		['PAGE','69723',jdecode('Apnea+Hypopnea+Index'),jdecode(''),'/21323/69723.html','true',[],'',''],
		['PAGE','70623',jdecode('CPAP+Cleaning'),jdecode(''),'/21323/70623.html','true',[],'',''],
		['PAGE','70923',jdecode('Cleaning+CPAP+Supplies'),jdecode(''),'/21323/70923.html','true',[],'','']
	],'',''],
	['PAGE','65044',jdecode('Pediatric'),jdecode(''),'/65044.html','true',[],'',''],
	['PAGE','21344',jdecode('FAQ'),jdecode(''),'/21344.html','true',[],'',''],
	['PAGE','29223',jdecode('Accessories'),jdecode(''),'/29223.html','true',[],'',''],
	['PAGE','21365',jdecode('Interesting+links'),jdecode(''),'/21365.html','true',[],'',''],
	['PAGE','37123',jdecode('Search'),jdecode(''),'/37123.html','true',[],'',''],
	['PAGE','4994',jdecode('How+to+Find+Us'),jdecode(''),'/4994.html','true',[],'',''],
	['PAGE','54823',jdecode('Contact+Us'),jdecode(''),'/54823.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='freeline';
theSitetree.paletteFamily='24363B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10463';
theSitetree.graphicsetId='10906';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E9F0F2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'freeline',
				paletteFamily: 	'24363B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10463',
				graphicsetId: 	'10906',
				contentColor: 	'000000',
				contentBGColor: 'E9F0F2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091125-115932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4952',
internalId:  '',
customField: '20091125-120245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20091125-121326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21344',
internalId:  '',
customField: '20100127-123826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4994',
internalId:  '',
customField: '20091125-122922'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21365',
internalId:  '',
customField: '20090925-173916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21323',
internalId:  '',
customField: '20100127-123616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65023',
internalId:  '',
customField: '20091125-123105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27744',
internalId:  '',
customField: '20091125-123410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27765',
internalId:  '',
customField: '20091125-123451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29223',
internalId:  '',
customField: '20100203-174943'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '37123',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37123',
internalId:  '',
customField: '20090901-174049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54823',
internalId:  '',
customField: '20091125-122959'
};
webappMappings['7008']=webappMappings['7008-11375']={
webappId:    '7008',
documentId:  '54823',
internalId:  '11375',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65044',
internalId:  '',
customField: '20100127-123919'
};
webappMappings['7060']=webappMappings['7060-bf21a064e152095a929dc0a53bf70879']={
webappId:    '7060',
documentId:  '65623',
internalId:  'bf21a064e152095a929dc0a53bf70879',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65623',
internalId:  '',
customField: '20100127-122411'
};
webappMappings['7060']=webappMappings['7060-45e94fe6ab36f22729ad9fee33a0f17c']={
webappId:    '7060',
documentId:  '67423',
internalId:  '45e94fe6ab36f22729ad9fee33a0f17c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67423',
internalId:  '',
customField: '20091023-163623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69523',
internalId:  '',
customField: '20100121-170624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69723',
internalId:  '',
customField: '20100121-171355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70623',
internalId:  '',
customField: '20100203-170929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70923',
internalId:  '',
customField: '20100203-174804'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH572';
var companyName   = 'Respiratory+Sleep+Associates+Inc.+';
var htmlTitle	  = 'Respiratory+Sleep+Associates';
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();
};
