/* [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','69501',jdecode('Dec-+Open+House'),jdecode(''),'/69501.html','false',[],'',''],
	['PAGE','84101',jdecode('Better+Hearing+Event'),jdecode(''),'/84101.html','false',[],'',''],
	['PAGE','2501',jdecode('About+Us'),jdecode(''),'/2501.html','true',[],'',''],
	['PAGE','61101',jdecode('Products'),jdecode(''),'/61101/index.html','false',[ 
		['PAGE','61122',jdecode('Unitron'),jdecode(''),'/61101/61122.html','true',[],'',''],
		['PAGE','62201',jdecode('Siemens'),jdecode(''),'/61101/62201.html','true',[],'',''],
		['PAGE','81701',jdecode('Phonak'),jdecode(''),'/61101/81701.html','true',[],'',''],
		['PAGE','81722',jdecode('GN+Resound'),jdecode(''),'/61101/81722.html','true',[],'','']
	],'',''],
	['PAGE','66701',jdecode('What+to+Expect'),jdecode(''),'/66701/index.html','true',[ 
		['PAGE','66901',jdecode('Insurance+Companies'),jdecode(''),'/66701/66901.html','true',[],'',''],
		['PAGE','66922',jdecode('Payment+Options'),jdecode(''),'/66701/66922.html','true',[],'',''],
		['PAGE','66943',jdecode('Privacy+Policy'),jdecode(''),'/66701/66943.html','true',[],'',''],
		['PAGE','66964',jdecode('Financial+Policy'),jdecode(''),'/66701/66964.html','true',[],'','']
	],'',''],
	['PAGE','2552',jdecode('Staff+%26+Locations'),jdecode(''),'/2552.html','true',[],'',''],
	['PAGE','52901',jdecode('Referral+Program'),jdecode(''),'/52901.html','true',[],'',''],
	['PAGE','54701',jdecode('Hearing+Aid+Videos'),jdecode(''),'/54701.html','true',[],'',''],
	['PAGE','81501',jdecode('Leased+Hearing+Aids'),jdecode(''),'/81501.html','true',[],'',''],
	['PAGE','40801',jdecode('News'),jdecode(''),'/40801.html','false',[],'',''],
	['PAGE','2573',jdecode('Frequent+Questions'),jdecode(''),'/2573.html','true',[],'',''],
	['PAGE','56001',jdecode('Hearing+Aid+Help'),jdecode(''),'/56001.html','true',[],'',''],
	['PAGE','53501',jdecode('Resource+Links'),jdecode(''),'/53501.html','true',[],'',''],
	['PAGE','59001',jdecode('Contact+Us'),jdecode(''),'/59001.html','true',[],'',''],
	['PAGE','82901',jdecode('E-mail+Us'),jdecode(''),'/82901.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2454';
theSitetree.keyvisualName='generationen.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='462';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2454',
				keyvisualName: 	'generationen.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'462',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20100111-125643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20100326-184403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20100319-155558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20100319-160645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090829-000359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20100319-155629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20100319-155502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20100329-154905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56001',
internalId:  '',
customField: '20100319-160241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20100323-114425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61122',
internalId:  '',
customField: '20091021-153158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62201',
internalId:  '',
customField: '20091021-155253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66701',
internalId:  '',
customField: '20100601-153211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66901',
internalId:  '',
customField: '20091022-164726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66943',
internalId:  '',
customField: '20091022-163922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66964',
internalId:  '',
customField: '20091022-164624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66922',
internalId:  '',
customField: '20091119-132109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69501',
internalId:  '',
customField: '20091119-130442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81501',
internalId:  '',
customField: '20100326-183240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81701',
internalId:  '',
customField: '20100323-114312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81722',
internalId:  '',
customField: '20100323-114312'
};
webappMappings['7008']=webappMappings['7008-7317']={
webappId:    '7008',
documentId:  '82901',
internalId:  '7317',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82901',
internalId:  '',
customField: '20100329-160208'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84101',
internalId:  '',
customField: '20100503-151850'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVPPF';
var companyName   = 'Complimentary+Consults%3A+%28360%29754-0305';
var htmlTitle	  = 'Hearing+Healthcare+Center%2C+Inc.+-+Hearing+Aids+';
var metaKeywords  = 'Hearing%2C+Hearing+Health%2C+Hearing+Information%2C+Hearing+Aids%2C+Hearing+Loss%2C+Hearing+Test%2C+Child+Hearing+Test%2C+Assistive+Listening%2C+Amplified+Telephones%2C+Earplugs%2C+Ear+Protection%2C+Audiologist%2C+Audiology%2C+Tacoma%2C+Olympia%2C+Chehalis%2C+Workers+Compensation%2C+Labor+and+Industries%2C+HearPO%2C+Insurance%2C+Medicare%2C+Batteries%2C+Patient+Care%2C+Ears%2C+Tinnitus%2C+Testing%2C+Amplification%2C+Ear%2C+Hear%2C+Counseling%2C+Technology';
var metaContents  = 'Hearing+Healthcare+Center%2C+Inc.+Hearing+Healthcare+Center+is+dedicated+to+providing+our+patients+with+top+of+the+line+hearing+aid+technology+and+services+at+the+best+price.++We+realize+that+youre+about+to+make+the+important+decision+to+reconnect+with+the+world+around+you.';
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();
};
