/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','601',jdecode('About+us'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','643',jdecode('Plants+Available'),jdecode(''),'/643/index.html','true',[ 
		['PAGE','33912',jdecode('Monthly+Sale+Items'),jdecode(''),'/643/33912.html','true',[],'','']
	],'',''],
	['PAGE','664',jdecode('Services'),jdecode(''),'/664.html','true',[],'',''],
	['PAGE','769',jdecode('Tips+%26+Tricks'),jdecode(''),'/769/index.html','true',[ 
		['PAGE','54412',jdecode('Newsletter'),jdecode(''),'/769/54412.html','true',[],'','']
	],'',''],
	['PAGE','706',jdecode('Contact'),jdecode(''),'/706/index.html','true',[ 
		['PAGE','14901',jdecode('Map'),jdecode(''),'/706/14901.html','true',[],'','']
	],'',''],
	['PAGE','49712',jdecode('Photo+Album'),jdecode(''),'/49712.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='B42F2F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16627';
theSitetree.graphicsetId='12213';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Contrast',
				paletteFamily: 	'B42F2F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16627',
				graphicsetId: 	'12213',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTCPH7']={
webappId:    '5003',
documentId:  '401',
internalId:  'tid:1;pid:WSCSYSSSSLYTCPH7',
customField: 'en:US:'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100803-140623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '769',
internalId:  '',
customField: '20100701-095752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '643',
internalId:  '',
customField: '20100225-134616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100114-141458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '664',
internalId:  '',
customField: '20100701-095719'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33912',
internalId:  '',
customField: '20100803-140910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '706',
internalId:  '',
customField: '20100728-141106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20081113-084153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49712',
internalId:  '',
customField: '20091029-134812'
};
webappMappings['7060']=webappMappings['7060-c04d0263aed90e5db642844b3818f3de']={
webappId:    '7060',
documentId:  '49712',
internalId:  'c04d0263aed90e5db642844b3818f3de',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54412',
internalId:  '',
customField: '20100114-142233'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVY7G';
var companyName   = 'Wilmington%2C+NC++++++910-762-8637+++';
var htmlTitle	  = 'Five+Oaks+Nursery.+Quality+Plants+at+Affordable+Prices.++';
var metaKeywords  = 'azalea%2C+shrubs%2C+trees%2C+roses%2C+annuals%2C+perennials%2C+plants%2C+nursery%2C+wilmington%2Bnc%2C+knockout%2C++Encore%2C+little+gem%2C+live+oak%2C+evergreen%2C+deciduous%2C+perennials%2C+annuals%2C++plants%2C+design%2C+landscape%2C+native%2C+local%2C+design+service%2C+landscape+plants%2C+flowers%2C+palm%2C+ornamental+grasses%2C+formosa%2C+indica+azalea%2C+foundation+plants%2C+rose%2C+boxwood%2C+ligustrium%2C+';
var metaContents  = 'Five+Oaks+Nursery+is+a+Retail+and+Wholesale+nursery+serving+the+NCs+southeast+coast+since+1982.++We+carry+over+50+varieties+of+azaleas%2C+including+the+new+Encore+azaleas.++We+also+have+foundation+shrubs%2C+trees%2C+ornamental+grasses%2C+perennials+and+annuals%2C+Kncokout+roses.++Onsite+landscape+designer+and+plant+delivery+available.';
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();
};
