/* [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','21820',jdecode('Home'),jdecode(''), jdecode('%2F21820.html'), 'true',[],'',''],
	['PAGE','3171',jdecode('Meet+Our+Specialist'),jdecode(''), jdecode('%2F3171.html'), 'true',[],'',''],
	['PAGE','8220',jdecode('How+To+Find+Us'),jdecode(''), jdecode('%2F8220.html'), 'true',[],'',''],
	['PAGE','56620',jdecode('Service+Branch'),jdecode(''), jdecode('%2F56620.html'), 'true',[],'',''],
	['PAGE','14920',jdecode('Our+Services'),jdecode(''), jdecode('%2F14920.html'), 'true',[],'',''],
	['PAGE','10541',jdecode('Hearing+Instruments'),jdecode(''), jdecode('%2F10541.html'), 'true',[],'',''],
	['PAGE','18920',jdecode('Your+Hearing'),jdecode(''), jdecode('%2F18920.html'), 'true',[],'',''],
	['PAGE','10562',jdecode('Test+Your+Hearing'),jdecode(''), jdecode('%2F10562.html'), 'true',[],'',''],
	['PAGE','10625',jdecode('Brands'),jdecode(''), jdecode('%2F10625.html'), 'true',[],'',''],
	['PAGE','10604',jdecode('Special+Offers'),jdecode(''), jdecode('%2F10604.html'), 'false',[],'',''],
	['PAGE','11020',jdecode('Assistive+Devices'),jdecode(''), jdecode('%2F11020.html'), 'true',[],'',''],
	['PAGE','36620',jdecode('Payment+Options'),jdecode(''), jdecode('%2F36620.html'), 'true',[],'',''],
	['PAGE','40020',jdecode('Newsletter+'),jdecode(''), jdecode('%2F40020.html'), 'true',[],'',''],
	['PAGE','10688',jdecode('Don%26%23x27%3Bs+Blog'),jdecode(''), jdecode('%2F10688.html'), 'true',[],'',''],
	['PAGE','25520',jdecode('Contact+Us'),jdecode(''), jdecode('%2F25520.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='666633';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12761';
theSitetree.contentColor='666633';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'666633',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12761',
				contentColor: 	'666633',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36620',
internalId:  '',
customField: '20110815-172751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3171',
internalId:  '',
customField: '20110831-170257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25520',
internalId:  '',
customField: '20110428-155636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8220',
internalId:  '',
customField: '20110426-092631'
};
webappMappings['7050']=webappMappings['7050-6712']={
webappId:    '7050',
documentId:  '10688',
internalId:  '6712',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10541',
internalId:  '',
customField: '20110920-152547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10562',
internalId:  '',
customField: '20110426-095030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40020',
internalId:  '',
customField: '20110810-154708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10604',
internalId:  '',
customField: '20111102-133014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10625',
internalId:  '',
customField: '20110503-152705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11020',
internalId:  '',
customField: '20110413-120932'
};
webappMappings['7008']=webappMappings['7008-25949']={
webappId:    '7008',
documentId:  '40020',
internalId:  '25949',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10688',
internalId:  '',
customField: '20110517-171511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14920',
internalId:  '',
customField: '20110425-194113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18920',
internalId:  '',
customField: '20110831-175326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21820',
internalId:  '',
customField: '20110831-175449'
};
webappMappings['7008']=webappMappings['7008-23986']={
webappId:    '7008',
documentId:  '25520',
internalId:  '23986',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56620',
internalId:  '',
customField: '20111026-141209'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7KQJ7';
var companyName   = 'All+Major+Brands+for+Every+Budget';
var htmlTitle	  = '21st+Century+Hearing+Center%2C+Quincy%2C+IL';
var metaKeywords  = 'Hearing%2C+hearing+aids%2C+Quincy%2C+Illinois';
var metaContents  = 'Welcome+to+21st+Century+Hearing+Center+and+a+better+way+to+hear.+All+major+brands+of+hearing+instruments+for+every+budget.';
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();
};

