/* [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','69501',jdecode('Open+House'),jdecode(''),'/69501.html','false',[],''],
	['PAGE','2501',jdecode('About+Us'),jdecode(''),'/2501.html','true',[],''],
	['PAGE','2552',jdecode('Staff+%26+Locations'),jdecode(''),'/2552.html','true',[],''],
	['PAGE','61101',jdecode('Products'),jdecode(''),'/61101.html','false',[],''],
	['PAGE','61122',jdecode('Products-Unitron'),jdecode(''),'/61122.html','false',[],''],
	['PAGE','62201',jdecode('Products-Siemens'),jdecode(''),'/62201.html','false',[],''],
	['PAGE','66701',jdecode('What+to+Expect'),jdecode(''),'/66701.html','true',[],''],
	['PAGE','66901',jdecode('What+to+Expect-Insurance+Companies'),jdecode(''),'/66901.html','false',[],''],
	['PAGE','66922',jdecode('What+to+Expect-Payment+Options'),jdecode(''),'/66922.html','false',[],''],
	['PAGE','66943',jdecode('What+to+Expect-Privacy+Policy'),jdecode(''),'/66943.html','false',[],''],
	['PAGE','66964',jdecode('What+to+Expect-Financial+Policy'),jdecode(''),'/66964.html','false',[],''],
	['PAGE','52901',jdecode('Referral+Program'),jdecode(''),'/52901.html','true',[],''],
	['PAGE','2573',jdecode('Frequent+Questions'),jdecode(''),'/2573.html','true',[],''],
	['PAGE','53501',jdecode('Resource+Links'),jdecode(''),'/53501.html','true',[],''],
	['PAGE','40801',jdecode('News'),jdecode(''),'/40801.html','false',[],''],
	['PAGE','54701',jdecode('Videos'),jdecode(''),'/54701.html','true',[],''],
	['PAGE','56001',jdecode('Hearing+Aid+Help'),jdecode(''),'/56001.html','true',[],''],
	['PAGE','59001',jdecode('Contact+Us'),jdecode(''),'/59001.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Column';
theSitetree.paletteFamily='45724E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10400';
theSitetree.graphicsetId='10617';
theSitetree.contentColor='121447';
theSitetree.contentBGColor='F8FBF9';
var theTemplate={
				name: 			'Column',
				paletteFamily: 	'45724E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10400',
				graphicsetId: 	'10617',
				contentColor: 	'121447',
				contentBGColor: 'F8FBF9',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'45724E',
				e_color: 		'25542E',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20091119-115732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20090930-124249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20090829-003329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20090930-131141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090829-000359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20090923-174918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20090903-184422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20091026-151027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56001',
internalId:  '',
customField: '20090923-182816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20091026-152057'
};
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: '20091119-130711'
};
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'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INVPPF';
var companyName   = '+++Call%3A+%28360%29+754-0305';
var htmlTitle	  = 'Hearing+Healthcare+Center%2C+Inc.+-+Hearing+Aids+';
var metaKeywords  = 'Hearing%2C+Hearing+Health%2C+Hearing+Information%2C+Hearing+Aids%2C+Aids%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();
};
