/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','53',jdecode('Donations'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','62',jdecode('Case+Management'),jdecode(''),'/62.html','true',[],'',''],
	['PAGE','6501',jdecode('Local+Physicians'),jdecode(''),'/6501.html','true',[],'',''],
	['PAGE','71',jdecode('Prevention'),jdecode(''),'/71.html','true',[],'',''],
	['PAGE','6001',jdecode('Opinion+Forum'),jdecode(''),'/6001.html','true',[],'',''],
	['PAGE','9401',jdecode('Podcast+Archive'),jdecode(''),'/9401.html','true',[],'',''],
	['PAGE','80',jdecode('Resource+Links'),jdecode(''),'/80.html','true',[],'',''],
	['PAGE','89',jdecode('About+us'),jdecode(''),'/89/index.html','true',[ 
		['PAGE','98',jdecode('Our+team'),jdecode(''),'/89/98.html','true',[],'',''],
		['PAGE','107',jdecode('Contact+us'),jdecode(''),'/89/107.html','true',[],'','']
	],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Anniversary';
theSitetree.paletteFamily='5D539D';
theSitetree.keyvisualId='3722';
theSitetree.keyvisualName='kv_3722.jpg';
theSitetree.fontsetId='10472';
theSitetree.graphicsetId='10946';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F3EFDB';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Anniversary',
				paletteFamily: 	'5D539D',
				keyvisualId: 	'3722',
				keyvisualName: 	'kv_3722.jpg',
				fontsetId: 		'10472',
				graphicsetId: 	'10946',
				contentColor: 	'000000',
				contentBGColor: 'F3EFDB',
				a_color: 		'F7EFDE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'828181',
				e_color: 		'828181',
				f_color: 		'828181',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-164467']={
webappId:    '1501',
documentId:  '32',
internalId:  '164467',
customField: '1501'
};
webappMappings['1003']=webappMappings['1003-ahw050inxe4i11aeede0276']={
webappId:    '1003',
documentId:  '6001',
internalId:  'ahw050inxe4i11aeede0276',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100715-053721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100715-054102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20100715-094816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20100715-053901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100715-053953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20100715-110010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100715-095549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20100715-054212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20100715-054249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98',
internalId:  '',
customField: '20100719-102643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20100715-100043'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXE4I';
var companyName   = 'La+Liga+Contra+el+SIDA%2C+Inc.';
var htmlTitle	  = 'League+Against+AIDS%2C+Inc.';
var metaKeywords  = 'AIDS%2C+Miami-Dade%2C+aids+services%2C+hispanic%2C+spanish%2C+SIDA%2C+liga+contra+el+sida%2C+case+management%2C+medicaid%2C+medicare%2C+ryan+white%2C+hopwa%2C+HIV%2C+VIH%2C+Miami%2C+Florida%2C+hispana%2C+medical+referral%2C+latino%2C+latina%2C+PAC%2C+Project+AIDS+Care%2C+servicios+sida';
var metaContents  = 'Hispanic+AIDS+prevention+and+Hispanic+AIDS+medical+case+managment+services+information';
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();
};
