/* [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','4801',jdecode('Home'),jdecode(''),'/4801.html','true',[],'',''],
	['PAGE','25601',jdecode('About+us'),jdecode(''),'/25601/index.html','true',[ 
		['PAGE','37201',jdecode('Certified+Irrigation+Contractor'),jdecode(''),'/25601/37201.html','true',[],'',''],
		['PAGE','52301',jdecode('Association+Membership'),jdecode(''),'/25601/52301.html','true',[],'','']
	],'',''],
	['PAGE','22201',jdecode('Automatic+Sprinkler+System'),jdecode(''),'/22201/index.html','true',[ 
		['PAGE','17201',jdecode('FAQ'),jdecode(''),'/22201/17201.html','true',[],'','']
	],'',''],
	['PAGE','21101',jdecode('Services'),jdecode(''),'/21101/index.html','true',[ 
		['PAGE','62401',jdecode('%22How+To%22+Videos'),jdecode(''),'/21101/62401.html','true',[],'','']
	],'',''],
	['PAGE','7564',jdecode('Products+we+use'),jdecode(''),'/7564.html','true',[],'',''],
	['PAGE','4873',jdecode('Contact'),jdecode(''),'/4873.html','true',[],'',''],
	['PAGE','14901',jdecode('Guestbook+and+comments'),jdecode(''),'/14901.html','true',[],'',''],
	['PAGE','65101',jdecode('Projects'),jdecode(''),'/65101/index.html','true',[ 
		['PAGE','69701',jdecode('Fairhaven+Church_Centerville'),jdecode(''),'/65101/69701.html','true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Meadow';
theSitetree.paletteFamily='0000BB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10704';
theSitetree.graphicsetId='10949';
theSitetree.contentColor='0000AA';
theSitetree.contentBGColor='9FD796';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Meadow',
				paletteFamily: 	'0000BB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10704',
				graphicsetId: 	'10949',
				contentColor: 	'0000AA',
				contentBGColor: '9FD796',
				a_color: 		'6EC262',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100906-051736'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4873',
internalId:  '',
customField: '20090304-110321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20091206-050824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37201',
internalId:  '',
customField: '20100906-052200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7564',
internalId:  '',
customField: '20091202-023011'
};
webappMappings['1002']=webappMappings['1002-14901aen330inzsqa']={
webappId:    '1002',
documentId:  '14901',
internalId:  '14901aen330inzsqa',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20090303-143316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20100228-044838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20100315-140928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20100312-060644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69701',
internalId:  '',
customField: '20100906-053200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52301',
internalId:  '',
customField: '20100312-060216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20100228-061819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65101',
internalId:  '',
customField: '20100628-193130'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INZSQA';
var companyName   = 'Rainscapes+Irrigation';
var htmlTitle	  = 'www.rainscapesirrigation.com';
var metaKeywords  = 'Rainscapes%2C+Irrigation%2CContractors%2CSpringboro%2CLebanon%2CCenterville%2C+Dayton%2C+Cincinnati%2COhio%2CInstallation%2CService%2CSouthwest+Ohio%2CWarren+County%2CBBB%2CMontgomery+County%2CHamilton+County%2CGreene+County%2CButler+County%2CDarke+County%2C+Irrigation+Contractor';
var metaContents  = 'Rainscapes+Irrigation+is+a+premiere+installation+and+service+contractor+serving+Southwest+Ohio.++Call+%28937%29+313-6644.+Irrigation+Contractor';
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();
};
