/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],''],
	['PAGE','2601',jdecode('Tutorials'),jdecode(''),'/2601/index.html','true',[ 
		['PAGE','18906',jdecode('Freebie+Lingo'),jdecode(''),'/2601/18906.html','true',[],''],
		['PAGE','9201',jdecode('Getting+Started'),jdecode(''),'/2601/9201.html','true',[],''],
		['PAGE','18706',jdecode('Browser+Setup'),jdecode(''),'/2601/18706.html','true',[],''],
		['PAGE','25006',jdecode('Going+Green'),jdecode(''),'/2601/25006.html','true',[],''],
		['PAGE','24506',jdecode('Staying+Green'),jdecode(''),'/2601/24506.html','true',[],''],
		['PAGE','26506',jdecode('Getting+Organized'),jdecode(''),'/2601/26506.html','true',[],''],
		['PAGE','42806',jdecode('Method+2'),jdecode(''),'/2601/42806.html','true',[],'']
	],''],
	['PAGE','2622',jdecode('Mentors'),jdecode(''),'/2622.html','true',[],''],
	['PAGE','2643',jdecode('Carol%26%23x27%3Bs+Page'),jdecode(''),'/2643.html','true',[],''],
	['PAGE','38306',jdecode('Linda%26%23x27%3Bs+Page'),jdecode(''),'/38306.html','true',[],''],
	['PAGE','2664',jdecode('Peggy%26%23x27%3Bs+Page'),jdecode(''),'/2664.html','false',[],''],
	['PAGE','2685',jdecode('Money+Blog'),jdecode(''),'/2685.html','false',[],''],
	['PAGE','23206',jdecode('Contact+Carol'),jdecode(''),'/23206.html','true',[],''],
	['PAGE','23227',jdecode('Contact+Peggy'),jdecode(''),'/23227.html','false',[],''],
	['PAGE','35706',jdecode('New+page'),jdecode(''),'/35706.html','false',[],''],
	['PAGE','39906',jdecode('Contact+Linda'),jdecode(''),'/39906.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='200';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003333';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Orbit',
				paletteFamily: 	'003333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'200',
				contentColor: 	'FFFFFF',
				contentBGColor: '003333',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003333',
				b_color: 		'99CCCC',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-2521']={
webappId:    '7050',
documentId:  '2685',
internalId:  '2521',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20090303-155505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20080601-073122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2685',
internalId:  '',
customField: '20080529-202401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20090224-172430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2664',
internalId:  '',
customField: '20080601-073333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090303-162138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20080531-152057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18706',
internalId:  '',
customField: '20080531-150312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18906',
internalId:  '',
customField: '20090303-162505'
};
webappMappings['7008']=webappMappings['7008-4467']={
webappId:    '7008',
documentId:  '23206',
internalId:  '4467',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-4468']={
webappId:    '7008',
documentId:  '23227',
internalId:  '4468',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23206',
internalId:  '',
customField: '20090225-080047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23227',
internalId:  '',
customField: '20080531-093909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24506',
internalId:  '',
customField: '20090225-104633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25006',
internalId:  '',
customField: '20080614-224635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26506',
internalId:  '',
customField: '20090227-161437'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35706',
internalId:  '',
customField: '20081230-120556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38306',
internalId:  '',
customField: '20090319-165137'
};
webappMappings['7008']=webappMappings['7008-13973']={
webappId:    '7008',
documentId:  '39906',
internalId:  '13973',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39906',
internalId:  '',
customField: '20090225-080305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42806',
internalId:  '',
customField: '20090227-192315'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2BV4';
var companyName   = 'Learn+to+Green+for+Money';
var htmlTitle	  = 'greenformoney.com';
var metaKeywords  = 'freebie+trading%2C+money%2C+online+business%2C+freebie+sites%2C+freesites%2C+free+lunch+room%2C+blogging%2C+freebie%2C+mentor%2C+trading%2C+free%2C+money%2C+home';
var metaContents  = 'freebie+trading%2C+internet+marketing%2C+make+money+on+line%2C+review+freebie+trading%2C+referral+marketing+system%2C+referral+based+marketing%2C+incentive+marketing%2C+referral+marketing+system%2C+online+income+opportunity%2C+online+business+opportunity%2C+work+at+home+jobs%2C+legitimate+online+business%2C+review+freebie+trading%2C+home+based+income%2C+win+free+stuff%2C+win+money%2Cwin+laptops%2C+win+computers%2C+free+wii%2C+free+xbox%2C+free+iphone%2C+free+dvd%2C+free+digital%2C+earn+cash+online%2C+make+money+on+the+interenet%2Cfree+prizes';
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();
};

