/* [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','2401',jdecode('Home'),jdecode(''),'/2401.html','true',[],'',''],
	['PAGE','2601',jdecode('Specials+%26+Events'),jdecode(''),'/2601.html','true',[],'',''],
	['PAGE','2452',jdecode('About+Us'),jdecode(''),'/2452.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='C5E6FB';
theSitetree.keyvisualId='11281';
theSitetree.keyvisualName='kv_11281.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13933';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vita02',
				paletteFamily: 	'C5E6FB',
				keyvisualId: 	'11281',
				keyvisualName: 	'kv_11281.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13933',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100108-173954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100108-175747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20100108-175955'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INFGRW';
var companyName   = 'Uniquely+Global...hands+helping+hands';
var htmlTitle	  = 'Uniquely+Global...hands+helping+hands';
var metaKeywords  = 'uniquely+global%2C+coffee%2C+tea%2C+chocolate%2C+Africa%2C+Ghana%2C+South+America%2C+Peru%2C+Costa+Ricca%2C+Nicaragua%2C+third+world%2C+developing%2C+fair+trade%2C+fair+wages%2C+women%2C+children%2C+kids%2C+coal+mines%2C+bags%2C+candles%2C+holistic%2C+gemstones%2C+Reiki%2C+jewelry%2C+Yelp%2C+facebook%2C+twitter%2C+myspace%2C+family%2C+friends%2C+Dedham%2C+Boston%2C+philanthropic%2C+charity%2C+Haiti%2C+home%2C+love%2C+valentines%2C+christmas%2C+xmas%2C+hanuka%2C+chanuka%2C+easter%2C+mothers+day%2C+fathers+day%2C+presidents+day%2C+fourth+of+July%2C+4th+of+July%2C+gifts%2C+giving%2C+happy%2C+happiness%2C+joyful%2C+helping%2C+special%2C+toys%2C+puzzles%2C+antiques%2C+laughter%2C+store%2C+shopping%2C+recycle%2C+soda+cans%2C+pop-tops%2C+scarf%2C+yoga%2C+Tibet%2C+Buddha%2C+Nepal%2C+Vietnam%2C+USA%2C+America%2C+events%2C+shows%2C+artisans%2C+artist%2C+Buddhist%2C+tingsha%2C+singing+bowl%2C+chakra%2C+';
var metaContents  = 'We+are+two+women+are+trying+to+help+other+women%21+Each+of+us+has+a+talent%2C+and+to+not+showcase+this+talent+is+a+loss+for+us+all.+There+is+so+much+that+we+can+learn+from+a+small+piece+of+art%2C+jewelry+etc.%2C+which+was+made+by+a+woman%2C+living+in+a+shack%2C+with+barely+enough+food+to+feed+her+children.+By+buying+this+item+you+are+putting+food+on+their+table+and+making+them+self+reliant.+';
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();
};
