/* [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','301',jdecode('HOME'),jdecode(''),'/301.html','true',[],''],
	['PAGE','1501',jdecode('ABOUT+US'),jdecode(''),'/1501/index.html','true',[ 
		['PAGE','1522',jdecode('Local+Officers'),jdecode(''),'/1501/1522.html','true',[],'']
	],''],
	['PAGE','1564',jdecode('Legal'),jdecode(''),'/1564.html','true',[],''],
	['PAGE','1606',jdecode('TSTA'),jdecode(''),'/1606.html','true',[],''],
	['PAGE','1669',jdecode('NEA'),jdecode(''),'/1669.html','true',[],''],
	['PAGE','1753',jdecode('Links'),jdecode(''),'/1753.html','true',[],''],
	['PAGE','3106',jdecode('Guestbook'),jdecode(''),'/3106/index.html','true',[ 
		['PAGE','3101',jdecode('Read+Guestbook'),jdecode(''),'/3106/3101.html','false',[],'']
	],''],
	['PAGE','5501',jdecode('Photo+Album'),jdecode(''),'/5501.html','true',[],''],
	['PAGE','6201',jdecode('Map'),jdecode(''),'/6201.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='794E9B';
theSitetree.keyvisualId='7245';
theSitetree.keyvisualName='kv_7245.jpg';
theSitetree.fontsetId='16410';
theSitetree.graphicsetId='12139';
theSitetree.contentColor='43215E';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Capri',
				paletteFamily: 	'794E9B',
				keyvisualId: 	'7245',
				keyvisualName: 	'kv_7245.jpg',
				fontsetId: 		'16410',
				graphicsetId: 	'12139',
				contentColor: 	'43215E',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24G']={
webappId:    '5003',
documentId:  '301',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24G',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091011-141457'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-3106ahw050inxe3i']={
webappId:    '1002',
documentId:  '3106',
internalId:  '3106ahw050inxe3i',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-21689713747b81d2978b9d27ec9b18f3']={
webappId:    '7060',
documentId:  '5501',
internalId:  '21689713747b81d2978b9d27ec9b18f3',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20091007-155754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1522',
internalId:  '',
customField: '20090928-180745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1564',
internalId:  '',
customField: '20090921-000559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1606',
internalId:  '',
customField: '20090928-233037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20080625-115408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1669',
internalId:  '',
customField: '20090928-233621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1753',
internalId:  '',
customField: '20090925-091906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20090928-185029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090925-223323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3106',
internalId:  '',
customField: '20080625-115408'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXE3I';
var companyName   = 'SOCORRO+EDUCATION+ASSOCIATION%2FTSTA%2FNEA';
var htmlTitle	  = 'Socorro+Education+Association';
var metaKeywords  = 'Education+Texas+State+Teachers+Association+National+Education+Association+Labor+Socorro+Independent+School+District';
var metaContents  = 'Education+National+Education+Association+Texas+State+Teachers+Association+Labor+Organizations+Associations+Socorro+Independent+School+District';
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();
};
