/* [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','8201',jdecode('Case+Study'),jdecode(''),'/8201.html','true',[],'',''],
	['PAGE','5401',jdecode('Shopping'),jdecode(''),'/5401.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='View';
theSitetree.paletteFamily='236A8C';
theSitetree.keyvisualId='11132';
theSitetree.keyvisualName='kv_11132.jpg';
theSitetree.fontsetId='32028';
theSitetree.graphicsetId='13853';
theSitetree.contentColor='2F2F2F';
theSitetree.contentBGColor='236A8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'View',
				paletteFamily: 	'236A8C',
				keyvisualId: 	'11132',
				keyvisualName: 	'kv_11132.jpg',
				fontsetId: 		'32028',
				graphicsetId: 	'13853',
				contentColor: 	'2F2F2F',
				contentBGColor: '236A8C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100807-092243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100209-195649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100811-181907'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INLWFF';
var companyName   = 'The800Club.us';
var htmlTitle	  = 'The+800+Club%3F+%28A+way+to+REVENUE+SHARE+for+up+to+800+participants+for+any+industry.%29';
var metaKeywords  = '1+internet+mall%2C+1internetmall.com%2C+Acts2.biz%2C+Acts+2%2C+1iMall%2C+1iMall.com%2C+Affiliate+Marketing%2C+AdrianDove.com%2C+AfricanAmericanLegacyFoundation.org%2C+AvalonAndElSegundo.com%2C+BryanLFranklin%2C+BryanFranklin.com%2C+BryanFranklin.net%2C+BrianFranklin.com%2C+black+business%2C+black+owned+business%2C+Black+Owned+Home+Based+Business%2C+black+owned+internet+shopping+mall%2C+Black365.com%2C+365Black.com%2C+BUCKaFRIEND.COM%2C+CAAPEI%2C+CalvinSchexnayder.com%2C+Circle+Compensation+Plan%2C+Club+Hall+Of+Fame%2C+Collaboration%2C+E-Commerce%2C+CSUDH%2C+DonateByShopping%2C+Donate+By+Shopping%2C+DohgonUniversity.com%2C+DonateByShopping.com%2C+ecommerce%2C+Facebook.com%2F1iMALLCOM%2C+First+Job+Project%2C+fundraising%2C+fundraiser%2C+GreatMLMdebate.com%2C+Great+MLM+debate%2C+Health+Wealth+and+Spirituality%2C+HealthWealthandSpirituality.org%2C+Home+Based+Business%2C+Hope4Inmates.org%2C+ibo%2C+internet+mall%2C+internet+shopping+mall%2C+internet+shopping+mall+business+opportunity%2C+JewelStarHealth.com%2C+How+to+identify+a+visionary%2C+LesBrown.com%2C+locke+high+school%2C+LonzoWilliams.com%2C+gompers+jr+high+school%2C+madvoice.com%2C+madvoice%2C+matah%2C+MLM%2C+money%2C+MySpace.com%2F1iMALL%2C+MySpace.com%2FProjectFirstJob%2C+Network+Marketing%2C+NFTE%2C+NFTE.COM%2C+Niggod%2C+Niggod.com%2C+No+Child+Left+Behind%2C+OmegaEntertainment.org%2C+one+internet+mall%2C+OneInernetMall.com%2C+ONEiMALL.COM%2C+pay+students+to+stay+in+school%2C+PoetyInTheHood.com%2C+Project+First+Job%2C+ProjectFirstJob%2C+ProjectFirstJob.com%2C+Real+Men+Cook%2C+RealMenShop.com%2C+Referral+Marketing%2C+SayNoToMLM.com%2C+Say+No+To+MLM%2C+Shop+For+A+Cause%2C+Shopping%2C+Shopping+Mall%2C+SolomonDurham.com%2C+The+800+Club%2C+The800Club.us%2C+Trak12Ent.com%2C+Twitter.com%2F1iMALL%2C+Quixtar%2C+Veneta+Watkins%2C+YouTube.com%2F1iMALL%2C+Wealth%2C+Abe+Thompson%2C+Adrian+Dove%2C+Bryan+Franklin%2C+Bryan+Jones%2C+Calvin+Schexnayder%2C+Carole+Freeman%2C+Dannete+Wilkerson%2C+Darius+Farrelly%2C+Eric+Coleman%2C+Felix+Washington%2C+Johnnie+Morgan%2C+Keith+Charles%2C+Keith+Scoggins%2C+Kristy+Dotson%2C+Les+Brown%2C+Les+Jones%2C+Linda+Collins%2C+Lonzo+Williams%2C+Megan+Lounder%2C+Mell+Monroe%2C+Professor+Momoh%2C+Rodney+Franklin%2C+Stacie+Williams%2C+Timothy+Griffin';
var metaContents  = 'The+800+Club+-+The800Club.US+-+The+Circle.';
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();
};
