/* [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','75',jdecode('Home'),jdecode(''),'/75.html','true',[],''],
	['PAGE','42801',jdecode('Civic+%26+Commerce'),jdecode(''),'/42801/index.html','true',[ 
		['PAGE','52601',jdecode('Holiday+Events'),jdecode(''),'/42801/52601.html','true',[],'']
	],''],
	['PAGE','9404',jdecode('Farmers+Market'),jdecode(''),'/9404.html','true',[],''],
	['PAGE','46101',jdecode('Happy+Days'),jdecode(''),'/46101.html','true',[],''],
	['PAGE','6295',jdecode('City+of+Lisbon'),jdecode(''),'/6295/index.html','true',[ 
		['PAGE','17501',jdecode('Lisbon+Inert+Landfill'),jdecode(''),'/6295/17501.html','true',[],'']
	],''],
	['PAGE','1135',jdecode('Community'),jdecode(''),'/1135/index.html','true',[ 
		['PAGE','7362',jdecode('Health+Care'),jdecode(''),'/1135/7362.html','true',[],''],
		['PAGE','7458',jdecode('Schools'),jdecode(''),'/1135/7458.html','true',[],''],
		['PAGE','7638',jdecode('North+Dakota+Veterans+Home'),jdecode(''),'/1135/7638.html','true',[],'']
	],''],
	['PAGE','3370',jdecode('City+Calendar'),jdecode(''),'/3370.html','true',[],''],
	['PAGE','3379',jdecode('Events+and+Programs'),jdecode(''),'/3379.html','true',[],''],
	['PAGE','1126',jdecode('Business+Directory'),jdecode(''),'/1126.html','true',[],''],
	['PAGE','3397',jdecode('Entertainment'),jdecode(''),'/3397.html','true',[],''],
	['PAGE','3406',jdecode('Recreation'),jdecode(''),'/3406.html','true',[],''],
	['PAGE','3424',jdecode('Tourism'),jdecode(''),'/3424.html','true',[],''],
	['PAGE','1144',jdecode('Contact+Us'),jdecode(''),'/1144.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='8CBBD8';
theSitetree.keyvisualId='1714';
theSitetree.keyvisualName='reihenhaeuser.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='348';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8CBBD8';
var theTemplate={
				name: 			'Architekt',
				paletteFamily: 	'8CBBD8',
				keyvisualId: 	'1714',
				keyvisualName: 	'reihenhaeuser.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'348',
				contentColor: 	'000000',
				contentBGColor: '8CBBD8',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'8CBBD8',
				b_color: 		'338299',
				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['1001']=webappMappings['1001-ahw050in29my4894455bd8a93327']={
webappId:    '1001',
documentId:  '1144',
internalId:  'ahw050in29my4894455bd8a93327',
customField: ''
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '75',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20091119-115314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75',
internalId:  '',
customField: '20090608-132514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3370',
internalId:  '',
customField: '20070523-182458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20091119-115231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3379',
internalId:  '',
customField: '20090529-100157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1126',
internalId:  '',
customField: '20090820-145349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1135',
internalId:  '',
customField: '20090402-104922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7362',
internalId:  '',
customField: '20080514-192636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7458',
internalId:  '',
customField: '20080514-193604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7638',
internalId:  '',
customField: '20080116-211430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3397',
internalId:  '',
customField: '20090514-133953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3406',
internalId:  '',
customField: '20090303-140648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3424',
internalId:  '',
customField: '20090303-140533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6295',
internalId:  '',
customField: '20081006-140708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20090123-144540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9404',
internalId:  '',
customField: '20090529-100000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46101',
internalId:  '',
customField: '20090604-224359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1144',
internalId:  '',
customField: '20070329-134402'
};
webappMappings['1501']=webappMappings['1501-2661600']={
webappId:    '1501',
documentId:  '75',
internalId:  '2661600',
customField: '1501'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN29MY';
var companyName   = '';
var htmlTitle	  = 'lisbonnd.com';
var metaKeywords  = '';
var metaContents  = 'lisbon+hunting+lisbon+chamber+of+commerce+lisbon+sports+se+north+dakota';
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();
};
