/* [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','601',jdecode('Oregon+Hearing+Solutions'),jdecode(''),'/601/index.html','true',[ 
		['PAGE','2148',jdecode('Our+office'),jdecode(''),'/601/2148.html','true',[],'',''],
		['PAGE','14601',jdecode('What+to+expect+at+your+first+visit'),jdecode(''),'/601/14601.html','true',[],'',''],
		['PAGE','2801',jdecode('Audiology+Staff'),jdecode(''),'/601/2801.html','true',[],'',''],
		['PAGE','12401',jdecode('HIPAA'),jdecode(''),'/601/12401.html','true',[],'','']
	],'',''],
	['PAGE','652',jdecode('Our+Products+and+Services'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','9901',jdecode('Audiology+Services+'),jdecode(''),'/652/9901.html','true',[],'',''],
		['PAGE','2022',jdecode('Hearing+Aids+'),jdecode(''),'/652/2022.html','true',[],'',''],
		['PAGE','13501',jdecode('Hearing+Aid+Repair'),jdecode(''),'/652/13501.html','true',[],'',''],
		['PAGE','2064',jdecode('Assistive+Listening+Devices'),jdecode(''),'/652/2064.html','true',[],'',''],
		['PAGE','10201',jdecode('Specialized+Earmolds'),jdecode(''),'/652/10201.html','true',[],'',''],
		['PAGE','10222',jdecode('Accessories'),jdecode(''),'/652/10222.html','true',[],'','']
	],'',''],
	['PAGE','4401',jdecode('Audiology+Library'),jdecode(''),'/4401/index.html','true',[ 
		['PAGE','2001',jdecode('Hearing+Loss'),jdecode(''),'/4401/2001.html','true',[],'',''],
		['PAGE','2211',jdecode('Tips+%26+Tricks+'),jdecode(''),'/4401/2211.html','true',[],'',''],
		['PAGE','2232',jdecode('News'),jdecode(''),'/4401/2232.html','true',[],'',''],
		['PAGE','2190',jdecode('Audiology+Links'),jdecode(''),'/4401/2190.html','true',[],'',''],
		['PAGE','2106',jdecode('Radio+%26+TV+Support'),jdecode(''),'/4401/2106.html','true',[],'','']
	],'',''],
	['PAGE','2127',jdecode('Contact+Us'),jdecode(''),'/2127/index.html','true',[ 
		['PAGE','7601',jdecode('email+form'),jdecode(''),'/2127/7601/index.html','true',[ 
			['PAGE','9001',jdecode('email+form+%28follow+up+page%29'),jdecode(''),'/2127/7601/9001.html','false',[],'','']
		],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='18902D';
theSitetree.keyvisualId='7113';
theSitetree.keyvisualName='kv_7113.jpg';
theSitetree.fontsetId='16396';
theSitetree.graphicsetId='12130';
theSitetree.contentColor='717171';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'18902D',
				keyvisualId: 	'7113',
				keyvisualName: 	'kv_7113.jpg',
				fontsetId: 		'16396',
				graphicsetId: 	'12130',
				contentColor: 	'717171',
				contentBGColor: 'E5E2E2',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100401-183220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2148',
internalId:  '',
customField: '20090218-112524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20070323-174051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100401-183508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100401-183259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090116-131902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20090116-132138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2022',
internalId:  '',
customField: '20100506-184518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20070323-180359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2064',
internalId:  '',
customField: '20090218-131614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20070125-040613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10222',
internalId:  '',
customField: '20090224-184405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20070824-105836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20070219-173003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2211',
internalId:  '',
customField: '20070219-173352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2232',
internalId:  '',
customField: '20070131-121018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2190',
internalId:  '',
customField: '20070220-173223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2106',
internalId:  '',
customField: '20071105-165745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2127',
internalId:  '',
customField: '20070323-171724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20070126-113320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20070124-182058'
};
webappMappings['7008']=webappMappings['7008-8002']={
webappId:    '7008',
documentId:  '7601',
internalId:  '8002',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEJ4W';
var companyName   = 'Oregon+Hearing+Solutions';
var htmlTitle	  = 'Oregon+Hearing+Solutions+-+Sherwood+Oregon';
var metaKeywords  = 'audiology+audiologist+hearing+instrument+better+hearing+free+hearing+test+hearing+aids+hearing+testing+assistive+listening+devices+delta+Siemens+Phonak+Oticon+Unitron+Widex+ReSound+Starkey+Sonus+Miracle+Ear+Vivatone+Beltone+Audibel+hearing+planet+open+fit+completely+in+the+canal+hearing+solutions+hearing+protection+earplugs+telephone+amplifier+custom+headphones+hunters+plugs++Newberg+King+City+Tualatin+Beaverton+Sonus+hearing+aids+';
var metaContents  = 'Sherwood+Oregon+digital+hearing+aids%2C+audiology%2C+audiologist+hearing+testing%2C+assistive+listening+devices+and+audiology+resource';
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();
};
