/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','652',jdecode('Members'),jdecode(''),'/652.html','true',[],''],
	['PAGE','673',jdecode('Monthly+Newsletter'),jdecode(''),'/673.html','true',[],''],
	['PAGE','11306',jdecode('Guestbook'),jdecode(''),'/11306/index.html','true',[ 
		['PAGE','11301',jdecode('Read+Guestbook'),jdecode(''),'/11306/11301.html','false',[],'']
	],''],
	['PAGE','11401',jdecode('LCBCA+Board+Members'),jdecode(''),'/11401.html','true',[],''],
	['PAGE','15192',jdecode('Calendar+of+Events'),jdecode(''),'/15192.html','true',[],''],
	['PAGE','12201',jdecode('Driving+directions'),jdecode(''),'/12201.html','true',[],''],
	['PAGE','15184',jdecode('Journal'),jdecode(''),'/15184.html','true',[],''],
	['PAGE','15210',jdecode('Offers'),jdecode(''),'/15210.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Anlage';
theSitetree.paletteFamily='92B4DE';
theSitetree.keyvisualId='2018';
theSitetree.keyvisualName='werkzeug.jpg';
theSitetree.fontsetId='331';
theSitetree.graphicsetId='387';
theSitetree.contentColor='00004D';
theSitetree.contentBGColor='92BEDE';
var theTemplate={
				name: 			'Anlage',
				paletteFamily: 	'92B4DE',
				keyvisualId: 	'2018',
				keyvisualName: 	'werkzeug.jpg',
				fontsetId: 		'331',
				graphicsetId: 	'387',
				contentColor: 	'00004D',
				contentBGColor: '92BEDE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'92B4DE',
				b_color: 		'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-55024']={
webappId:    '1501',
documentId:  '601',
internalId:  '55024',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-11306AHW050INXXRN']={
webappId:    '1002',
documentId:  '11306',
internalId:  '11306AHW050INXXRN',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '12201',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7060']=webappMappings['7060-583e21c4f24b0ce1f97f562a1a63323a']={
webappId:    '7060',
documentId:  '11401',
internalId:  '583e21c4f24b0ce1f97f562a1a63323a',
customField: 'language:en;country:US;'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24G']={
webappId:    '5003',
documentId:  '601',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24G',
customField: 'en:US:'
};
webappMappings['7050']=webappMappings['7050-475']={
webappId:    '7050',
documentId:  '15184',
internalId:  '475',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090317-175059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090217-230303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20090217-182553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11306',
internalId:  '',
customField: '20080514-094408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20080417-020447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20090217-181856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15192',
internalId:  '',
customField: '20090217-182443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20080514-094608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15184',
internalId:  '',
customField: '20090120-220219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15210',
internalId:  '',
customField: '20080618-192034'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXRN';
var companyName   = 'L+C+Building+Contractors+Association';
var htmlTitle	  = 'Lewis+Clark+Building+Contractors+Association';
var metaKeywords  = 'Association+Lewiston+Idaho%2C+NAHB++Plumbers%2C+Contractors%2C+real+estate%2C+banking+lcbca%2C+association%2C+Builders+';
var metaContents  = 'LCBCA%2C+Lewis+Clark+Building+Contractors+Association+Lewiston%2C+Idaho%2C+NAHB++Plumbers%2C+Contractors%2C+real+estate%2C+IBCA';
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();
};
