/* [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','501',jdecode('Ramirez+Management+Service+in+Big+Sky'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Management+Services'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','573',jdecode('Private+Homes'),jdecode(''), jdecode('%2F552%2F573.html'), 'true',[],'',''],
		['PAGE','594',jdecode('Vacation+Rentals'),jdecode(''), jdecode('%2F552%2F594.html'), 'true',[],'',''],
		['PAGE','615',jdecode('HOA'),jdecode(''), jdecode('%2F552%2F615.html'), 'true',[],'','']
	],'',''],
	['PAGE','636',jdecode('Other+Services+by+RMS%2C+Inc.'),jdecode(''), jdecode('%2F636.html'), 'true',[],'',''],
	['PAGE','657',jdecode('About+us'),jdecode(''), jdecode('%2F657%2Findex.html'), 'true',[ 
		['PAGE','678',jdecode('The+team'),jdecode(''), jdecode('%2F657%2F678.html'), 'true',[],'','']
	],'',''],
	['PAGE','699',jdecode('Contact'),jdecode(''), jdecode('%2F699%2Findex.html'), 'true',[ 
		['PAGE','10301',jdecode('Contact+%28follow+up+page%29'),jdecode(''), jdecode('%2F699%2F10301.html'), 'false',[],'',''],
		['PAGE','720',jdecode('Addresses'),jdecode(''), jdecode('%2F699%2F720.html'), 'true',[],'',''],
		['PAGE','741',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F699%2F741.html'), 'true',[],'','']
	],'',''],
	['PAGE','762',jdecode('HOA+Links'),jdecode(''), jdecode('%2F762%2Findex.html'), 'true',[ 
		['PAGE','783',jdecode('Hidden+Village'),jdecode(''), jdecode('%2F762%2F783%2Findex.html'), 'true',[ 
			['PAGE','9801',jdecode('Hidden+Village+%28follow+up+page%29'),jdecode(''), jdecode('%2F762%2F783%2F9801.html'), 'false',[],'','']
		],'',''],
		['PAGE','11403',jdecode('Hidden+Village+Road+Project'),jdecode(''), jdecode('%2F762%2F11403.html'), 'true',[],'',''],
		['PAGE','804',jdecode('Stillwater'),jdecode(''), jdecode('%2F762%2F804%2Findex.html'), 'true',[ 
			['PAGE','9901',jdecode('Stillwater+%28follow+up+page%29'),jdecode(''), jdecode('%2F762%2F804%2F9901.html'), 'false',[],'','']
		],'','']
	],'',''],
	['PAGE','11149',jdecode('Rentals+By+Owners'),jdecode(''), jdecode('%2F11149%2Findex.html'), 'true',[ 
		['PAGE','11158',jdecode('Mountain+Home'),jdecode(''), jdecode('%2F11149%2F11158.html'), 'true',[],'',''],
		['PAGE','11167',jdecode('Renegade+Retreat'),jdecode(''), jdecode('%2F11149%2F11167.html'), 'true',[],'',''],
		['PAGE','11880',jdecode('Saddle+Ridge+Slopeside+Condo'),jdecode(''), jdecode('%2F11149%2F11880.html'), 'true',[],'','']
	],'',''],
	['PAGE','11664',jdecode('Travel+News'),jdecode(''), jdecode('%2F11664.html'), 'true',[],'',''],
	['PAGE','9001',jdecode('Map'),jdecode(''), jdecode('%2F9001.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Bombay';
theSitetree.paletteFamily='8B0B22';
theSitetree.keyvisualId='7534';
theSitetree.keyvisualName='kv_7534.jpg';
theSitetree.fontsetId='16584';
theSitetree.graphicsetId='12199';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AEC6B8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bombay',
				paletteFamily: 	'8B0B22',
				keyvisualId: 	'7534',
				keyvisualName: 	'kv_7534.jpg',
				fontsetId: 		'16584',
				graphicsetId: 	'12199',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AEC6B8',
				a_color: 		'8B0B22',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-13218']={
webappId:    '7008',
documentId:  '804',
internalId:  '13218',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-13219']={
webappId:    '7008',
documentId:  '699',
internalId:  '13219',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100127-165504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20090918-130606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '783',
internalId:  '',
customField: '20071129-142708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11403',
internalId:  '',
customField: '20081118-153330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20080724-171605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20071128-161556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20071128-161630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20071127-161756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20071129-141558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090918-130901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20090918-131018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20100127-171649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20071129-143649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20100127-171842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '741',
internalId:  '',
customField: '20100127-172101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20071129-142304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '804',
internalId:  '',
customField: '20071129-143023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20071129-142920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11880',
internalId:  '',
customField: '20100127-142017'
};
webappMappings['7008']=webappMappings['7008-13217']={
webappId:    '7008',
documentId:  '783',
internalId:  '13217',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11149',
internalId:  '',
customField: '20100127-140606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11158',
internalId:  '',
customField: '20100127-135928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11167',
internalId:  '',
customField: '20100127-141252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20071129-141358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11664',
internalId:  '',
customField: '20081118-163859'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEXGA';
var companyName   = 'Ramirez+Management+Services%2C+Inc.';
var htmlTitle	  = 'Ramirez+Management+Services%2C+Big+Sky%2C+Montana';
var metaKeywords  = 'Ramirez+Management%2C+Ramirez+Property%2C+Big+Sky+Property+Management%2C+Montana+Property+Management%2C+Kristen+Ramirez%2C+Big+Sky+caretaker%2C+Big+Sky+property+manager%2C+Ramirez+Property+Manager%2C+Hidden+Village+Property+Manager%2C+Stillwater+Property+Manager%2C+Silverbow+Property+Manager%2C+Silver+Bow+Property+Manager%2C+Hidden+Village+Manager%2C+Stillwater+Manager%2C+Silverbow+Manager%2C+Silver+Bow+Manager%2C+Ramirez+Managers%2C+Big+Sky+Management+Team';
var metaContents  = 'Ramirez+Management+Services%2C+Inc.+is+a+premier+Property+Management+and+Maintenance+Provider+in+Big+Sky%2C+Montana.';
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();
};

