/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','2701',jdecode('Basic+Info'),jdecode(''),'/2701.html','true',[],'',''],
	['PAGE','2722',jdecode('Our+team'),jdecode(''),'/2722.html','true',[],'',''],
	['PAGE','2743',jdecode('Service'),jdecode(''),'/2743.html','true',[],'',''],
	['PAGE','2764',jdecode('Current+Promotions'),jdecode(''),'/2764.html','true',[],'',''],
	['PAGE','10001',jdecode('Closeout+Corner'),jdecode(''),'/10001.html','true',[],'',''],
	['PAGE','10301',jdecode('Ace+Rewards'),jdecode(''),'/10301.html','true',[],'',''],
	['PAGE','11101',jdecode('Rental+Department'),jdecode(''),'/11101.html','true',[],'',''],
	['PAGE','4001',jdecode('Ace+Hardware+National+Site'),jdecode(''),'/4001.html','true',[],'',''],
	['PAGE','4022',jdecode('Benjamin+Moore+Paints'),jdecode(''),'/4022.html','true',[],'',''],
	['PAGE','7401',jdecode('TommyDocks'),jdecode(''),'/7401.html','true',[],'',''],
	['PAGE','4043',jdecode('Stihl+Power+Equipment'),jdecode(''),'/4043.html','true',[],'',''],
	['PAGE','4064',jdecode('Toro+%26+Lawnboy+Products'),jdecode(''),'/4064.html','true',[],'',''],
	['PAGE','4085',jdecode('Weber+Grills+%26+Accessories'),jdecode(''),'/4085.html','true',[],'',''],
	['PAGE','4106',jdecode('Whitehall+Plaques+%26+Mailboxes'),jdecode(''),'/4106.html','true',[],'',''],
	['PAGE','13501',jdecode('Web+Only+Weekly+Hot+Deals'),jdecode(''),'/13501.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Nucleus';
theSitetree.paletteFamily='A7A37E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33308';
theSitetree.graphicsetId='14175';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='EFECC9';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nucleus',
				paletteFamily: 	'A7A37E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33308',
				graphicsetId: 	'14175',
				contentColor: 	'000000',
				contentBGColor: 'EFECC9',
				a_color: 		'E5D8AF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20091205-170442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4085',
internalId:  '',
customField: '20090220-181313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20091205-170526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20090429-121635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20091120-123931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20090127-184424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20091120-123245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2764',
internalId:  '',
customField: '20091205-164816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20090225-183636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20090225-181208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4106',
internalId:  '',
customField: '20090225-183041'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20090123-131743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20091120-123308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090328-124449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20090225-190612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20091205-165337'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INPLAZ';
var companyName   = 'DELAVAN+ACE+HARDWARE';
var htmlTitle	  = 'Ace+Hardware+Delavan+Wisconsin';
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();
};

