/* [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','2701',jdecode('Water+Rights+'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','2752',jdecode('Water+Rights+in+General'),jdecode(''), jdecode('%2F2752.html'), 'true',[],'',''],
	['PAGE','2773',jdecode('Why+Own+Water+Rights'),jdecode(''), jdecode('%2F2773.html'), 'true',[],'',''],
	['PAGE','3001',jdecode('Nevada+Water+Rights+Law'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','3022',jdecode('Who+is+Buying+Up+Rights%3F'),jdecode(''), jdecode('%2F3022.html'), 'true',[],'',''],
	['PAGE','3101',jdecode('Food+and+Water+Issues'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','3122',jdecode('Aquifer+Updates'),jdecode(''), jdecode('%2F3122.html'), 'true',[],'',''],
	['PAGE','3143',jdecode('Critical+Shortages'),jdecode(''), jdecode('%2F3143.html'), 'true',[],'',''],
	['PAGE','3164',jdecode('Water+For+Sale+Today'),jdecode(''), jdecode('%2F3164.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Weekend';
theSitetree.paletteFamily='858584';
theSitetree.keyvisualId='3936';
theSitetree.keyvisualName='kv_3936.jpg';
theSitetree.fontsetId='10528';
theSitetree.graphicsetId='11162';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='949493';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Weekend',
				paletteFamily: 	'858584',
				keyvisualId: 	'3936',
				keyvisualName: 	'kv_3936.jpg',
				fontsetId: 		'10528',
				graphicsetId: 	'11162',
				contentColor: 	'000000',
				contentBGColor: '949493',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20120109-142507'
};
webappMappings['7008']=webappMappings['7008-32594']={
webappId:    '7008',
documentId:  '3164',
internalId:  '32594',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2752',
internalId:  '',
customField: '20120108-114031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2773',
internalId:  '',
customField: '20120108-114126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20120108-114241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20120108-114407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20120111-142551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3122',
internalId:  '',
customField: '20120123-204340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3143',
internalId:  '',
customField: '20120108-114655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3164',
internalId:  '',
customField: '20120109-142415'
};
webappMappings['7008']=webappMappings['7008-33360']={
webappId:    '7008',
documentId:  '2773',
internalId:  '33360',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-33361']={
webappId:    '7008',
documentId:  '3122',
internalId:  '33361',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-33363']={
webappId:    '7008',
documentId:  '3001',
internalId:  '33363',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INZGBR';
var companyName   = 'Water+Rights+For+Sale';
var htmlTitle	  = 'Nevada+Water+Rights%2CIrrigated+Ranch+Land%2C+Nevada+Land+For+Sale+with+Water+Rights+';
var metaKeywords  = 'Water+Rights%2Cdrought%2Cnevada+ranch+land%2Cirrigated+farm+land%2Cland+with+water+rights%2Cwater+rights+transfers%2Cnevada+water+rights+basins%2Crenewable+energy+and+water+consumption%2Cfood+production+water+consumption%2Cfood+shortages%2Cwater+shortages%2CLas+Vegas+water+supply%2CCalifornia+water+shortages%2CColorado+River+water+supply%2Clake+Mead%2C+lake+Powell';
var metaContents  = 'Water+Rights%2Cdrought%2Caquifers%2Cnevada+ranch+land%2Cirrigated+farm+land%2Cland+with+water+rights%2Cwater+rights+transfers%2Cnevada+water+rights+basins%2Crenewable+energy%2Cwater+consumption%2Cfood+production+water+consumption%2Cfood+shortages%2Cwater+shortages%2CLas+Vegas+water+supply%2CCalifornia+water+shortages%2CColorado+River+water+supply%2Clake+Mead%2C+lake+Powell';
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();
};

