/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','30523',jdecode('In+Store+Promotions'),jdecode(''),'/30523.html','true',[],''],
	['PAGE','81523',jdecode('Weekly+Circular'),jdecode(''),'/81523.html','true',[],''],
	['PAGE','30223',jdecode('Special+Events'),jdecode(''),'/30223.html','true',[],''],
	['PAGE','522',jdecode('Fast+%26+Fresh+e-magazine'),jdecode(''),'/522.html','true',[],''],
	['PAGE','501',jdecode('Community'),jdecode(''),'/501.html','true',[],''],
	['PAGE','29523',jdecode('Employment'),jdecode(''),'/29523.html','true',[],''],
	['PAGE','38323',jdecode('Sunny+Fields+Produce'),jdecode(''),'/38323.html','true',[],''],
	['PAGE','44523',jdecode('Butcher+Shoppe'),jdecode(''),'/44523.html','true',[],''],
	['PAGE','45023',jdecode('Dockside+Fisheries'),jdecode(''),'/45023.html','true',[],''],
	['PAGE','45123',jdecode('Bake+Shoppe'),jdecode(''),'/45123.html','true',[],''],
	['PAGE','46823',jdecode('Everyday+Low+Prices'),jdecode(''),'/46823.html','true',[],''],
	['PAGE','65623',jdecode('SNS+Perks'),jdecode(''),'/65623.html','true',[],''],
	['PAGE','73923',jdecode('Downtown+Deli'),jdecode(''),'/73923.html','true',[],''],
	['PAGE','84623',jdecode('Mountain+View+Elem.'),jdecode(''),'/84623.html','true',[],''],
	['PAGE','74323',jdecode('Contact+Us'),jdecode(''),'/74323.html','true',[],''],
	['PAGE','89623',jdecode('Hometown+Fan+Club'),jdecode(''),'/89623.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24M']={
webappId:    '5003',
documentId:  '301',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24M',
customField: 'en:US:'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100212-103948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '522',
internalId:  '',
customField: '20090621-083237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100218-091536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29523',
internalId:  '',
customField: '20090918-152325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30223',
internalId:  '',
customField: '20100201-115313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30523',
internalId:  '',
customField: '20100308-105125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38323',
internalId:  '',
customField: '20090508-083940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44523',
internalId:  '',
customField: '20090802-113212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45023',
internalId:  '',
customField: '20090805-111148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45123',
internalId:  '',
customField: '20090805-110623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89623',
internalId:  '',
customField: '20100218-091852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46823',
internalId:  '',
customField: '20090912-091516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65623',
internalId:  '',
customField: '20090918-154114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73923',
internalId:  '',
customField: '20100222-093712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74323',
internalId:  '',
customField: '20090818-184552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81523',
internalId:  '',
customField: '20090922-131134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84623',
internalId:  '',
customField: '20091014-074122'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX23C';
var companyName   = 'Phone+724-532-3939';
var htmlTitle	  = 'Route+30+SHOP+n+SAVE';
var metaKeywords  = '';
var metaContents  = '';
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();
};
