/* [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','164612',jdecode('New+Gifts+for+2011'),jdecode(''), jdecode('%2F164612.html'), 'true',[],'',''],
	['PAGE','162212',jdecode('Holiday+Party+2012'),jdecode(''), jdecode('%2F162212.html'), 'true',[],'',''],
	['PAGE','163712',jdecode('Poinsettia+Care'),jdecode(''), jdecode('%2F163712.html'), 'true',[],'',''],
	['PAGE','119312',jdecode('Home+page'),jdecode(''), jdecode('%2F119312%2Findex.html'), 'true',[ 
		['PAGE','157812',jdecode('Dormant+Tree+Pruning+101'),jdecode(''), jdecode('%2F119312%2F157812.html'), 'true',[],'',''],
		['PAGE','36201',jdecode('Birding+Supplies'),jdecode(''), jdecode('%2F119312%2F36201.html'), 'true',[],'',''],
		['PAGE','56412',jdecode('Bird+Feeding'),jdecode(''), jdecode('%2F119312%2F56412.html'), 'true',[],'',''],
		['PAGE','152312',jdecode('Gazebo+Collection'),jdecode(''), jdecode('%2F119312%2F152312.html'), 'true',[],'',''],
		['PAGE','12048',jdecode('How+to+Find+Wildwood+Road'),jdecode(''), jdecode('%2F119312%2F12048.html'), 'true',[],'',''],
		['PAGE','153012',jdecode('How+to+Find+Babcock+Blvd.'),jdecode(''), jdecode('%2F119312%2F153012.html'), 'true',[],'',''],
		['PAGE','14401',jdecode('Contact+Us'),jdecode(''), jdecode('%2F119312%2F14401.html'), 'true',[],'','']
	],'',''],
	['PAGE','35422',jdecode('Landscape+Design'),jdecode(''), jdecode('%2F35422%2Findex.html'), 'true',[ 
		['PAGE','38701',jdecode('In-Store+Lanscape+Services'),jdecode(''), jdecode('%2F35422%2F38701.html'), 'true',[],'',''],
		['PAGE','12006',jdecode('Outdoor+Living'),jdecode(''), jdecode('%2F35422%2F12006.html'), 'true',[],'',''],
		['PAGE','12027',jdecode('Build+This+Garden'),jdecode(''), jdecode('%2F35422%2F12027.html'), 'true',[],'',''],
		['PAGE','11964',jdecode('Square+Ft.+Calculator'),jdecode(''), jdecode('%2F35422%2F11964.html'), 'true',[],'','']
	],'',''],
	['PAGE','155812',jdecode('Fallingwaters'),jdecode(''), jdecode('%2F155812.html'), 'true',[],'',''],
	['PAGE','10201',jdecode('Best+Rewards+Club'),jdecode(''), jdecode('%2F10201%2Findex.html'), 'true',[ 
		['PAGE','135012',jdecode('About+Us'),jdecode(''), jdecode('%2F10201%2F135012.html'), 'true',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2453';
theSitetree.keyvisualName='garten.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2453',
				keyvisualName: 	'garten.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				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:  '152312',
internalId:  '',
customField: '20110318-113452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20111201-190126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164612',
internalId:  '',
customField: '20111208-145215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12048',
internalId:  '',
customField: '20110103-145518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162212',
internalId:  '',
customField: '20111208-143719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20101228-105027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135012',
internalId:  '',
customField: '20100501-115351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35422',
internalId:  '',
customField: '20110317-184012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153012',
internalId:  '',
customField: '20110103-145500'
};
webappMappings['7008']=webappMappings['7008-7015']={
webappId:    '7008',
documentId:  '14401',
internalId:  '7015',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157812',
internalId:  '',
customField: '20111003-153541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12027',
internalId:  '',
customField: '20100318-081004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11964',
internalId:  '',
customField: '20090321-151529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38701',
internalId:  '',
customField: '20101202-182150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20090322-105616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12006',
internalId:  '',
customField: '20090323-100949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163712',
internalId:  '',
customField: '20111201-185850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155812',
internalId:  '',
customField: '20110601-153918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56412',
internalId:  '',
customField: '20110601-151650'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '12048',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-6885']={
webappId:    '7008',
documentId:  '14401',
internalId:  '6885',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119312',
internalId:  '',
customField: '20111201-191618'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INL9C0';
var companyName   = 'Best+Feeds+Garden+Centers';
var htmlTitle	  = 'Best+Feeds+Garden+Centers';
var metaKeywords  = 'Garden+Centers%2C+Garden+Centers+Pittsburgh%2C+Trees%2C+Shrubs%2C+Organic+Fertilizer%2C+Landscape+Design%2C+Garden+Products%2C+Seeds';
var metaContents  = 'Your+favorite+one+stop+garden+shop.++We+supply+all+the+professional+products+and+support+you+need+to+design+and+maintain+the+garden+of+your+dreams.++See+us+for+garden+design+and+landscape+construction.+';
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();
};

