/* [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','2452',jdecode('About+us'),jdecode(''),'/2452.html','true',[],'',''],
	['PAGE','2473',jdecode('Directory'),jdecode(''),'/2473.html','true',[],'',''],
	['PAGE','2494',jdecode('Publishers+Column'),jdecode(''),'/2494.html','true',[],'',''],
	['PAGE','3422',jdecode('The+Gallery'),jdecode(''),'/3422.html','true',[],'',''],
	['PAGE','3201',jdecode('The+Poetic+Heart'),jdecode(''),'/3201.html','true',[],'',''],
	['PAGE','21501',jdecode('Music+Clips'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','21801',jdecode('Film+%26+Television'),jdecode(''),'/21801.html','true',[],'',''],
	['PAGE','14501',jdecode('JUST+CHILL'),jdecode(''),'/14501.html','true',[],'',''],
	['PAGE','14522',jdecode('Respect+Yourself'),jdecode(''),'/14522.html','true',[],'',''],
	['PAGE','14543',jdecode('MANY+HANDS+NETWORK'),jdecode(''),'/14543.html','true',[],'',''],
	['PAGE','22201',jdecode('Animals-+Fun+%26+Welfare'),jdecode(''),'/22201.html','true',[],'',''],
	['PAGE','2901',jdecode('Special+Features'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','22701',jdecode('GMP+Extras'),jdecode(''),'/22701.html','true',[],'',''],
	['PAGE','3222',jdecode('Daily+News+'),jdecode(''),'/3222.html','false',[],'',''],
	['PAGE','3401',jdecode('Give+Your+Vote'),jdecode(''),'/3401.html','false',[],'',''],
	['PAGE','2922',jdecode('Links+%26+Organizations'),jdecode(''),'/2922.html','true',[],'',''],
	['PAGE','2943',jdecode('Guestbook'),jdecode(''),'/2943.html','true',[],'',''],
	['PAGE','2964',jdecode('Contact+Form'),jdecode(''),'/2964.html','true',[],'',''],
	['PAGE','3243',jdecode('GMP+Forum'),jdecode(''),'/3243.html','true',[],'','']];
var siteelementCount=20;
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 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['1003']=webappMappings['1003-aendu0inlrgu1285866c4f5']={
webappId:    '1003',
documentId:  '3243',
internalId:  'aendu0inlrgu1285866c4f5',
customField: 'en:US'
};
webappMappings['7005']=webappMappings['7005-3041']={
webappId:    '7005',
documentId:  '3401',
internalId:  '3041',
customField: 'language:en;country:US;'
};
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: '20100821-081220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100507-075354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20100520-013321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2494',
internalId:  '',
customField: '20100819-070345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100605-093232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20100529-010957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20100507-083729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2964',
internalId:  '',
customField: '20100519-115805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20100529-011734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3222',
internalId:  '',
customField: '20100502-054409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20100502-055023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20100507-091434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3243',
internalId:  '',
customField: '20100821-080452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3422',
internalId:  '',
customField: '20100520-013437'
};
webappMappings['1501']=webappMappings['1501-29590659']={
webappId:    '1501',
documentId:  '2401',
internalId:  '29590659',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14543',
internalId:  '',
customField: '20100507-085640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14522',
internalId:  '',
customField: '20100528-072005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100528-070334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20100605-234901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20100528-071500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100528-073019'
};
var canonHostname = 'cmworker02.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();
};
