/* [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(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','2452',jdecode('About+Us'),jdecode(''), jdecode('%2F2452.html'), 'true',[],'',''],
	['PAGE','2473',jdecode('Directory'),jdecode(''), jdecode('%2F2473.html'), 'true',[],'',''],
	['PAGE','2494',jdecode('Publishers+Column'),jdecode(''), jdecode('%2F2494.html'), 'true',[],'',''],
	['PAGE','3422',jdecode('The+Gallery'),jdecode(''), jdecode('%2F3422.html'), 'true',[],'',''],
	['PAGE','3201',jdecode('The+Poetic+Heart'),jdecode(''), jdecode('%2F3201.html'), 'true',[],'',''],
	['PAGE','57001',jdecode('Food+Additive+Decoder'),jdecode(''), jdecode('%2F57001.html'), 'true',[],'',''],
	['PAGE','73901',jdecode('Organic+Gardening'),jdecode(''), jdecode('%2F73901.html'), 'true',[],'',''],
	['PAGE','60201',jdecode('Flower+Essences'),jdecode(''), jdecode('%2F60201.html'), 'true',[],'',''],
	['PAGE','21501',jdecode('Music+Clips'),jdecode(''), jdecode('%2F21501.html'), 'true',[],'',''],
	['PAGE','21801',jdecode('Film+%26+Television'),jdecode(''), jdecode('%2F21801.html'), 'true',[],'',''],
	['PAGE','14501',jdecode('Just+Chill'),jdecode(''), jdecode('%2F14501.html'), 'true',[],'',''],
	['PAGE','63001',jdecode('Vegetarian+Party+Food'),jdecode(''), jdecode('%2F63001.html'), 'true',[],'',''],
	['PAGE','77601',jdecode('Near+Death+Experiences'),jdecode(''), jdecode('%2F77601.html'), 'true',[],'',''],
	['PAGE','14522',jdecode('Respect+Yourself'),jdecode(''), jdecode('%2F14522.html'), 'true',[],'',''],
	['PAGE','14543',jdecode('Animals+%26+Environment'),jdecode(''), jdecode('%2F14543.html'), 'true',[],'',''],
	['PAGE','2922',jdecode('Links+%26+Organizations'),jdecode(''), jdecode('%2F2922.html'), 'true',[],'',''],
	['PAGE','2943',jdecode('Guestbook'),jdecode(''), jdecode('%2F2943.html'), 'true',[],'',''],
	['PAGE','2964',jdecode('Contact+Form'),jdecode(''), jdecode('%2F2964.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-2943aendu0inlrgu']={
webappId:    '1002',
documentId:  '2943',
internalId:  '2943aendu0inlrgu',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-27808']={
webappId:    '7008',
documentId:  '2964',
internalId:  '27808',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73901',
internalId:  '',
customField: '20120115-023946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20120115-065714'
};
webappMappings['7060']=webappMappings['7060-ec2581f02340a34d4d49c145841f8f05']={
webappId:    '7060',
documentId:  '3422',
internalId:  'ec2581f02340a34d4d49c145841f8f05',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20120122-025407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20120108-081431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20120122-003336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2494',
internalId:  '',
customField: '20120115-064605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20110319-093407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20110319-093617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2964',
internalId:  '',
customField: '20110319-094335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20120108-080027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20120108-080522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63001',
internalId:  '',
customField: '20120122-003521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3422',
internalId:  '',
customField: '20110419-105832'
};
webappMappings['1501']=webappMappings['1501-29590659']={
webappId:    '1501',
documentId:  '2401',
internalId:  '29590659',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14543',
internalId:  '',
customField: '20110319-095336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14522',
internalId:  '',
customField: '20120115-064709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20110319-092716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20110319-081805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57001',
internalId:  '',
customField: '20110419-101947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60201',
internalId:  '',
customField: '20110606-093721'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INLRGU';
var companyName   = 'GREAT+MYSTERY+PUBLISHING';
var htmlTitle	  = 'GREAT+MYSTERY+PUBLISHING+-+promoting+creativity%2C+personal+growth%2C+humanitarian+%26+environmental+welfare.';
var metaKeywords  = 'Great+Mystery+Publishing%2Ccreativity%2Cpersonal+growth%2Canimal+welfare%2C+human+rights%2Cenvironmental+issues%2CSarina+Damen%2COne+Page+Wisdom%2Cglobal+warming%2Cfur+-+fashion+statement+or+cruel+vanity%2Canimal+testing%2Cthe+natural+history+of+babe+the+pig%2Ccompanion+planting%2Cfood+additive+decoder%2Cwhat+do+those+numbers+on+labels+mean%2C';
var metaContents  = 'Great+Mystery+Publishing+aims+to+encourage%2C+inform+and+inspire%21+Diverse+topics%2C+clips+and+activities+on+creativity%2C+personal+growth%2C+relaxation%2C+environmental+issues%2C+animal+welfare%2C+human+rights+and+lots+more....';
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();
};

