/* [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','3923',jdecode('Home'),jdecode(''), jdecode('%2F3923.html'), 'true',[],'',''],
	['PAGE','3974',jdecode('About+CARE-ID'),jdecode(''), jdecode('%2F3974%2Findex.html'), 'true',[ 
		['PAGE','3995',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F3974%2F3995.html'), 'true',[],'',''],
		['PAGE','4016',jdecode('Contact+Us'),jdecode(''), jdecode('%2F3974%2F4016.html'), 'true',[],'','']
	],'',''],
	['PAGE','4037',jdecode('About+Our+Investigators'),jdecode(''), jdecode('%2F4037%2Findex.html'), 'true',[ 
		['PAGE','5323',jdecode('Dr.+Donald+Poretz'),jdecode(''), jdecode('%2F4037%2F5323.html'), 'true',[],'',''],
		['PAGE','5344',jdecode('Dr.+David+Wheeler'),jdecode(''), jdecode('%2F4037%2F5344.html'), 'true',[],'',''],
		['PAGE','5365',jdecode('Dr.+Sujata+Ambardar'),jdecode(''), jdecode('%2F4037%2F5365.html'), 'true',[],'',''],
		['PAGE','5386',jdecode('Dr.+Ann+Rixinger'),jdecode(''), jdecode('%2F4037%2F5386.html'), 'true',[],'','']
	],'',''],
	['PAGE','19723',jdecode('Our+Studies'),jdecode(''), jdecode('%2F19723%2Findex.html'), 'true',[ 
		['PAGE','43023',jdecode('GMU%2FCARE-ID+microRNA+Study'),jdecode(''), jdecode('%2F19723%2F43023.html'), 'true',[],'',''],
		['PAGE','19744',jdecode('HIV+Vaccine+Study'),jdecode(''), jdecode('%2F19723%2F19744.html'), 'true',[],'',''],
		['PAGE','19786',jdecode('HIV%2B+Studies'),jdecode(''), jdecode('%2F19723%2F19786.html'), 'true',[],'','']
	],'',''],
	['PAGE','4058',jdecode('FAQs'),jdecode(''), jdecode('%2F4058.html'), 'true',[],'',''],
	['PAGE','4079',jdecode('Become+A+Volunteer+'),jdecode(''), jdecode('%2F4079.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Bombay';
theSitetree.paletteFamily='395987';
theSitetree.keyvisualId='7537';
theSitetree.keyvisualName='kv_7537.jpg';
theSitetree.fontsetId='16583';
theSitetree.graphicsetId='12202';
theSitetree.contentColor='395987';
theSitetree.contentBGColor='C0B89D';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XNM4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bombay',
				paletteFamily: 	'395987',
				keyvisualId: 	'7537',
				keyvisualName: 	'kv_7537.jpg',
				fontsetId: 		'16583',
				graphicsetId: 	'12202',
				contentColor: 	'395987',
				contentBGColor: 'C0B89D',
				a_color: 		'395987',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-3784']={
webappId:    '7008',
documentId:  '4079',
internalId:  '3784',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3923',
internalId:  '',
customField: '20110407-121600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4058',
internalId:  '',
customField: '20101101-152443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3974',
internalId:  '',
customField: '20110509-091324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4037',
internalId:  '',
customField: '20110407-124115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4079',
internalId:  '',
customField: '20110407-124315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19744',
internalId:  '',
customField: '20101101-152935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5344',
internalId:  '',
customField: '20100721-134748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5323',
internalId:  '',
customField: '20100721-134738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5365',
internalId:  '',
customField: '20100721-134759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5386',
internalId:  '',
customField: '20100721-134812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19723',
internalId:  '',
customField: '20110509-091821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43023',
internalId:  '',
customField: '20110509-095455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19786',
internalId:  '',
customField: '20110407-130433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3995',
internalId:  '',
customField: '20110407-122817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4016',
internalId:  '',
customField: '20110407-124031'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INL82N';
var companyName   = 'Clinical+Alliance+for+Research+and+Education+-+Infectious+Diseases';
var htmlTitle	  = '';
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();
};

