/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','1015',jdecode('Services'),jdecode(''), jdecode('%2F1015%2Findex.html'), 'true',[ 
		['PAGE','1036',jdecode('Routine+Vision+Care'),jdecode(''), jdecode('%2F1015%2F1036.html'), 'true',[],'',''],
		['PAGE','1057',jdecode('Non-Routine+Care'),jdecode(''), jdecode('%2F1015%2F1057.html'), 'true',[],'','']
	],'',''],
	['PAGE','952',jdecode('Staff'),jdecode(''), jdecode('%2F952%2Findex.html'), 'true',[ 
		['PAGE','973',jdecode('Dr+Nathan+L+Scott'),jdecode(''), jdecode('%2F952%2F973.html'), 'true',[],'',''],
		['PAGE','994',jdecode('Staff%2FTechnicians'),jdecode(''), jdecode('%2F952%2F994.html'), 'true',[],'','']
	],'',''],
	['PAGE','45634',jdecode('Patient+Education'),jdecode(''), jdecode('%2F45634%2Findex.html'), 'true',[ 
		['PAGE','7543',jdecode('Seen+%26+Heard'),jdecode(''), jdecode('%2F45634%2F7543.html'), 'true',[],'',''],
		['PAGE','80960',jdecode('eNewsletters'),jdecode(''), jdecode('%2F45634%2F80960.html'), 'false',[],'',''],
		['PAGE','67555',jdecode('3D+Eye+Library'),jdecode(''), jdecode('%2F45634%2F67555.html'), 'true',[],'','']
	],'',''],
	['PAGE','1078',jdecode('Products'),jdecode(''), jdecode('%2F1078%2Findex.html'), 'true',[ 
		['PAGE','1099',jdecode('Frames'),jdecode(''), jdecode('%2F1078%2F1099.html'), 'true',[],'',''],
		['PAGE','40023',jdecode('Sunglasses+%2F+Snow'),jdecode(''), jdecode('%2F1078%2F40023.html'), 'true',[],'',''],
		['PAGE','21423',jdecode('Lens+Designs'),jdecode(''), jdecode('%2F1078%2F21423.html'), 'true',[],'',''],
		['PAGE','1120',jdecode('Lens+Materials'),jdecode(''), jdecode('%2F1078%2F1120.html'), 'true',[],'',''],
		['PAGE','37423',jdecode('Bolle%26%23x27%3B+Rx+Lenses'),jdecode(''), jdecode('%2F1078%2F37423.html'), 'false',[],'',''],
		['PAGE','37444',jdecode('Nike+Rx+Lenses'),jdecode(''), jdecode('%2F1078%2F37444.html'), 'false',[],'',''],
		['PAGE','36423',jdecode('Serengeti+Rx+Lenses'),jdecode(''), jdecode('%2F1078%2F36423.html'), 'false',[],'',''],
		['PAGE','29023',jdecode('Buying+Glasses'),jdecode(''), jdecode('%2F1078%2F29023.html'), 'false',[],'',''],
		['PAGE','21444',jdecode('Lens+Upgrades'),jdecode(''), jdecode('%2F1078%2F21444.html'), 'true',[],'',''],
		['PAGE','1141',jdecode('Contact+Lenses'),jdecode(''), jdecode('%2F1078%2F1141.html'), 'true',[],'',''],
		['PAGE','31823',jdecode('Contact+Lens+Care'),jdecode(''), jdecode('%2F1078%2F31823.html'), 'true',[],'','']
	],'',''],
	['PAGE','31323',jdecode('Purchase+Contacts'),jdecode(''), jdecode('%2F31323.html'), 'true',[],'',''],
	['PAGE','7501',jdecode('Forms'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','65855',jdecode('CareCredit'),jdecode(''), jdecode('%2F65855.html'), 'true',[],'',''],
	['PAGE','7522',jdecode('Preferred+Specialists'),jdecode(''), jdecode('%2F7522.html'), 'true',[],'',''],
	['PAGE','17012',jdecode('Location'),jdecode(''), jdecode('%2F17012.html'), 'true',[],'',''],
	['PAGE','27223',jdecode('Survey'),jdecode(''), jdecode('%2F27223.html'), 'false',[],'',''],
	['PAGE','1183',jdecode('Contact'),jdecode(''), jdecode('%2F1183%2Findex.html'), 'true',[ 
		['PAGE','13701',jdecode('E-Mail+Contact+List'),jdecode(''), jdecode('%2F1183%2F13701.html'), 'true',[],'',''],
		['PAGE','13801',jdecode('E-Mail+List'),jdecode(''), jdecode('%2F1183%2F13801.html'), 'false',[],'','']
	],'',''],
	['PAGE','28223',jdecode('Espanol%2FSpanish'),jdecode(''), jdecode('%2F28223.html'), 'false',[],'',''],
	['PAGE','43034',jdecode('Employment'),jdecode(''), jdecode('%2F43034.html'), 'false',[],'','']];
var siteelementCount=34;
theSitetree.topTemplateName='echo';
theSitetree.paletteFamily='712A2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10623';
theSitetree.graphicsetId='10630';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'echo',
				paletteFamily: 	'712A2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10623',
				graphicsetId: 	'10630',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-876269']={
webappId:    '1501',
documentId:  '901',
internalId:  '876269',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20081126-202227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20110519-153602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20081111-165142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20081126-202241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20100311-230958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20091204-172023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100315-233302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20090513-215131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20111121-215410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20081126-234406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1141',
internalId:  '',
customField: '20081126-225608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21423',
internalId:  '',
customField: '20081126-233351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20101019-185817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20081114-164519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7543',
internalId:  '',
customField: '20110131-161525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20100428-160223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20100311-234541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20081113-164403'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17012',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17012',
internalId:  '',
customField: '20100316-001259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21444',
internalId:  '',
customField: '20100111-154409'
};
webappMappings['7005']=webappMappings['7005-100']={
webappId:    '7005',
documentId:  '27223',
internalId:  '100',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27223',
internalId:  '',
customField: '20100322-150114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29023',
internalId:  '',
customField: '20081126-212411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28223',
internalId:  '',
customField: '20081126-204853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31323',
internalId:  '',
customField: '20091204-172147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31823',
internalId:  '',
customField: '20081126-232111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36423',
internalId:  '',
customField: '20110316-125551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37423',
internalId:  '',
customField: '20110316-124540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37444',
internalId:  '',
customField: '20110316-124912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40023',
internalId:  '',
customField: '20110316-130011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43034',
internalId:  '',
customField: '20091120-180406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45634',
internalId:  '',
customField: '20091204-173207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65855',
internalId:  '',
customField: '20101119-172058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67555',
internalId:  '',
customField: '20100311-235147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80960',
internalId:  '',
customField: '20110202-103506'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INE1PQ';
var companyName   = 'Spectrum+Eye+Care';
var htmlTitle	  = 'Spectrum+Eye+Care+-+Chelan';
var metaKeywords  = 'Spectrum+Eye+Care+Eye+Care+Optometrist+Optometry+Chelan+Eyeglass+Eyeglasses+Contacts+Contact+Lenses++Lake+Chelan+lasik+cataract+glaucoma+sunglass+sunglasses+surgery+ophthalmology+ophthalmologist';
var metaContents  = 'Spectrum+Eye+Care+-+Chelan%2C+WA';
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();
};

