/* [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','5901',jdecode('For+Parents'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','4901',jdecode('Welcome'),jdecode(''),'/4901.html','true',[],''],
	['PAGE','4973',jdecode('About+us'),jdecode(''),'/4973.html','true',[],''],
	['PAGE','21201',jdecode('Facebook+and+Email'),jdecode(''),'/21201.html','true',[],''],
	['PAGE','13101',jdecode('Ask+Adam+'),jdecode(''),'/13101.html','true',[],''],
	['PAGE','19501',jdecode('Understanding+Sexuality'),jdecode(''),'/19501/index.html','true',[ 
		['PAGE','19522',jdecode('Am+I+Gay%3F'),jdecode(''),'/19501/19522.html','true',[],''],
		['PAGE','19543',jdecode('Accepting+Your+Orientation'),jdecode(''),'/19501/19543.html','true',[],'']
	],''],
	['PAGE','15101',jdecode('Coming+Out'),jdecode(''),'/15101/index.html','true',[ 
		['PAGE','15701',jdecode('Coming+Out+Tips'),jdecode(''),'/15101/15701.html','true',[],''],
		['PAGE','17901',jdecode('Share+Your+Story'),jdecode(''),'/15101/17901.html','true',[],''],
		['PAGE','15122',jdecode('Roger%26%23x27%3Bs+Story'),jdecode(''),'/15101/15122.html','true',[],''],
		['PAGE','15722',jdecode('Merlin%26%23x27%3Bs+Story'),jdecode(''),'/15101/15722.html','true',[],''],
		['PAGE','16801',jdecode('Paul%26%23x27%3Bs+Story'),jdecode(''),'/15101/16801.html','true',[],''],
		['PAGE','16822',jdecode('Kassie%26%23x27%3Bs+Story'),jdecode(''),'/15101/16822.html','true',[],''],
		['PAGE','16843',jdecode('Ev%26%23x27%3Bs+Story'),jdecode(''),'/15101/16843.html','true',[],''],
		['PAGE','16864',jdecode('Kirk%26%23x27%3Bs+Story'),jdecode(''),'/15101/16864.html','true',[],''],
		['PAGE','16927',jdecode('Robin%26%23x27%3Bs+Story'),jdecode(''),'/15101/16927.html','true',[],''],
		['PAGE','16948',jdecode('Edward%26%23x27%3Bs+Story'),jdecode(''),'/15101/16948.html','true',[],'']
	],''],
	['PAGE','15143',jdecode('Religion+'),jdecode(''),'/15143/index.html','true',[ 
		['PAGE','15164',jdecode('Dave%26%23x27%3Bs+Story'),jdecode(''),'/15143/15164.html','true',[],'']
	],''],
	['PAGE','15185',jdecode('Aids+'),jdecode(''),'/15185.html','true',[],''],
	['PAGE','8101',jdecode('User+Submitted'),jdecode(''),'/8101/index.html','true',[ 
		['PAGE','8122',jdecode('Ashamed'),jdecode(''),'/8101/8122.html','true',[],''],
		['PAGE','9301',jdecode('The+Truth+About+The+Lie'),jdecode(''),'/8101/9301.html','true',[],''],
		['PAGE','10101',jdecode('Gay+Liberation'),jdecode(''),'/8101/10101.html','true',[],'']
	],''],
	['PAGE','10301',jdecode('Forums'),jdecode(''),'/10301/index.html','true',[ 
		['PAGE','14701',jdecode('General'),jdecode(''),'/10301/14701.html','true',[],''],
		['PAGE','16501',jdecode('Pride'),jdecode(''),'/10301/16501.html','true',[],'']
	],''],
	['PAGE','13501',jdecode('GTR+Blog'),jdecode(''),'/13501.html','true',[],''],
	['PAGE','4994',jdecode('Contact'),jdecode(''),'/4994/index.html','true',[ 
		['PAGE','10501',jdecode('Email+Form'),jdecode(''),'/4994/10501.html','true',[],'']
	],''],
	['PAGE','5952',jdecode('Guestbook'),jdecode(''),'/5952.html','true',[],''],
	['PAGE','18501',jdecode('Forgotten'),jdecode(''),'/18501.html','true',[],''],
	['PAGE','21001',jdecode('Acceptance'),jdecode(''),'/21001.html','true',[],''],
	['PAGE','21701',jdecode('Privacy+Policy'),jdecode(''),'/21701.html','true',[],'']];
var siteelementCount=36;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20090825-203945'
};
webappMappings['7008']=webappMappings['7008-20161']={
webappId:    '7008',
documentId:  '13101',
internalId:  '20161',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20090828-034508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4994',
internalId:  '',
customField: '20090824-200110'
};
webappMappings['1003']=webappMappings['1003-aendu0inv1z21235519a91c']={
webappId:    '1003',
documentId:  '14701',
internalId:  'aendu0inv1z21235519a91c',
customField: 'en:US'
};
webappMappings['1002']=webappMappings['1002-5952aendu0inv1z2']={
webappId:    '1002',
documentId:  '5952',
internalId:  '5952aendu0inv1z2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090824-195854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5952',
internalId:  '',
customField: '20090825-205513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090825-202807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20090825-203624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8122',
internalId:  '',
customField: '20090906-185542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20090906-185628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20090824-150301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090824-225038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090826-030230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20090826-010840'
};
webappMappings['7008']=webappMappings['7008-20135']={
webappId:    '7008',
documentId:  '10501',
internalId:  '20135',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090824-200225'
};
webappMappings['7050']=webappMappings['7050-11730']={
webappId:    '7050',
documentId:  '13501',
internalId:  '11730',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090826-143411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15122',
internalId:  '',
customField: '20090826-030741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15143',
internalId:  '',
customField: '20090826-143227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15164',
internalId:  '',
customField: '20090826-143243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15185',
internalId:  '',
customField: '20100225-220346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15701',
internalId:  '',
customField: '20090826-141912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15722',
internalId:  '',
customField: '20090826-142055'
};
webappMappings['1003']=webappMappings['1003-aendu0inv1z21235ab74591']={
webappId:    '1003',
documentId:  '16501',
internalId:  'aendu0inv1z21235ab74591',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20090827-032509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20090827-034257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16822',
internalId:  '',
customField: '20090827-034423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16843',
internalId:  '',
customField: '20090827-034459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16864',
internalId:  '',
customField: '20090827-034535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16948',
internalId:  '',
customField: '20090827-035146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16927',
internalId:  '',
customField: '20090827-035113'
};
webappMappings['7008']=webappMappings['7008-20225']={
webappId:    '7008',
documentId:  '17901',
internalId:  '20225',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20090827-035434'
};
webappMappings['7060']=webappMappings['7060-47faa22918c723d4c4443e258447690a']={
webappId:    '7060',
documentId:  '18501',
internalId:  '47faa22918c723d4c4443e258447690a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20090827-051035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20090906-185238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19522',
internalId:  '',
customField: '20090906-185442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19543',
internalId:  '',
customField: '20090906-183010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100221-172436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20100223-212520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20100225-220957'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INV1Z2';
var companyName   = 'Gay+Teen+Resources+';
var htmlTitle	  = 'GTR';
var metaKeywords  = '';
var metaContents  = '';
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();
};

