/* [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','7501',jdecode('Welcome%21'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','7552',jdecode('What%26%23x27%3Bs+New%3F'),jdecode(''),'/7552.html','true',[],'',''],
	['PAGE','12601',jdecode('Leadership'),jdecode(''),'/12601.html','true',[],'',''],
	['PAGE','13001',jdecode('Affinity+Groups'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','13022',jdecode('In+the+News...'),jdecode(''),'/13022.html','true',[],'',''],
	['PAGE','13064',jdecode('Resources'),jdecode(''),'/13064.html','true',[],'',''],
	['PAGE','55201',jdecode('First+Person'),jdecode(''),'/55201.html','true',[],'',''],
	['PAGE','13043',jdecode('Get+Involved%2C+Join%21'),jdecode(''),'/13043.html','true',[],'',''],
	['PAGE','39701',jdecode('Contact+Us'),jdecode(''),'/39701.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='D43F3F';
theSitetree.keyvisualId='9840';
theSitetree.keyvisualName='kv_9840.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13031';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'D43F3F',
				keyvisualId: 	'9840',
				keyvisualName: 	'kv_9840.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13031',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				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:  '7501',
internalId:  '',
customField: '20100904-080823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7552',
internalId:  '',
customField: '20100902-154915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20100902-153455'
};
webappMappings['7008']=webappMappings['7008-7344']={
webappId:    '7008',
documentId:  '13043',
internalId:  '7344',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100726-072453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13022',
internalId:  '',
customField: '20100901-185934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13043',
internalId:  '',
customField: '20100902-154614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13064',
internalId:  '',
customField: '20100904-082548'
};
webappMappings['7008']=webappMappings['7008-7486']={
webappId:    '7008',
documentId:  '39701',
internalId:  '7486',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55201',
internalId:  '',
customField: '20100726-073219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20100726-074004'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN28HA';
var companyName   = 'GLBT+Affinity+Group+of+the+YMCA+of+the+USA';
var htmlTitle	  = 'GLBT+Affinity+Group+YUSA';
var metaKeywords  = 'YMCA%2C+Affinity%2C+Group%2C+Gay%2C+Lesbian%2C+Bixsexual%2C+Transgendered%2C+Allies%2C+Advocates%2C+Intersex%2C+Queer%2C+Questioning%2C+staff%2C+volunteers%2C+members';
var metaContents  = 'Organized+in+2006%2C+a+number+of+GLBT+YMCA+professionals+and+YMCA+policy+volunteers+set+out+to+increase+the+awareness+about+the+issues+confronting+gay%2C+lesbian%2C+bisexual+and+transgendered+YMCA+staff+and+volunteer+leaders+in+the+YMCA+movement.';
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();
};
