/* [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 theSitetree=[ 
	['PAGE','34701',jdecode('HOME'),jdecode(''),'/34701.html','true',[],''],
	['PAGE','22401',jdecode('The+Online+Business'),jdecode(''),'/22401.html','true',[],''],
	['PAGE','22422',jdecode('Herbalife+International'),jdecode(''),'/22422.html','true',[],''],
	['PAGE','4101',jdecode('Around+Town+TV+Show'),jdecode(''),'/4101/index.html','true',[ 
		['PAGE','57101',jdecode('Behind+The+Scenes'),jdecode(''),'/4101/57101.html','true',[],''],
		['PAGE','21422',jdecode('Around+Town+SPONSORS'),jdecode(''),'/4101/21422.html','true',[],''],
		['PAGE','66001',jdecode('Sponsor+Request+Form'),jdecode(''),'/4101/66001.html','true',[],''],
		['PAGE','4194',jdecode('Guest+Request+Form'),jdecode(''),'/4101/4194.html','true',[],'']
	],''],
	['PAGE','42901',jdecode('Tom%26%23x27%3Bs+Biography'),jdecode(''),'/42901.html','true',[],''],
	['PAGE','88801',jdecode('Tom%26%23x27%3Bs+Blog'),jdecode(''),'/88801.html','true',[],''],
	['PAGE','66901',jdecode('GUESTBOOK'),jdecode(''),'/66901.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Cinema';
theSitetree.paletteFamily='2833C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16612';
theSitetree.graphicsetId='12209';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2833C2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Cinema',
				paletteFamily: 	'2833C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16612',
				graphicsetId: 	'12209',
				contentColor: 	'FFFFFF',
				contentBGColor: '2833C2',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'535CCE',
				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:  '4101',
internalId:  '',
customField: '20090418-105245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4194',
internalId:  '',
customField: '20080819-083530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21422',
internalId:  '',
customField: '20080819-173420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20080820-101707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22422',
internalId:  '',
customField: '20081030-204240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20090418-104310'
};
webappMappings['7008']=webappMappings['7008-6949']={
webappId:    '7008',
documentId:  '4194',
internalId:  '6949',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20080918-165713'
};
webappMappings['7060']=webappMappings['7060-a962e376d81f585ba381fe76a1c794d9']={
webappId:    '7060',
documentId:  '57101',
internalId:  'a962e376d81f585ba381fe76a1c794d9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57101',
internalId:  '',
customField: '20080819-173326'
};
webappMappings['7008']=webappMappings['7008-7344']={
webappId:    '7008',
documentId:  '66001',
internalId:  '7344',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66001',
internalId:  '',
customField: '20080819-083355'
};
webappMappings['1002']=webappMappings['1002-66901aendu0in2pt0']={
webappId:    '1002',
documentId:  '66901',
internalId:  '66901aendu0in2pt0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66901',
internalId:  '',
customField: '20080819-084345'
};
webappMappings['7050']=webappMappings['7050-4617']={
webappId:    '7050',
documentId:  '88801',
internalId:  '4617',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88801',
internalId:  '',
customField: '20080820-093806'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2PT0';
var companyName   = 'Work+at+Home+-+Training+Provided+-+Health+%26+Nutrition';
var htmlTitle	  = 'Work+at+Home+-+Training+Provided+-+Health+%26+Nutrition';
var metaKeywords  = 'Work+at+Home%2C+Training+Provided%2C+Home+Based+Business%2C+Weight+Loss%2C+Boost+Energy%2C+Training+Provided%2C+Personal+Coaching';
var metaContents  = 'Achieve+personal+success+by+working+at+home+with+training+provided.++Financial+Freedom+using+the+health+and+nutrition+fields+to+your+advantage.++Start+your+home+based+business+today.';
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();
};

